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

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

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