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

{-|
Parameters of the workspace diagnostic request.

@since 3.17.0
-}
data WorkspaceDiagnosticParams = WorkspaceDiagnosticParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  WorkspaceDiagnosticParams -> 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.
  -}
  WorkspaceDiagnosticParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The additional identifier provided during registration.
  -}
  WorkspaceDiagnosticParams -> Maybe Text
_identifier :: (Maybe Data.Text.Text)
  , {-|
  The currently known diagnostic reports with their
  previous result ids.
  -}
  WorkspaceDiagnosticParams -> [PreviousResultId]
_previousResultIds :: [Language.LSP.Protocol.Internal.Types.PreviousResultId.PreviousResultId]
  }
  deriving stock (Int -> WorkspaceDiagnosticParams -> ShowS
[WorkspaceDiagnosticParams] -> ShowS
WorkspaceDiagnosticParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceDiagnosticParams] -> ShowS
$cshowList :: [WorkspaceDiagnosticParams] -> ShowS
show :: WorkspaceDiagnosticParams -> String
$cshow :: WorkspaceDiagnosticParams -> String
showsPrec :: Int -> WorkspaceDiagnosticParams -> ShowS
$cshowsPrec :: Int -> WorkspaceDiagnosticParams -> ShowS
Show, WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c/= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
== :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c== :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
Eq, Eq WorkspaceDiagnosticParams
WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Ordering
WorkspaceDiagnosticParams
-> WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams
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 :: WorkspaceDiagnosticParams
-> WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams
$cmin :: WorkspaceDiagnosticParams
-> WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams
max :: WorkspaceDiagnosticParams
-> WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams
$cmax :: WorkspaceDiagnosticParams
-> WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams
>= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c>= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
> :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c> :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
<= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c<= :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
< :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
$c< :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Bool
compare :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Ordering
$ccompare :: WorkspaceDiagnosticParams -> WorkspaceDiagnosticParams -> Ordering
Ord, forall x.
Rep WorkspaceDiagnosticParams x -> WorkspaceDiagnosticParams
forall x.
WorkspaceDiagnosticParams -> Rep WorkspaceDiagnosticParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceDiagnosticParams x -> WorkspaceDiagnosticParams
$cfrom :: forall x.
WorkspaceDiagnosticParams -> Rep WorkspaceDiagnosticParams x
Generic)
  deriving anyclass (WorkspaceDiagnosticParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceDiagnosticParams -> ()
$crnf :: WorkspaceDiagnosticParams -> ()
NFData, Eq WorkspaceDiagnosticParams
Int -> WorkspaceDiagnosticParams -> Int
WorkspaceDiagnosticParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceDiagnosticParams -> Int
$chash :: WorkspaceDiagnosticParams -> Int
hashWithSalt :: Int -> WorkspaceDiagnosticParams -> Int
$chashWithSalt :: Int -> WorkspaceDiagnosticParams -> Int
Hashable)
  deriving forall ann. [WorkspaceDiagnosticParams] -> Doc ann
forall ann. WorkspaceDiagnosticParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceDiagnosticParams] -> Doc ann
$cprettyList :: forall ann. [WorkspaceDiagnosticParams] -> Doc ann
pretty :: forall ann. WorkspaceDiagnosticParams -> Doc ann
$cpretty :: forall ann. WorkspaceDiagnosticParams -> Doc ann
Pretty via (ViaJSON WorkspaceDiagnosticParams)

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

instance Aeson.FromJSON WorkspaceDiagnosticParams where
  parseJSON :: Value -> Parser WorkspaceDiagnosticParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceDiagnosticParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken
-> Maybe Text
-> [PreviousResultId]
-> WorkspaceDiagnosticParams
WorkspaceDiagnosticParams 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 (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 a
Aeson..: Key
"previousResultIds"