{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# 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

{-|
Rename file options
-}
data RenameFileOptions = RenameFileOptions 
  { {-|
  Overwrite target if existing. Overwrite wins over `ignoreIfExists`
  -}
  RenameFileOptions -> Maybe Bool
_overwrite :: (Maybe Bool)
  , {-|
  Ignores if target exists.
  -}
  RenameFileOptions -> Maybe Bool
_ignoreIfExists :: (Maybe Bool)
  }
  deriving stock (Int -> RenameFileOptions -> ShowS
[RenameFileOptions] -> ShowS
RenameFileOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenameFileOptions] -> ShowS
$cshowList :: [RenameFileOptions] -> ShowS
show :: RenameFileOptions -> String
$cshow :: RenameFileOptions -> String
showsPrec :: Int -> RenameFileOptions -> ShowS
$cshowsPrec :: Int -> RenameFileOptions -> ShowS
Show, RenameFileOptions -> RenameFileOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenameFileOptions -> RenameFileOptions -> Bool
$c/= :: RenameFileOptions -> RenameFileOptions -> Bool
== :: RenameFileOptions -> RenameFileOptions -> Bool
$c== :: RenameFileOptions -> RenameFileOptions -> Bool
Eq, Eq 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
min :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
$cmin :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
max :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
$cmax :: RenameFileOptions -> RenameFileOptions -> RenameFileOptions
>= :: RenameFileOptions -> RenameFileOptions -> Bool
$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
compare :: RenameFileOptions -> RenameFileOptions -> Ordering
$ccompare :: RenameFileOptions -> RenameFileOptions -> Ordering
Ord, 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
$cto :: forall x. Rep RenameFileOptions x -> RenameFileOptions
$cfrom :: forall x. RenameFileOptions -> Rep RenameFileOptions x
Generic)
  deriving anyclass (RenameFileOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: RenameFileOptions -> ()
$crnf :: RenameFileOptions -> ()
NFData, Eq RenameFileOptions
Int -> RenameFileOptions -> Int
RenameFileOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: RenameFileOptions -> Int
$chash :: RenameFileOptions -> Int
hashWithSalt :: Int -> RenameFileOptions -> Int
$chashWithSalt :: Int -> RenameFileOptions -> Int
Hashable)
  deriving forall ann. [RenameFileOptions] -> Doc ann
forall ann. RenameFileOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [RenameFileOptions] -> Doc ann
$cprettyList :: forall ann. [RenameFileOptions] -> Doc ann
pretty :: forall ann. RenameFileOptions -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [String
"overwrite" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,String
"ignoreIfExists" forall kv v. (KeyValue 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 = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RenameFileOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Bool -> RenameFileOptions
RenameFileOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"overwrite" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"ignoreIfExists"