{- 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
(Int -> ImplementationRegistrationOptions -> ShowS)
-> (ImplementationRegistrationOptions -> String)
-> ([ImplementationRegistrationOptions] -> ShowS)
-> Show ImplementationRegistrationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ImplementationRegistrationOptions -> ShowS
showsPrec :: Int -> ImplementationRegistrationOptions -> ShowS
$cshow :: ImplementationRegistrationOptions -> String
show :: ImplementationRegistrationOptions -> String
$cshowList :: [ImplementationRegistrationOptions] -> ShowS
showList :: [ImplementationRegistrationOptions] -> ShowS
Show, ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
(ImplementationRegistrationOptions
 -> ImplementationRegistrationOptions -> Bool)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions -> Bool)
-> Eq ImplementationRegistrationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
== :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
$c/= :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
/= :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
Eq, Eq ImplementationRegistrationOptions
Eq ImplementationRegistrationOptions =>
(ImplementationRegistrationOptions
 -> ImplementationRegistrationOptions -> Ordering)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions -> Bool)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions -> Bool)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions -> Bool)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions -> Bool)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions)
-> (ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions
    -> ImplementationRegistrationOptions)
-> Ord 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
$ccompare :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Ordering
compare :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Ordering
$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
>= :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions -> Bool
$cmax :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
max :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
$cmin :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
min :: ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
-> ImplementationRegistrationOptions
Ord, (forall x.
 ImplementationRegistrationOptions
 -> Rep ImplementationRegistrationOptions x)
-> (forall x.
    Rep ImplementationRegistrationOptions x
    -> ImplementationRegistrationOptions)
-> Generic ImplementationRegistrationOptions
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
$cfrom :: forall x.
ImplementationRegistrationOptions
-> Rep ImplementationRegistrationOptions x
from :: forall x.
ImplementationRegistrationOptions
-> Rep ImplementationRegistrationOptions x
$cto :: forall x.
Rep ImplementationRegistrationOptions x
-> ImplementationRegistrationOptions
to :: forall x.
Rep ImplementationRegistrationOptions x
-> ImplementationRegistrationOptions
Generic)
  deriving anyclass (ImplementationRegistrationOptions -> ()
(ImplementationRegistrationOptions -> ())
-> NFData ImplementationRegistrationOptions
forall a. (a -> ()) -> NFData a
$crnf :: ImplementationRegistrationOptions -> ()
rnf :: ImplementationRegistrationOptions -> ()
NFData, Eq ImplementationRegistrationOptions
Eq ImplementationRegistrationOptions =>
(Int -> ImplementationRegistrationOptions -> Int)
-> (ImplementationRegistrationOptions -> Int)
-> Hashable ImplementationRegistrationOptions
Int -> ImplementationRegistrationOptions -> Int
ImplementationRegistrationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> ImplementationRegistrationOptions -> Int
hashWithSalt :: Int -> ImplementationRegistrationOptions -> Int
$chash :: ImplementationRegistrationOptions -> Int
hash :: ImplementationRegistrationOptions -> Int
Hashable)
  deriving (forall ann. ImplementationRegistrationOptions -> Doc ann)
-> (forall ann. [ImplementationRegistrationOptions] -> Doc ann)
-> Pretty ImplementationRegistrationOptions
forall ann. [ImplementationRegistrationOptions] -> Doc ann
forall ann. ImplementationRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. ImplementationRegistrationOptions -> Doc ann
pretty :: forall ann. ImplementationRegistrationOptions -> Doc ann
$cprettyList :: forall ann. [ImplementationRegistrationOptions] -> Doc ann
prettyList :: 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 ([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
    ,String
"id" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e 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 = String
-> (Object -> Parser ImplementationRegistrationOptions)
-> Value
-> Parser ImplementationRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ImplementationRegistrationOptions" ((Object -> Parser ImplementationRegistrationOptions)
 -> Value -> Parser ImplementationRegistrationOptions)
-> (Object -> Parser ImplementationRegistrationOptions)
-> Value
-> Parser ImplementationRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> Maybe Text -> ImplementationRegistrationOptions
ImplementationRegistrationOptions ((DocumentSelector |? Null)
 -> Maybe Bool -> Maybe Text -> ImplementationRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser
     (Maybe Bool -> Maybe Text -> ImplementationRegistrationOptions)
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 -> Maybe Text -> ImplementationRegistrationOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> ImplementationRegistrationOptions)
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" Parser (Maybe Text -> ImplementationRegistrationOptions)
-> Parser (Maybe Text) -> Parser ImplementationRegistrationOptions
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 Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"id"