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

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

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