{- 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.TextDocumentSaveRegistrationOptions 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.Internal.Types.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Save registration options.
-}
data TextDocumentSaveRegistrationOptions = TextDocumentSaveRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  TextDocumentSaveRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|
  The client is supposed to include the content on save.
  -}
  TextDocumentSaveRegistrationOptions -> Maybe Bool
_includeText :: (Maybe Bool)
  }
  deriving stock (Int -> TextDocumentSaveRegistrationOptions -> ShowS
[TextDocumentSaveRegistrationOptions] -> ShowS
TextDocumentSaveRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentSaveRegistrationOptions] -> ShowS
$cshowList :: [TextDocumentSaveRegistrationOptions] -> ShowS
show :: TextDocumentSaveRegistrationOptions -> String
$cshow :: TextDocumentSaveRegistrationOptions -> String
showsPrec :: Int -> TextDocumentSaveRegistrationOptions -> ShowS
$cshowsPrec :: Int -> TextDocumentSaveRegistrationOptions -> ShowS
Show, TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c/= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
== :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c== :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
Eq, Eq TextDocumentSaveRegistrationOptions
TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Ordering
TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
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 :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
$cmin :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
max :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
$cmax :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions
>= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c>= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
> :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c> :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
<= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c<= :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
< :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
$c< :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Bool
compare :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Ordering
$ccompare :: TextDocumentSaveRegistrationOptions
-> TextDocumentSaveRegistrationOptions -> Ordering
Ord, forall x.
Rep TextDocumentSaveRegistrationOptions x
-> TextDocumentSaveRegistrationOptions
forall x.
TextDocumentSaveRegistrationOptions
-> Rep TextDocumentSaveRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TextDocumentSaveRegistrationOptions x
-> TextDocumentSaveRegistrationOptions
$cfrom :: forall x.
TextDocumentSaveRegistrationOptions
-> Rep TextDocumentSaveRegistrationOptions x
Generic)
  deriving anyclass (TextDocumentSaveRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentSaveRegistrationOptions -> ()
$crnf :: TextDocumentSaveRegistrationOptions -> ()
NFData, Eq TextDocumentSaveRegistrationOptions
Int -> TextDocumentSaveRegistrationOptions -> Int
TextDocumentSaveRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentSaveRegistrationOptions -> Int
$chash :: TextDocumentSaveRegistrationOptions -> Int
hashWithSalt :: Int -> TextDocumentSaveRegistrationOptions -> Int
$chashWithSalt :: Int -> TextDocumentSaveRegistrationOptions -> Int
Hashable)
  deriving forall ann. [TextDocumentSaveRegistrationOptions] -> Doc ann
forall ann. TextDocumentSaveRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TextDocumentSaveRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [TextDocumentSaveRegistrationOptions] -> Doc ann
pretty :: forall ann. TextDocumentSaveRegistrationOptions -> Doc ann
$cpretty :: forall ann. TextDocumentSaveRegistrationOptions -> Doc ann
Pretty via (ViaJSON TextDocumentSaveRegistrationOptions)

instance Aeson.ToJSON TextDocumentSaveRegistrationOptions where
  toJSON :: TextDocumentSaveRegistrationOptions -> Value
toJSON (TextDocumentSaveRegistrationOptions DocumentSelector |? Null
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
$  [[Key
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"includeText" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1]

instance Aeson.FromJSON TextDocumentSaveRegistrationOptions where
  parseJSON :: Value -> Parser TextDocumentSaveRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentSaveRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> TextDocumentSaveRegistrationOptions
TextDocumentSaveRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" 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
"includeText"