{- 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.DefinitionClientCapabilities 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

{-|
Client Capabilities for a `DefinitionRequest`.
-}
data DefinitionClientCapabilities = DefinitionClientCapabilities 
  { {-|
  Whether definition supports dynamic registration.
  -}
  DefinitionClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  The client supports additional metadata in the form of definition links.

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

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