{- 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.ReferenceRegistrationOptions 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.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
(Int -> ReferenceRegistrationOptions -> ShowS)
-> (ReferenceRegistrationOptions -> String)
-> ([ReferenceRegistrationOptions] -> ShowS)
-> Show ReferenceRegistrationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReferenceRegistrationOptions -> ShowS
showsPrec :: Int -> ReferenceRegistrationOptions -> ShowS
$cshow :: ReferenceRegistrationOptions -> String
show :: ReferenceRegistrationOptions -> String
$cshowList :: [ReferenceRegistrationOptions] -> ShowS
showList :: [ReferenceRegistrationOptions] -> ShowS
Show, ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
(ReferenceRegistrationOptions
 -> ReferenceRegistrationOptions -> Bool)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> Bool)
-> Eq ReferenceRegistrationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
== :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$c/= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
/= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
Eq, Eq ReferenceRegistrationOptions
Eq ReferenceRegistrationOptions =>
(ReferenceRegistrationOptions
 -> ReferenceRegistrationOptions -> Ordering)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> Bool)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> Bool)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> Bool)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> Bool)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> ReferenceRegistrationOptions)
-> (ReferenceRegistrationOptions
    -> ReferenceRegistrationOptions -> ReferenceRegistrationOptions)
-> Ord 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
$ccompare :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Ordering
compare :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Ordering
$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
>= :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> Bool
$cmax :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
max :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
$cmin :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
min :: ReferenceRegistrationOptions
-> ReferenceRegistrationOptions -> ReferenceRegistrationOptions
Ord, (forall x.
 ReferenceRegistrationOptions -> Rep ReferenceRegistrationOptions x)
-> (forall x.
    Rep ReferenceRegistrationOptions x -> ReferenceRegistrationOptions)
-> Generic ReferenceRegistrationOptions
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
$cfrom :: forall x.
ReferenceRegistrationOptions -> Rep ReferenceRegistrationOptions x
from :: forall x.
ReferenceRegistrationOptions -> Rep ReferenceRegistrationOptions x
$cto :: forall x.
Rep ReferenceRegistrationOptions x -> ReferenceRegistrationOptions
to :: forall x.
Rep ReferenceRegistrationOptions x -> ReferenceRegistrationOptions
Generic)
  deriving anyclass (ReferenceRegistrationOptions -> ()
(ReferenceRegistrationOptions -> ())
-> NFData ReferenceRegistrationOptions
forall a. (a -> ()) -> NFData a
$crnf :: ReferenceRegistrationOptions -> ()
rnf :: ReferenceRegistrationOptions -> ()
NFData, Eq ReferenceRegistrationOptions
Eq ReferenceRegistrationOptions =>
(Int -> ReferenceRegistrationOptions -> Int)
-> (ReferenceRegistrationOptions -> Int)
-> Hashable ReferenceRegistrationOptions
Int -> ReferenceRegistrationOptions -> Int
ReferenceRegistrationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> ReferenceRegistrationOptions -> Int
hashWithSalt :: Int -> ReferenceRegistrationOptions -> Int
$chash :: ReferenceRegistrationOptions -> Int
hash :: ReferenceRegistrationOptions -> Int
Hashable)
  deriving (forall ann. ReferenceRegistrationOptions -> Doc ann)
-> (forall ann. [ReferenceRegistrationOptions] -> Doc ann)
-> Pretty ReferenceRegistrationOptions
forall ann. [ReferenceRegistrationOptions] -> Doc ann
forall ann. ReferenceRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. ReferenceRegistrationOptions -> Doc ann
pretty :: forall ann. ReferenceRegistrationOptions -> Doc ann
$cprettyList :: forall ann. [ReferenceRegistrationOptions] -> Doc ann
prettyList :: forall ann. [ReferenceRegistrationOptions] -> Doc ann
Pretty via (ViaJSON ReferenceRegistrationOptions)

instance Aeson.ToJSON ReferenceRegistrationOptions where
  toJSON :: ReferenceRegistrationOptions -> Value
toJSON (ReferenceRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1) = [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
$  [[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
arg0]
    ,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
arg1]

instance Aeson.FromJSON ReferenceRegistrationOptions where
  parseJSON :: Value -> Parser ReferenceRegistrationOptions
parseJSON = String
-> (Object -> Parser ReferenceRegistrationOptions)
-> Value
-> Parser ReferenceRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ReferenceRegistrationOptions" ((Object -> Parser ReferenceRegistrationOptions)
 -> Value -> Parser ReferenceRegistrationOptions)
-> (Object -> Parser ReferenceRegistrationOptions)
-> Value
-> Parser ReferenceRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> ReferenceRegistrationOptions
ReferenceRegistrationOptions ((DocumentSelector |? Null)
 -> Maybe Bool -> ReferenceRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser (Maybe Bool -> ReferenceRegistrationOptions)
forall (f :: * -> *) a b. Functor 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 Bool -> ReferenceRegistrationOptions)
-> Parser (Maybe Bool) -> Parser ReferenceRegistrationOptions
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 Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress"