{- 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.StaticRegistrationOptions 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.Types.Common

{-|
Static registration options to be returned in the initialize
request.
-}
data StaticRegistrationOptions = StaticRegistrationOptions 
  { {-|
  The id used to register the request. The id can be used to deregister
  the request again. See also Registration#id.
  -}
  StaticRegistrationOptions -> Maybe Text
_id :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> StaticRegistrationOptions -> ShowS
[StaticRegistrationOptions] -> ShowS
StaticRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StaticRegistrationOptions] -> ShowS
$cshowList :: [StaticRegistrationOptions] -> ShowS
show :: StaticRegistrationOptions -> String
$cshow :: StaticRegistrationOptions -> String
showsPrec :: Int -> StaticRegistrationOptions -> ShowS
$cshowsPrec :: Int -> StaticRegistrationOptions -> ShowS
Show, StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c/= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
== :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c== :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
Eq, Eq StaticRegistrationOptions
StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
StaticRegistrationOptions -> StaticRegistrationOptions -> Ordering
StaticRegistrationOptions
-> StaticRegistrationOptions -> StaticRegistrationOptions
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 :: StaticRegistrationOptions
-> StaticRegistrationOptions -> StaticRegistrationOptions
$cmin :: StaticRegistrationOptions
-> StaticRegistrationOptions -> StaticRegistrationOptions
max :: StaticRegistrationOptions
-> StaticRegistrationOptions -> StaticRegistrationOptions
$cmax :: StaticRegistrationOptions
-> StaticRegistrationOptions -> StaticRegistrationOptions
>= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c>= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
> :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c> :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
<= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c<= :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
< :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
$c< :: StaticRegistrationOptions -> StaticRegistrationOptions -> Bool
compare :: StaticRegistrationOptions -> StaticRegistrationOptions -> Ordering
$ccompare :: StaticRegistrationOptions -> StaticRegistrationOptions -> Ordering
Ord, forall x.
Rep StaticRegistrationOptions x -> StaticRegistrationOptions
forall x.
StaticRegistrationOptions -> Rep StaticRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StaticRegistrationOptions x -> StaticRegistrationOptions
$cfrom :: forall x.
StaticRegistrationOptions -> Rep StaticRegistrationOptions x
Generic)
  deriving anyclass (StaticRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: StaticRegistrationOptions -> ()
$crnf :: StaticRegistrationOptions -> ()
NFData, Eq StaticRegistrationOptions
Int -> StaticRegistrationOptions -> Int
StaticRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: StaticRegistrationOptions -> Int
$chash :: StaticRegistrationOptions -> Int
hashWithSalt :: Int -> StaticRegistrationOptions -> Int
$chashWithSalt :: Int -> StaticRegistrationOptions -> Int
Hashable)
  deriving forall ann. [StaticRegistrationOptions] -> Doc ann
forall ann. StaticRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [StaticRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [StaticRegistrationOptions] -> Doc ann
pretty :: forall ann. StaticRegistrationOptions -> Doc ann
$cpretty :: forall ann. StaticRegistrationOptions -> Doc ann
Pretty via (ViaJSON StaticRegistrationOptions)

instance Aeson.ToJSON StaticRegistrationOptions where
  toJSON :: StaticRegistrationOptions -> Value
toJSON (StaticRegistrationOptions Maybe Text
arg0) = [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
$  [String
"id" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg0]

instance Aeson.FromJSON StaticRegistrationOptions where
  parseJSON :: Value -> Parser StaticRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"StaticRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> StaticRegistrationOptions
StaticRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"id"