{- 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.DiagnosticClientCapabilities 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 specific to diagnostic pull requests.

@since 3.17.0
-}
data DiagnosticClientCapabilities = DiagnosticClientCapabilities 
  { {-|
  Whether implementation supports dynamic registration. If this is set to `true`
  the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  return value for the corresponding server capability as well.
  -}
  DiagnosticClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  Whether the clients supports related documents for document diagnostic pulls.
  -}
  DiagnosticClientCapabilities -> Maybe Bool
_relatedDocumentSupport :: (Maybe Bool)
  }
  deriving stock (Int -> DiagnosticClientCapabilities -> ShowS
[DiagnosticClientCapabilities] -> ShowS
DiagnosticClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiagnosticClientCapabilities] -> ShowS
$cshowList :: [DiagnosticClientCapabilities] -> ShowS
show :: DiagnosticClientCapabilities -> String
$cshow :: DiagnosticClientCapabilities -> String
showsPrec :: Int -> DiagnosticClientCapabilities -> ShowS
$cshowsPrec :: Int -> DiagnosticClientCapabilities -> ShowS
Show, DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c/= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
== :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c== :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
Eq, Eq DiagnosticClientCapabilities
DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Ordering
DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> DiagnosticClientCapabilities
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 :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> DiagnosticClientCapabilities
$cmin :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> DiagnosticClientCapabilities
max :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> DiagnosticClientCapabilities
$cmax :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> DiagnosticClientCapabilities
>= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c>= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
> :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c> :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
<= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c<= :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
< :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
$c< :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Bool
compare :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Ordering
$ccompare :: DiagnosticClientCapabilities
-> DiagnosticClientCapabilities -> Ordering
Ord, forall x.
Rep DiagnosticClientCapabilities x -> DiagnosticClientCapabilities
forall x.
DiagnosticClientCapabilities -> Rep DiagnosticClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DiagnosticClientCapabilities x -> DiagnosticClientCapabilities
$cfrom :: forall x.
DiagnosticClientCapabilities -> Rep DiagnosticClientCapabilities x
Generic)
  deriving anyclass (DiagnosticClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: DiagnosticClientCapabilities -> ()
$crnf :: DiagnosticClientCapabilities -> ()
NFData, Eq DiagnosticClientCapabilities
Int -> DiagnosticClientCapabilities -> Int
DiagnosticClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DiagnosticClientCapabilities -> Int
$chash :: DiagnosticClientCapabilities -> Int
hashWithSalt :: Int -> DiagnosticClientCapabilities -> Int
$chashWithSalt :: Int -> DiagnosticClientCapabilities -> Int
Hashable)
  deriving forall ann. [DiagnosticClientCapabilities] -> Doc ann
forall ann. DiagnosticClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DiagnosticClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [DiagnosticClientCapabilities] -> Doc ann
pretty :: forall ann. DiagnosticClientCapabilities -> Doc ann
$cpretty :: forall ann. DiagnosticClientCapabilities -> Doc ann
Pretty via (ViaJSON DiagnosticClientCapabilities)

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

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