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

{-|

-}
data LinkedEditingRangeRegistrationOptions = LinkedEditingRangeRegistrationOptions 
  { {-|
  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.
  -}
  LinkedEditingRangeRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  LinkedEditingRangeRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  The id used to register the request. The id can be used to deregister
  the request again. See also Registration#id.
  -}
  LinkedEditingRangeRegistrationOptions -> Maybe Text
_id :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> LinkedEditingRangeRegistrationOptions -> ShowS
[LinkedEditingRangeRegistrationOptions] -> ShowS
LinkedEditingRangeRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LinkedEditingRangeRegistrationOptions] -> ShowS
$cshowList :: [LinkedEditingRangeRegistrationOptions] -> ShowS
show :: LinkedEditingRangeRegistrationOptions -> String
$cshow :: LinkedEditingRangeRegistrationOptions -> String
showsPrec :: Int -> LinkedEditingRangeRegistrationOptions -> ShowS
$cshowsPrec :: Int -> LinkedEditingRangeRegistrationOptions -> ShowS
Show, LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c/= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
== :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c== :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
Eq, Eq LinkedEditingRangeRegistrationOptions
LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Ordering
LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
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 :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
$cmin :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
max :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
$cmax :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions
>= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c>= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
> :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c> :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
<= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c<= :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
< :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
$c< :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Bool
compare :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Ordering
$ccompare :: LinkedEditingRangeRegistrationOptions
-> LinkedEditingRangeRegistrationOptions -> Ordering
Ord, forall x.
Rep LinkedEditingRangeRegistrationOptions x
-> LinkedEditingRangeRegistrationOptions
forall x.
LinkedEditingRangeRegistrationOptions
-> Rep LinkedEditingRangeRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LinkedEditingRangeRegistrationOptions x
-> LinkedEditingRangeRegistrationOptions
$cfrom :: forall x.
LinkedEditingRangeRegistrationOptions
-> Rep LinkedEditingRangeRegistrationOptions x
Generic)
  deriving anyclass (LinkedEditingRangeRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: LinkedEditingRangeRegistrationOptions -> ()
$crnf :: LinkedEditingRangeRegistrationOptions -> ()
NFData, Eq LinkedEditingRangeRegistrationOptions
Int -> LinkedEditingRangeRegistrationOptions -> Int
LinkedEditingRangeRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: LinkedEditingRangeRegistrationOptions -> Int
$chash :: LinkedEditingRangeRegistrationOptions -> Int
hashWithSalt :: Int -> LinkedEditingRangeRegistrationOptions -> Int
$chashWithSalt :: Int -> LinkedEditingRangeRegistrationOptions -> Int
Hashable)
  deriving forall ann. [LinkedEditingRangeRegistrationOptions] -> Doc ann
forall ann. LinkedEditingRangeRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [LinkedEditingRangeRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [LinkedEditingRangeRegistrationOptions] -> Doc ann
pretty :: forall ann. LinkedEditingRangeRegistrationOptions -> Doc ann
$cpretty :: forall ann. LinkedEditingRangeRegistrationOptions -> Doc ann
Pretty via (ViaJSON LinkedEditingRangeRegistrationOptions)

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

instance Aeson.FromJSON LinkedEditingRangeRegistrationOptions where
  parseJSON :: Value -> Parser LinkedEditingRangeRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"LinkedEditingRangeRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool
-> Maybe Text
-> LinkedEditingRangeRegistrationOptions
LinkedEditingRangeRegistrationOptions 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
"workDoneProgress" 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
"id"