{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.RenameFileOptions 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 RenameFileOptions = RenameFileOptions
{
RenameFileOptions -> Maybe Bool
_overwrite :: (Maybe Bool)
,
RenameFileOptions -> Maybe Bool
_ignoreIfExists :: (Maybe Bool)
}
deriving stock (Int -> RenameFileOptions -> ShowS
[RenameFileOptions] -> ShowS
RenameFileOptions -> String
(Int -> RenameFileOptions -> ShowS)
-> (RenameFileOptions -> String)
-> ([RenameFileOptions] -> ShowS)
-> Show RenameFileOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RenameFileOptions -> ShowS
showsPrec :: Int -> RenameFileOptions -> ShowS
$cshow :: RenameFileOptions -> String
show :: RenameFileOptions -> String
$cshowList :: [RenameFileOptions] -> ShowS
showList :: [RenameFileOptions] -> ShowS
Show, RenameFileOptions -> RenameFileOptions -> Bool
(RenameFileOptions -> RenameFileOptions -> Bool)
-> (RenameFileOptions -> RenameFileOptions -> Bool)
-> Eq RenameFileOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RenameFileOptions -> RenameFileOptions -> Bool
== :: RenameFileOptions -> RenameFileOptions -> Bool
$c/= :: RenameFileOptions -> RenameFileOptions -> Bool
/= :: RenameFileOptions -> RenameFileOptions -> Bool
Eq, Eq RenameFileOptions
Eq RenameFileOptions =>
(RenameFileOptions -> RenameFileOptions -> Ordering)
-> (RenameFileOptions -> RenameFileOptions -> Bool)
-> (RenameFileOptions -> RenameFileOptions -> Bool)
-> (RenameFileOptions -> RenameFileOptions -> Bool)
-> (RenameFileOptions -> RenameFileOptions -> Bool)
-> (RenameFileOptions -> RenameFileOptions -> RenameFileOptions)
-> (RenameFileOptions -> RenameFileOptions -> RenameFileOptions)
-> Ord RenameFileOptions
RenameFileOptions -> RenameFileOptions -> Bool
RenameFileOptions -> RenameFileOptions -> Ordering
RenameFileOptions -> RenameFileOptions -> RenameFileOptions
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 :: RenameFileOptions -> RenameFileOptions -> Ordering
compare :: RenameFileOptions -> RenameFileOptions -> Ordering
$c< :: RenameFileOptions -> RenameFileOptions -> Bool
< :: RenameFileOptions -> RenameFileOptions -> Bool
$c<= :: RenameFileOptions -> RenameFileOptions -> Bool
<= :: RenameFileOptions -> RenameFileOptions -> Bool
$c> :: RenameFileOptions -> RenameFileOptions -> Bool
> :: RenameFileOptions -> RenameFileOptions -> Bool
$c>= :: RenameFileOptions -> RenameFileOptions -> Bool
>= :: RenameFileOptions -> RenameFileOptions -> Bool
$cmax :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
max :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
$cmin :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
min :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
Ord, (forall x. RenameFileOptions -> Rep RenameFileOptions x)
-> (forall x. Rep RenameFileOptions x -> RenameFileOptions)
-> Generic RenameFileOptions
forall x. Rep RenameFileOptions x -> RenameFileOptions
forall x. RenameFileOptions -> Rep RenameFileOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RenameFileOptions -> Rep RenameFileOptions x
from :: forall x. RenameFileOptions -> Rep RenameFileOptions x
$cto :: forall x. Rep RenameFileOptions x -> RenameFileOptions
to :: forall x. Rep RenameFileOptions x -> RenameFileOptions
Generic)
deriving anyclass (RenameFileOptions -> ()
(RenameFileOptions -> ()) -> NFData RenameFileOptions
forall a. (a -> ()) -> NFData a
$crnf :: RenameFileOptions -> ()
rnf :: RenameFileOptions -> ()
NFData, Eq RenameFileOptions
Eq RenameFileOptions =>
(Int -> RenameFileOptions -> Int)
-> (RenameFileOptions -> Int) -> Hashable RenameFileOptions
Int -> RenameFileOptions -> Int
RenameFileOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> RenameFileOptions -> Int
hashWithSalt :: Int -> RenameFileOptions -> Int
$chash :: RenameFileOptions -> Int
hash :: RenameFileOptions -> Int
Hashable)
deriving (forall ann. RenameFileOptions -> Doc ann)
-> (forall ann. [RenameFileOptions] -> Doc ann)
-> Pretty RenameFileOptions
forall ann. [RenameFileOptions] -> Doc ann
forall ann. RenameFileOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. RenameFileOptions -> Doc ann
pretty :: forall ann. RenameFileOptions -> Doc ann
$cprettyList :: forall ann. [RenameFileOptions] -> Doc ann
prettyList :: forall ann. [RenameFileOptions] -> Doc ann
Pretty via (ViaJSON RenameFileOptions)
instance Aeson.ToJSON RenameFileOptions where
toJSON :: RenameFileOptions -> Value
toJSON (RenameFileOptions 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 RenameFileOptions where
parseJSON :: Value -> Parser RenameFileOptions
parseJSON = String
-> (Object -> Parser RenameFileOptions)
-> Value
-> Parser RenameFileOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RenameFileOptions" ((Object -> Parser RenameFileOptions)
-> Value -> Parser RenameFileOptions)
-> (Object -> Parser RenameFileOptions)
-> Value
-> Parser RenameFileOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Bool -> RenameFileOptions
RenameFileOptions (Maybe Bool -> Maybe Bool -> RenameFileOptions)
-> Parser (Maybe Bool) -> Parser (Maybe Bool -> RenameFileOptions)
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 -> RenameFileOptions)
-> Parser (Maybe Bool) -> Parser RenameFileOptions
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"