{- 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.DeclarationClientCapabilities 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 Language.LSP.Protocol.Types.Common

{-|
@since 3.14.0
-}
data DeclarationClientCapabilities = DeclarationClientCapabilities 
  { {-|
  Whether declaration supports dynamic registration. If this is set to `true`
  the client supports the new `DeclarationRegistrationOptions` return value
  for the corresponding server capability as well.
  -}
  DeclarationClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  The client supports additional metadata in the form of declaration links.
  -}
  DeclarationClientCapabilities -> Maybe Bool
_linkSupport :: (Maybe Bool)
  }
  deriving stock (Int -> DeclarationClientCapabilities -> ShowS
[DeclarationClientCapabilities] -> ShowS
DeclarationClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeclarationClientCapabilities] -> ShowS
$cshowList :: [DeclarationClientCapabilities] -> ShowS
show :: DeclarationClientCapabilities -> String
$cshow :: DeclarationClientCapabilities -> String
showsPrec :: Int -> DeclarationClientCapabilities -> ShowS
$cshowsPrec :: Int -> DeclarationClientCapabilities -> ShowS
Show, DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c/= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
== :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c== :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
Eq, Eq DeclarationClientCapabilities
DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Ordering
DeclarationClientCapabilities
-> DeclarationClientCapabilities -> DeclarationClientCapabilities
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 :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> DeclarationClientCapabilities
$cmin :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> DeclarationClientCapabilities
max :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> DeclarationClientCapabilities
$cmax :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> DeclarationClientCapabilities
>= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c>= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
> :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c> :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
<= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c<= :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
< :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
$c< :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Bool
compare :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Ordering
$ccompare :: DeclarationClientCapabilities
-> DeclarationClientCapabilities -> Ordering
Ord, forall x.
Rep DeclarationClientCapabilities x
-> DeclarationClientCapabilities
forall x.
DeclarationClientCapabilities
-> Rep DeclarationClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeclarationClientCapabilities x
-> DeclarationClientCapabilities
$cfrom :: forall x.
DeclarationClientCapabilities
-> Rep DeclarationClientCapabilities x
Generic)
  deriving anyclass (DeclarationClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: DeclarationClientCapabilities -> ()
$crnf :: DeclarationClientCapabilities -> ()
NFData, Eq DeclarationClientCapabilities
Int -> DeclarationClientCapabilities -> Int
DeclarationClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DeclarationClientCapabilities -> Int
$chash :: DeclarationClientCapabilities -> Int
hashWithSalt :: Int -> DeclarationClientCapabilities -> Int
$chashWithSalt :: Int -> DeclarationClientCapabilities -> Int
Hashable)
  deriving forall ann. [DeclarationClientCapabilities] -> Doc ann
forall ann. DeclarationClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DeclarationClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [DeclarationClientCapabilities] -> Doc ann
pretty :: forall ann. DeclarationClientCapabilities -> Doc ann
$cpretty :: forall ann. DeclarationClientCapabilities -> Doc ann
Pretty via (ViaJSON DeclarationClientCapabilities)

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

instance Aeson.FromJSON DeclarationClientCapabilities where
  parseJSON :: Value -> Parser DeclarationClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DeclarationClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> Maybe Bool -> DeclarationClientCapabilities
DeclarationClientCapabilities 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
"dynamicRegistration" 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
"linkSupport"