{- 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
(Int -> SelectionRangeRegistrationOptions -> ShowS)
-> (SelectionRangeRegistrationOptions -> String)
-> ([SelectionRangeRegistrationOptions] -> ShowS)
-> Show SelectionRangeRegistrationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SelectionRangeRegistrationOptions -> ShowS
showsPrec :: Int -> SelectionRangeRegistrationOptions -> ShowS
$cshow :: SelectionRangeRegistrationOptions -> String
show :: SelectionRangeRegistrationOptions -> String
$cshowList :: [SelectionRangeRegistrationOptions] -> ShowS
showList :: [SelectionRangeRegistrationOptions] -> ShowS
Show, SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
(SelectionRangeRegistrationOptions
 -> SelectionRangeRegistrationOptions -> Bool)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions -> Bool)
-> Eq SelectionRangeRegistrationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
== :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
$c/= :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
/= :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
Eq, Eq SelectionRangeRegistrationOptions
Eq SelectionRangeRegistrationOptions =>
(SelectionRangeRegistrationOptions
 -> SelectionRangeRegistrationOptions -> Ordering)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions -> Bool)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions -> Bool)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions -> Bool)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions -> Bool)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions)
-> (SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions
    -> SelectionRangeRegistrationOptions)
-> Ord 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
$ccompare :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Ordering
compare :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Ordering
$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
>= :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions -> Bool
$cmax :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
max :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
$cmin :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
min :: SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
-> SelectionRangeRegistrationOptions
Ord, (forall x.
 SelectionRangeRegistrationOptions
 -> Rep SelectionRangeRegistrationOptions x)
-> (forall x.
    Rep SelectionRangeRegistrationOptions x
    -> SelectionRangeRegistrationOptions)
-> Generic SelectionRangeRegistrationOptions
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
$cfrom :: forall x.
SelectionRangeRegistrationOptions
-> Rep SelectionRangeRegistrationOptions x
from :: forall x.
SelectionRangeRegistrationOptions
-> Rep SelectionRangeRegistrationOptions x
$cto :: forall x.
Rep SelectionRangeRegistrationOptions x
-> SelectionRangeRegistrationOptions
to :: forall x.
Rep SelectionRangeRegistrationOptions x
-> SelectionRangeRegistrationOptions
Generic)
  deriving anyclass (SelectionRangeRegistrationOptions -> ()
(SelectionRangeRegistrationOptions -> ())
-> NFData SelectionRangeRegistrationOptions
forall a. (a -> ()) -> NFData a
$crnf :: SelectionRangeRegistrationOptions -> ()
rnf :: SelectionRangeRegistrationOptions -> ()
NFData, Eq SelectionRangeRegistrationOptions
Eq SelectionRangeRegistrationOptions =>
(Int -> SelectionRangeRegistrationOptions -> Int)
-> (SelectionRangeRegistrationOptions -> Int)
-> Hashable SelectionRangeRegistrationOptions
Int -> SelectionRangeRegistrationOptions -> Int
SelectionRangeRegistrationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> SelectionRangeRegistrationOptions -> Int
hashWithSalt :: Int -> SelectionRangeRegistrationOptions -> Int
$chash :: SelectionRangeRegistrationOptions -> Int
hash :: SelectionRangeRegistrationOptions -> Int
Hashable)
  deriving (forall ann. SelectionRangeRegistrationOptions -> Doc ann)
-> (forall ann. [SelectionRangeRegistrationOptions] -> Doc ann)
-> Pretty SelectionRangeRegistrationOptions
forall ann. [SelectionRangeRegistrationOptions] -> Doc ann
forall ann. SelectionRangeRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. SelectionRangeRegistrationOptions -> Doc ann
pretty :: forall ann. SelectionRangeRegistrationOptions -> Doc ann
$cprettyList :: forall ann. [SelectionRangeRegistrationOptions] -> Doc ann
prettyList :: 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 ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0
    ,[Key
"documentSelector" Key -> (DocumentSelector |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg1]
    ,String
"id" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e 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 = String
-> (Object -> Parser SelectionRangeRegistrationOptions)
-> Value
-> Parser SelectionRangeRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"SelectionRangeRegistrationOptions" ((Object -> Parser SelectionRangeRegistrationOptions)
 -> Value -> Parser SelectionRangeRegistrationOptions)
-> (Object -> Parser SelectionRangeRegistrationOptions)
-> Value
-> Parser SelectionRangeRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool
-> (DocumentSelector |? Null)
-> Maybe Text
-> SelectionRangeRegistrationOptions
SelectionRangeRegistrationOptions (Maybe Bool
 -> (DocumentSelector |? Null)
 -> Maybe Text
 -> SelectionRangeRegistrationOptions)
-> Parser (Maybe Bool)
-> Parser
     ((DocumentSelector |? Null)
      -> Maybe Text -> SelectionRangeRegistrationOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser
  ((DocumentSelector |? Null)
   -> Maybe Text -> SelectionRangeRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser (Maybe Text -> SelectionRangeRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (DocumentSelector |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" Parser (Maybe Text -> SelectionRangeRegistrationOptions)
-> Parser (Maybe Text) -> Parser SelectionRangeRegistrationOptions
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"id"