{- 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.WorkspaceFullDocumentDiagnosticReport 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.Diagnostic
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Singletons
import qualified Language.LSP.Protocol.Types.Uri

{-|
A full document diagnostic report for a workspace diagnostic result.

@since 3.17.0
-}
data WorkspaceFullDocumentDiagnosticReport = WorkspaceFullDocumentDiagnosticReport 
  { {-|
  A full document diagnostic report.
  -}
  WorkspaceFullDocumentDiagnosticReport -> AString "full"
_kind :: (Language.LSP.Protocol.Types.Singletons.AString "full")
  , {-|
  An optional result id. If provided it will
  be sent on the next diagnostic request for the
  same document.
  -}
  WorkspaceFullDocumentDiagnosticReport -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The actual items.
  -}
  WorkspaceFullDocumentDiagnosticReport -> [Diagnostic]
_items :: [Language.LSP.Protocol.Internal.Types.Diagnostic.Diagnostic]
  , {-|
  The URI for which diagnostic information is reported.
  -}
  WorkspaceFullDocumentDiagnosticReport -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The version number for which the diagnostics are reported.
  If the document is not marked as open `null` can be provided.
  -}
  WorkspaceFullDocumentDiagnosticReport -> Int32 |? Null
_version :: (Language.LSP.Protocol.Types.Common.Int32 Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  }
  deriving stock (Int -> WorkspaceFullDocumentDiagnosticReport -> ShowS
[WorkspaceFullDocumentDiagnosticReport] -> ShowS
WorkspaceFullDocumentDiagnosticReport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceFullDocumentDiagnosticReport] -> ShowS
$cshowList :: [WorkspaceFullDocumentDiagnosticReport] -> ShowS
show :: WorkspaceFullDocumentDiagnosticReport -> String
$cshow :: WorkspaceFullDocumentDiagnosticReport -> String
showsPrec :: Int -> WorkspaceFullDocumentDiagnosticReport -> ShowS
$cshowsPrec :: Int -> WorkspaceFullDocumentDiagnosticReport -> ShowS
Show, WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c/= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
== :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c== :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
Eq, Eq WorkspaceFullDocumentDiagnosticReport
WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Ordering
WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
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 :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
$cmin :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
max :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
$cmax :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport
>= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c>= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
> :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c> :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
<= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c<= :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
< :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
$c< :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Bool
compare :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Ordering
$ccompare :: WorkspaceFullDocumentDiagnosticReport
-> WorkspaceFullDocumentDiagnosticReport -> Ordering
Ord, forall x.
Rep WorkspaceFullDocumentDiagnosticReport x
-> WorkspaceFullDocumentDiagnosticReport
forall x.
WorkspaceFullDocumentDiagnosticReport
-> Rep WorkspaceFullDocumentDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceFullDocumentDiagnosticReport x
-> WorkspaceFullDocumentDiagnosticReport
$cfrom :: forall x.
WorkspaceFullDocumentDiagnosticReport
-> Rep WorkspaceFullDocumentDiagnosticReport x
Generic)
  deriving anyclass (WorkspaceFullDocumentDiagnosticReport -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceFullDocumentDiagnosticReport -> ()
$crnf :: WorkspaceFullDocumentDiagnosticReport -> ()
NFData, Eq WorkspaceFullDocumentDiagnosticReport
Int -> WorkspaceFullDocumentDiagnosticReport -> Int
WorkspaceFullDocumentDiagnosticReport -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceFullDocumentDiagnosticReport -> Int
$chash :: WorkspaceFullDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> WorkspaceFullDocumentDiagnosticReport -> Int
$chashWithSalt :: Int -> WorkspaceFullDocumentDiagnosticReport -> Int
Hashable)
  deriving forall ann. [WorkspaceFullDocumentDiagnosticReport] -> Doc ann
forall ann. WorkspaceFullDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceFullDocumentDiagnosticReport] -> Doc ann
$cprettyList :: forall ann. [WorkspaceFullDocumentDiagnosticReport] -> Doc ann
pretty :: forall ann. WorkspaceFullDocumentDiagnosticReport -> Doc ann
$cpretty :: forall ann. WorkspaceFullDocumentDiagnosticReport -> Doc ann
Pretty via (ViaJSON WorkspaceFullDocumentDiagnosticReport)

instance Aeson.ToJSON WorkspaceFullDocumentDiagnosticReport where
  toJSON :: WorkspaceFullDocumentDiagnosticReport -> Value
toJSON (WorkspaceFullDocumentDiagnosticReport AString "full"
arg0 Maybe Text
arg1 [Diagnostic]
arg2 Uri
arg3 Int32 |? Null
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
$  [[Key
"kind" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= AString "full"
arg0]
    ,String
"resultId" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,[Key
"items" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [Diagnostic]
arg2]
    ,[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg3]
    ,[Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Int32 |? Null
arg4]]

instance Aeson.FromJSON WorkspaceFullDocumentDiagnosticReport where
  parseJSON :: Value -> Parser WorkspaceFullDocumentDiagnosticReport
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceFullDocumentDiagnosticReport" forall a b. (a -> b) -> a -> b
$ \Object
arg -> AString "full"
-> Maybe Text
-> [Diagnostic]
-> Uri
-> (Int32 |? Null)
-> WorkspaceFullDocumentDiagnosticReport
WorkspaceFullDocumentDiagnosticReport forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" 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
"resultId" 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
"items" 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
"uri" 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
"version"