-- 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.ReferenceRegistrationOptions where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
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

{-|
Registration options for a `ReferencesRequest`.
-}
data ReferenceRegistrationOptions = ReferenceRegistrationOptions 
  { {-|
  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.
  -}
  ReferenceRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  ReferenceRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  }
  deriving stock (Int -> ReferenceRegistrationOptions -> ShowS
[ReferenceRegistrationOptions] -> ShowS
ReferenceRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReferenceRegistrationOptions] -> ShowS
$cshowList :: [ReferenceRegistrationOptions] -> ShowS
show :: ReferenceRegistrationOptions -> String
$cshow :: ReferenceRegistrationOptions -> String
showsPrec :: Int -> ReferenceRegistrationOptions -> ShowS
$cshowsPrec :: Int -> ReferenceRegistrationOptions -> ShowS
Show, ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c/= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
== :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c== :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
Eq, Eq ReferenceRegistrationOptions
ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Ordering
ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
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 :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
$cmin :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
max :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
$cmax :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
>= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c>= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
> :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c> :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
<= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c<= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
< :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c< :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
compare :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Ordering
$ccompare :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Ordering
Ord, forall x.
Rep ReferenceRegistrationOptions x -> ReferenceRegistrationOptions
forall x.
ReferenceRegistrationOptions -> Rep ReferenceRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReferenceRegistrationOptions x -> ReferenceRegistrationOptions
$cfrom :: forall x.
ReferenceRegistrationOptions -> Rep ReferenceRegistrationOptions x
Generic)
  deriving anyclass (ReferenceRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: ReferenceRegistrationOptions -> ()
$crnf :: ReferenceRegistrationOptions -> ()
NFData, Eq ReferenceRegistrationOptions
Int -> ReferenceRegistrationOptions -> Int
ReferenceRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ReferenceRegistrationOptions -> Int
$chash :: ReferenceRegistrationOptions -> Int
hashWithSalt :: Int -> ReferenceRegistrationOptions -> Int
$chashWithSalt :: Int -> ReferenceRegistrationOptions -> Int
Hashable)

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

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