{- 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.SelectionRangeRegistrationOptions 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 SelectionRangeRegistrationOptions = SelectionRangeRegistrationOptions 
  { {-|

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

instance Aeson.ToJSON SelectionRangeRegistrationOptions where
  toJSON :: SelectionRangeRegistrationOptions -> Value
toJSON (SelectionRangeRegistrationOptions Maybe Bool
arg0 DocumentSelector |? Null
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
$  [String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,[Key
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
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 SelectionRangeRegistrationOptions where
  parseJSON :: Value -> Parser SelectionRangeRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SelectionRangeRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> (DocumentSelector |? Null)
-> Maybe Text
-> SelectionRangeRegistrationOptions
SelectionRangeRegistrationOptions 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
"workDoneProgress" 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
"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
"id"