{- 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.CallHierarchyRegistrationOptions 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

{-|
Call hierarchy options used during static or dynamic registration.

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

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

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