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

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

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