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

{-|
Describe options to be used when registered for text document change events.
-}
data TextDocumentChangeRegistrationOptions = TextDocumentChangeRegistrationOptions 
  { {-|
  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.
  -}
  TextDocumentChangeRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|
  How documents are synced to the server.
  -}
  TextDocumentChangeRegistrationOptions -> TextDocumentSyncKind
_syncKind :: Language.LSP.Protocol.Internal.Types.TextDocumentSyncKind.TextDocumentSyncKind
  }
  deriving stock (Int -> TextDocumentChangeRegistrationOptions -> ShowS
[TextDocumentChangeRegistrationOptions] -> ShowS
TextDocumentChangeRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDocumentChangeRegistrationOptions] -> ShowS
$cshowList :: [TextDocumentChangeRegistrationOptions] -> ShowS
show :: TextDocumentChangeRegistrationOptions -> String
$cshow :: TextDocumentChangeRegistrationOptions -> String
showsPrec :: Int -> TextDocumentChangeRegistrationOptions -> ShowS
$cshowsPrec :: Int -> TextDocumentChangeRegistrationOptions -> ShowS
Show, TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c/= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
== :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c== :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
Eq, Eq TextDocumentChangeRegistrationOptions
TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Ordering
TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
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 :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
$cmin :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
max :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
$cmax :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions
>= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c>= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
> :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c> :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
<= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c<= :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
< :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
$c< :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Bool
compare :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Ordering
$ccompare :: TextDocumentChangeRegistrationOptions
-> TextDocumentChangeRegistrationOptions -> Ordering
Ord, forall x.
Rep TextDocumentChangeRegistrationOptions x
-> TextDocumentChangeRegistrationOptions
forall x.
TextDocumentChangeRegistrationOptions
-> Rep TextDocumentChangeRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TextDocumentChangeRegistrationOptions x
-> TextDocumentChangeRegistrationOptions
$cfrom :: forall x.
TextDocumentChangeRegistrationOptions
-> Rep TextDocumentChangeRegistrationOptions x
Generic)
  deriving anyclass (TextDocumentChangeRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: TextDocumentChangeRegistrationOptions -> ()
$crnf :: TextDocumentChangeRegistrationOptions -> ()
NFData, Eq TextDocumentChangeRegistrationOptions
Int -> TextDocumentChangeRegistrationOptions -> Int
TextDocumentChangeRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TextDocumentChangeRegistrationOptions -> Int
$chash :: TextDocumentChangeRegistrationOptions -> Int
hashWithSalt :: Int -> TextDocumentChangeRegistrationOptions -> Int
$chashWithSalt :: Int -> TextDocumentChangeRegistrationOptions -> Int
Hashable)
  deriving forall ann. [TextDocumentChangeRegistrationOptions] -> Doc ann
forall ann. TextDocumentChangeRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [TextDocumentChangeRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [TextDocumentChangeRegistrationOptions] -> Doc ann
pretty :: forall ann. TextDocumentChangeRegistrationOptions -> Doc ann
$cpretty :: forall ann. TextDocumentChangeRegistrationOptions -> Doc ann
Pretty via (ViaJSON TextDocumentChangeRegistrationOptions)

instance Aeson.ToJSON TextDocumentChangeRegistrationOptions where
  toJSON :: TextDocumentChangeRegistrationOptions -> Value
toJSON (TextDocumentChangeRegistrationOptions DocumentSelector |? Null
arg0 TextDocumentSyncKind
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]
    ,[Key
"syncKind" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentSyncKind
arg1]]

instance Aeson.FromJSON TextDocumentChangeRegistrationOptions where
  parseJSON :: Value -> Parser TextDocumentChangeRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TextDocumentChangeRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> TextDocumentSyncKind -> TextDocumentChangeRegistrationOptions
TextDocumentChangeRegistrationOptions 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 a
Aeson..: Key
"syncKind"