{- 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.DocumentDiagnosticParams 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.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
Parameters of the document diagnostic request.

@since 3.17.0
-}
data DocumentDiagnosticParams = DocumentDiagnosticParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  DocumentDiagnosticParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  An optional token that a server can use to report partial results (e.g. streaming) to
  the client.
  -}
  DocumentDiagnosticParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The text document.
  -}
  DocumentDiagnosticParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The additional identifier  provided during registration.
  -}
  DocumentDiagnosticParams -> Maybe Text
_identifier :: (Maybe Data.Text.Text)
  , {-|
  The result id of a previous response if provided.
  -}
  DocumentDiagnosticParams -> Maybe Text
_previousResultId :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> DocumentDiagnosticParams -> ShowS
[DocumentDiagnosticParams] -> ShowS
DocumentDiagnosticParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentDiagnosticParams] -> ShowS
$cshowList :: [DocumentDiagnosticParams] -> ShowS
show :: DocumentDiagnosticParams -> String
$cshow :: DocumentDiagnosticParams -> String
showsPrec :: Int -> DocumentDiagnosticParams -> ShowS
$cshowsPrec :: Int -> DocumentDiagnosticParams -> ShowS
Show, DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c/= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
== :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c== :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
Eq, Eq DocumentDiagnosticParams
DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
DocumentDiagnosticParams -> DocumentDiagnosticParams -> Ordering
DocumentDiagnosticParams
-> DocumentDiagnosticParams -> DocumentDiagnosticParams
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 :: DocumentDiagnosticParams
-> DocumentDiagnosticParams -> DocumentDiagnosticParams
$cmin :: DocumentDiagnosticParams
-> DocumentDiagnosticParams -> DocumentDiagnosticParams
max :: DocumentDiagnosticParams
-> DocumentDiagnosticParams -> DocumentDiagnosticParams
$cmax :: DocumentDiagnosticParams
-> DocumentDiagnosticParams -> DocumentDiagnosticParams
>= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c>= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
> :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c> :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
<= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c<= :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
< :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
$c< :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Bool
compare :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Ordering
$ccompare :: DocumentDiagnosticParams -> DocumentDiagnosticParams -> Ordering
Ord, forall x.
Rep DocumentDiagnosticParams x -> DocumentDiagnosticParams
forall x.
DocumentDiagnosticParams -> Rep DocumentDiagnosticParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentDiagnosticParams x -> DocumentDiagnosticParams
$cfrom :: forall x.
DocumentDiagnosticParams -> Rep DocumentDiagnosticParams x
Generic)
  deriving anyclass (DocumentDiagnosticParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentDiagnosticParams -> ()
$crnf :: DocumentDiagnosticParams -> ()
NFData, Eq DocumentDiagnosticParams
Int -> DocumentDiagnosticParams -> Int
DocumentDiagnosticParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentDiagnosticParams -> Int
$chash :: DocumentDiagnosticParams -> Int
hashWithSalt :: Int -> DocumentDiagnosticParams -> Int
$chashWithSalt :: Int -> DocumentDiagnosticParams -> Int
Hashable)
  deriving forall ann. [DocumentDiagnosticParams] -> Doc ann
forall ann. DocumentDiagnosticParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentDiagnosticParams] -> Doc ann
$cprettyList :: forall ann. [DocumentDiagnosticParams] -> Doc ann
pretty :: forall ann. DocumentDiagnosticParams -> Doc ann
$cpretty :: forall ann. DocumentDiagnosticParams -> Doc ann
Pretty via (ViaJSON DocumentDiagnosticParams)

instance Aeson.ToJSON DocumentDiagnosticParams where
  toJSON :: DocumentDiagnosticParams -> Value
toJSON (DocumentDiagnosticParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TextDocumentIdentifier
arg2 Maybe Text
arg3 Maybe Text
arg4) = [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
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,String
"partialResultToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg1
    ,[Key
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg2]
    ,String
"identifier" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg3
    ,String
"previousResultId" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg4]

instance Aeson.FromJSON DocumentDiagnosticParams where
  parseJSON :: Value -> Parser DocumentDiagnosticParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentDiagnosticParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken
-> TextDocumentIdentifier
-> Maybe Text
-> Maybe Text
-> DocumentDiagnosticParams
DocumentDiagnosticParams 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
"workDoneToken" 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
"partialResultToken" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" 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
"identifier" 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
"previousResultId"