{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.CreateFileOptions where
import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Types.Common
data CreateFileOptions = CreateFileOptions
{
CreateFileOptions -> Maybe Bool
_overwrite :: (Maybe Bool)
,
CreateFileOptions -> Maybe Bool
_ignoreIfExists :: (Maybe Bool)
}
deriving stock (Int -> CreateFileOptions -> ShowS
[CreateFileOptions] -> ShowS
CreateFileOptions -> String
(Int -> CreateFileOptions -> ShowS)
-> (CreateFileOptions -> String)
-> ([CreateFileOptions] -> ShowS)
-> Show CreateFileOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateFileOptions -> ShowS
showsPrec :: Int -> CreateFileOptions -> ShowS
$cshow :: CreateFileOptions -> String
show :: CreateFileOptions -> String
$cshowList :: [CreateFileOptions] -> ShowS
showList :: [CreateFileOptions] -> ShowS
Show, CreateFileOptions -> CreateFileOptions -> Bool
(CreateFileOptions -> CreateFileOptions -> Bool)
-> (CreateFileOptions -> CreateFileOptions -> Bool)
-> Eq CreateFileOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateFileOptions -> CreateFileOptions -> Bool
== :: CreateFileOptions -> CreateFileOptions -> Bool
$c/= :: CreateFileOptions -> CreateFileOptions -> Bool
/= :: CreateFileOptions -> CreateFileOptions -> Bool
Eq, Eq CreateFileOptions
Eq CreateFileOptions =>
(CreateFileOptions -> CreateFileOptions -> Ordering)
-> (CreateFileOptions -> CreateFileOptions -> Bool)
-> (CreateFileOptions -> CreateFileOptions -> Bool)
-> (CreateFileOptions -> CreateFileOptions -> Bool)
-> (CreateFileOptions -> CreateFileOptions -> Bool)
-> (CreateFileOptions -> CreateFileOptions -> CreateFileOptions)
-> (CreateFileOptions -> CreateFileOptions -> CreateFileOptions)
-> Ord CreateFileOptions
CreateFileOptions -> CreateFileOptions -> Bool
CreateFileOptions -> CreateFileOptions -> Ordering
CreateFileOptions -> CreateFileOptions -> CreateFileOptions
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CreateFileOptions -> CreateFileOptions -> Ordering
compare :: CreateFileOptions -> CreateFileOptions -> Ordering
$c< :: CreateFileOptions -> CreateFileOptions -> Bool
< :: CreateFileOptions -> CreateFileOptions -> Bool
$c<= :: CreateFileOptions -> CreateFileOptions -> Bool
<= :: CreateFileOptions -> CreateFileOptions -> Bool
$c> :: CreateFileOptions -> CreateFileOptions -> Bool
> :: CreateFileOptions -> CreateFileOptions -> Bool
$c>= :: CreateFileOptions -> CreateFileOptions -> Bool
>= :: CreateFileOptions -> CreateFileOptions -> Bool
$cmax :: CreateFileOptions -> CreateFileOptions -> CreateFileOptions
max :: CreateFileOptions -> CreateFileOptions -> CreateFileOptions
$cmin :: CreateFileOptions -> CreateFileOptions -> CreateFileOptions
min :: CreateFileOptions -> CreateFileOptions -> CreateFileOptions
Ord, (forall x. CreateFileOptions -> Rep CreateFileOptions x)
-> (forall x. Rep CreateFileOptions x -> CreateFileOptions)
-> Generic CreateFileOptions
forall x. Rep CreateFileOptions x -> CreateFileOptions
forall x. CreateFileOptions -> Rep CreateFileOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CreateFileOptions -> Rep CreateFileOptions x
from :: forall x. CreateFileOptions -> Rep CreateFileOptions x
$cto :: forall x. Rep CreateFileOptions x -> CreateFileOptions
to :: forall x. Rep CreateFileOptions x -> CreateFileOptions
Generic)
deriving anyclass (CreateFileOptions -> ()
(CreateFileOptions -> ()) -> NFData CreateFileOptions
forall a. (a -> ()) -> NFData a
$crnf :: CreateFileOptions -> ()
rnf :: CreateFileOptions -> ()
NFData, Eq CreateFileOptions
Eq CreateFileOptions =>
(Int -> CreateFileOptions -> Int)
-> (CreateFileOptions -> Int) -> Hashable CreateFileOptions
Int -> CreateFileOptions -> Int
CreateFileOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> CreateFileOptions -> Int
hashWithSalt :: Int -> CreateFileOptions -> Int
$chash :: CreateFileOptions -> Int
hash :: CreateFileOptions -> Int
Hashable)
deriving (forall ann. CreateFileOptions -> Doc ann)
-> (forall ann. [CreateFileOptions] -> Doc ann)
-> Pretty CreateFileOptions
forall ann. [CreateFileOptions] -> Doc ann
forall ann. CreateFileOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. CreateFileOptions -> Doc ann
pretty :: forall ann. CreateFileOptions -> Doc ann
$cprettyList :: forall ann. [CreateFileOptions] -> Doc ann
prettyList :: forall ann. [CreateFileOptions] -> Doc ann
Pretty via (ViaJSON CreateFileOptions)
instance Aeson.ToJSON CreateFileOptions where
toJSON :: CreateFileOptions -> Value
toJSON (CreateFileOptions Maybe Bool
arg0 Maybe Bool
arg1) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$ [String
"overwrite" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
,String
"ignoreIfExists" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1]
instance Aeson.FromJSON CreateFileOptions where
parseJSON :: Value -> Parser CreateFileOptions
parseJSON = String
-> (Object -> Parser CreateFileOptions)
-> Value
-> Parser CreateFileOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CreateFileOptions" ((Object -> Parser CreateFileOptions)
-> Value -> Parser CreateFileOptions)
-> (Object -> Parser CreateFileOptions)
-> Value
-> Parser CreateFileOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Bool -> CreateFileOptions
CreateFileOptions (Maybe Bool -> Maybe Bool -> CreateFileOptions)
-> Parser (Maybe Bool) -> Parser (Maybe Bool -> CreateFileOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"overwrite" Parser (Maybe Bool -> CreateFileOptions)
-> Parser (Maybe Bool) -> Parser CreateFileOptions
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"ignoreIfExists"