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

{-|
Diagnostic registration options.

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

  -}
  DiagnosticRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  An optional identifier under which the diagnostics are
  managed by the client.
  -}
  DiagnosticRegistrationOptions -> Maybe Text
_identifier :: (Maybe Data.Text.Text)
  , {-|
  Whether the language has inter file dependencies meaning that
  editing code in one file can result in a different diagnostic
  set in another file. Inter file dependencies are common for
  most programming languages and typically uncommon for linters.
  -}
  DiagnosticRegistrationOptions -> Bool
_interFileDependencies :: Bool
  , {-|
  The server provides support for workspace diagnostics as well.
  -}
  DiagnosticRegistrationOptions -> Bool
_workspaceDiagnostics :: Bool
  , {-|
  The id used to register the request. The id can be used to deregister
  the request again. See also Registration#id.
  -}
  DiagnosticRegistrationOptions -> Maybe Text
_id :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> DiagnosticRegistrationOptions -> ShowS
[DiagnosticRegistrationOptions] -> ShowS
DiagnosticRegistrationOptions -> String
(Int -> DiagnosticRegistrationOptions -> ShowS)
-> (DiagnosticRegistrationOptions -> String)
-> ([DiagnosticRegistrationOptions] -> ShowS)
-> Show DiagnosticRegistrationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiagnosticRegistrationOptions -> ShowS
showsPrec :: Int -> DiagnosticRegistrationOptions -> ShowS
$cshow :: DiagnosticRegistrationOptions -> String
show :: DiagnosticRegistrationOptions -> String
$cshowList :: [DiagnosticRegistrationOptions] -> ShowS
showList :: [DiagnosticRegistrationOptions] -> ShowS
Show, DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
(DiagnosticRegistrationOptions
 -> DiagnosticRegistrationOptions -> Bool)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> Bool)
-> Eq DiagnosticRegistrationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
== :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
$c/= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
/= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
Eq, Eq DiagnosticRegistrationOptions
Eq DiagnosticRegistrationOptions =>
(DiagnosticRegistrationOptions
 -> DiagnosticRegistrationOptions -> Ordering)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> Bool)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> Bool)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> Bool)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> Bool)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions)
-> (DiagnosticRegistrationOptions
    -> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions)
-> Ord DiagnosticRegistrationOptions
DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Ordering
DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions
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
$ccompare :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Ordering
compare :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Ordering
$c< :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
< :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
$c<= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
<= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
$c> :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
> :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
$c>= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
>= :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> Bool
$cmax :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions
max :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions
$cmin :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions
min :: DiagnosticRegistrationOptions
-> DiagnosticRegistrationOptions -> DiagnosticRegistrationOptions
Ord, (forall x.
 DiagnosticRegistrationOptions
 -> Rep DiagnosticRegistrationOptions x)
-> (forall x.
    Rep DiagnosticRegistrationOptions x
    -> DiagnosticRegistrationOptions)
-> Generic DiagnosticRegistrationOptions
forall x.
Rep DiagnosticRegistrationOptions x
-> DiagnosticRegistrationOptions
forall x.
DiagnosticRegistrationOptions
-> Rep DiagnosticRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DiagnosticRegistrationOptions
-> Rep DiagnosticRegistrationOptions x
from :: forall x.
DiagnosticRegistrationOptions
-> Rep DiagnosticRegistrationOptions x
$cto :: forall x.
Rep DiagnosticRegistrationOptions x
-> DiagnosticRegistrationOptions
to :: forall x.
Rep DiagnosticRegistrationOptions x
-> DiagnosticRegistrationOptions
Generic)
  deriving anyclass (DiagnosticRegistrationOptions -> ()
(DiagnosticRegistrationOptions -> ())
-> NFData DiagnosticRegistrationOptions
forall a. (a -> ()) -> NFData a
$crnf :: DiagnosticRegistrationOptions -> ()
rnf :: DiagnosticRegistrationOptions -> ()
NFData, Eq DiagnosticRegistrationOptions
Eq DiagnosticRegistrationOptions =>
(Int -> DiagnosticRegistrationOptions -> Int)
-> (DiagnosticRegistrationOptions -> Int)
-> Hashable DiagnosticRegistrationOptions
Int -> DiagnosticRegistrationOptions -> Int
DiagnosticRegistrationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DiagnosticRegistrationOptions -> Int
hashWithSalt :: Int -> DiagnosticRegistrationOptions -> Int
$chash :: DiagnosticRegistrationOptions -> Int
hash :: DiagnosticRegistrationOptions -> Int
Hashable)
  deriving (forall ann. DiagnosticRegistrationOptions -> Doc ann)
-> (forall ann. [DiagnosticRegistrationOptions] -> Doc ann)
-> Pretty DiagnosticRegistrationOptions
forall ann. [DiagnosticRegistrationOptions] -> Doc ann
forall ann. DiagnosticRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DiagnosticRegistrationOptions -> Doc ann
pretty :: forall ann. DiagnosticRegistrationOptions -> Doc ann
$cprettyList :: forall ann. [DiagnosticRegistrationOptions] -> Doc ann
prettyList :: forall ann. [DiagnosticRegistrationOptions] -> Doc ann
Pretty via (ViaJSON DiagnosticRegistrationOptions)

instance Aeson.ToJSON DiagnosticRegistrationOptions where
  toJSON :: DiagnosticRegistrationOptions -> Value
toJSON (DiagnosticRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1 Maybe Text
arg2 Bool
arg3 Bool
arg4 Maybe Text
arg5) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"documentSelector" Key -> (DocumentSelector |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"identifier" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg2
    ,[Key
"interFileDependencies" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg3]
    ,[Key
"workspaceDiagnostics" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg4]
    ,String
"id" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg5]

instance Aeson.FromJSON DiagnosticRegistrationOptions where
  parseJSON :: Value -> Parser DiagnosticRegistrationOptions
parseJSON = String
-> (Object -> Parser DiagnosticRegistrationOptions)
-> Value
-> Parser DiagnosticRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DiagnosticRegistrationOptions" ((Object -> Parser DiagnosticRegistrationOptions)
 -> Value -> Parser DiagnosticRegistrationOptions)
-> (Object -> Parser DiagnosticRegistrationOptions)
-> Value
-> Parser DiagnosticRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool
-> Maybe Text
-> Bool
-> Bool
-> Maybe Text
-> DiagnosticRegistrationOptions
DiagnosticRegistrationOptions ((DocumentSelector |? Null)
 -> Maybe Bool
 -> Maybe Text
 -> Bool
 -> Bool
 -> Maybe Text
 -> DiagnosticRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Bool
      -> Bool
      -> Maybe Text
      -> DiagnosticRegistrationOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (DocumentSelector |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" Parser
  (Maybe Bool
   -> Maybe Text
   -> Bool
   -> Bool
   -> Maybe Text
   -> DiagnosticRegistrationOptions)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Bool -> Bool -> Maybe Text -> DiagnosticRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser
  (Maybe Text
   -> Bool -> Bool -> Maybe Text -> DiagnosticRegistrationOptions)
-> Parser (Maybe Text)
-> Parser
     (Bool -> Bool -> Maybe Text -> DiagnosticRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"identifier" Parser
  (Bool -> Bool -> Maybe Text -> DiagnosticRegistrationOptions)
-> Parser Bool
-> Parser (Bool -> Maybe Text -> DiagnosticRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser Bool
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"interFileDependencies" Parser (Bool -> Maybe Text -> DiagnosticRegistrationOptions)
-> Parser Bool
-> Parser (Maybe Text -> DiagnosticRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser Bool
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"workspaceDiagnostics" Parser (Maybe Text -> DiagnosticRegistrationOptions)
-> Parser (Maybe Text) -> Parser DiagnosticRegistrationOptions
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"id"