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

{-|
A diagnostic report with a full set of problems.

@since 3.17.0
-}
data FullDocumentDiagnosticReport = FullDocumentDiagnosticReport 
  { {-|
  A full document diagnostic report.
  -}
  FullDocumentDiagnosticReport -> 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.
  -}
  FullDocumentDiagnosticReport -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The actual items.
  -}
  FullDocumentDiagnosticReport -> [Diagnostic]
_items :: [Language.LSP.Protocol.Internal.Types.Diagnostic.Diagnostic]
  }
  deriving stock (Int -> FullDocumentDiagnosticReport -> ShowS
[FullDocumentDiagnosticReport] -> ShowS
FullDocumentDiagnosticReport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FullDocumentDiagnosticReport] -> ShowS
$cshowList :: [FullDocumentDiagnosticReport] -> ShowS
show :: FullDocumentDiagnosticReport -> String
$cshow :: FullDocumentDiagnosticReport -> String
showsPrec :: Int -> FullDocumentDiagnosticReport -> ShowS
$cshowsPrec :: Int -> FullDocumentDiagnosticReport -> ShowS
Show, FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c/= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
== :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c== :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
Eq, Eq FullDocumentDiagnosticReport
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
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 :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
$cmin :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
max :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
$cmax :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> FullDocumentDiagnosticReport
>= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c>= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
> :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c> :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
<= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c<= :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
< :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
$c< :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Bool
compare :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
$ccompare :: FullDocumentDiagnosticReport
-> FullDocumentDiagnosticReport -> Ordering
Ord, forall x.
Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport
forall x.
FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FullDocumentDiagnosticReport x -> FullDocumentDiagnosticReport
$cfrom :: forall x.
FullDocumentDiagnosticReport -> Rep FullDocumentDiagnosticReport x
Generic)
  deriving anyclass (FullDocumentDiagnosticReport -> ()
forall a. (a -> ()) -> NFData a
rnf :: FullDocumentDiagnosticReport -> ()
$crnf :: FullDocumentDiagnosticReport -> ()
NFData, Eq FullDocumentDiagnosticReport
Int -> FullDocumentDiagnosticReport -> Int
FullDocumentDiagnosticReport -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: FullDocumentDiagnosticReport -> Int
$chash :: FullDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> FullDocumentDiagnosticReport -> Int
$chashWithSalt :: Int -> FullDocumentDiagnosticReport -> Int
Hashable)
  deriving forall ann. [FullDocumentDiagnosticReport] -> Doc ann
forall ann. FullDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [FullDocumentDiagnosticReport] -> Doc ann
$cprettyList :: forall ann. [FullDocumentDiagnosticReport] -> Doc ann
pretty :: forall ann. FullDocumentDiagnosticReport -> Doc ann
$cpretty :: forall ann. FullDocumentDiagnosticReport -> Doc ann
Pretty via (ViaJSON FullDocumentDiagnosticReport)

instance Aeson.ToJSON FullDocumentDiagnosticReport where
  toJSON :: FullDocumentDiagnosticReport -> Value
toJSON (FullDocumentDiagnosticReport AString "full"
arg0 Maybe Text
arg1 [Diagnostic]
arg2) = [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]]

instance Aeson.FromJSON FullDocumentDiagnosticReport where
  parseJSON :: Value -> Parser FullDocumentDiagnosticReport
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"FullDocumentDiagnosticReport" forall a b. (a -> b) -> a -> b
$ \Object
arg -> AString "full"
-> Maybe Text -> [Diagnostic] -> FullDocumentDiagnosticReport
FullDocumentDiagnosticReport 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"