{- 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.WorkspaceDiagnosticReport 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 Language.LSP.Protocol.Internal.Types.WorkspaceDocumentDiagnosticReport
import qualified Language.LSP.Protocol.Types.Common

{-|
A workspace diagnostic report.

@since 3.17.0
-}
data WorkspaceDiagnosticReport = WorkspaceDiagnosticReport 
  { {-|

  -}
  WorkspaceDiagnosticReport -> [WorkspaceDocumentDiagnosticReport]
_items :: [Language.LSP.Protocol.Internal.Types.WorkspaceDocumentDiagnosticReport.WorkspaceDocumentDiagnosticReport]
  }
  deriving stock (Int -> WorkspaceDiagnosticReport -> ShowS
[WorkspaceDiagnosticReport] -> ShowS
WorkspaceDiagnosticReport -> String
(Int -> WorkspaceDiagnosticReport -> ShowS)
-> (WorkspaceDiagnosticReport -> String)
-> ([WorkspaceDiagnosticReport] -> ShowS)
-> Show WorkspaceDiagnosticReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkspaceDiagnosticReport -> ShowS
showsPrec :: Int -> WorkspaceDiagnosticReport -> ShowS
$cshow :: WorkspaceDiagnosticReport -> String
show :: WorkspaceDiagnosticReport -> String
$cshowList :: [WorkspaceDiagnosticReport] -> ShowS
showList :: [WorkspaceDiagnosticReport] -> ShowS
Show, WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
(WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> (WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> Eq WorkspaceDiagnosticReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
== :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
$c/= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
/= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
Eq, Eq WorkspaceDiagnosticReport
Eq WorkspaceDiagnosticReport =>
(WorkspaceDiagnosticReport
 -> WorkspaceDiagnosticReport -> Ordering)
-> (WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> (WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> (WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> (WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool)
-> (WorkspaceDiagnosticReport
    -> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport)
-> (WorkspaceDiagnosticReport
    -> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport)
-> Ord WorkspaceDiagnosticReport
WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Ordering
WorkspaceDiagnosticReport
-> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport
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 :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Ordering
compare :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Ordering
$c< :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
< :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
$c<= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
<= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
$c> :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
> :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
$c>= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
>= :: WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport -> Bool
$cmax :: WorkspaceDiagnosticReport
-> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport
max :: WorkspaceDiagnosticReport
-> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport
$cmin :: WorkspaceDiagnosticReport
-> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport
min :: WorkspaceDiagnosticReport
-> WorkspaceDiagnosticReport -> WorkspaceDiagnosticReport
Ord, (forall x.
 WorkspaceDiagnosticReport -> Rep WorkspaceDiagnosticReport x)
-> (forall x.
    Rep WorkspaceDiagnosticReport x -> WorkspaceDiagnosticReport)
-> Generic WorkspaceDiagnosticReport
forall x.
Rep WorkspaceDiagnosticReport x -> WorkspaceDiagnosticReport
forall x.
WorkspaceDiagnosticReport -> Rep WorkspaceDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
WorkspaceDiagnosticReport -> Rep WorkspaceDiagnosticReport x
from :: forall x.
WorkspaceDiagnosticReport -> Rep WorkspaceDiagnosticReport x
$cto :: forall x.
Rep WorkspaceDiagnosticReport x -> WorkspaceDiagnosticReport
to :: forall x.
Rep WorkspaceDiagnosticReport x -> WorkspaceDiagnosticReport
Generic)
  deriving anyclass (WorkspaceDiagnosticReport -> ()
(WorkspaceDiagnosticReport -> ())
-> NFData WorkspaceDiagnosticReport
forall a. (a -> ()) -> NFData a
$crnf :: WorkspaceDiagnosticReport -> ()
rnf :: WorkspaceDiagnosticReport -> ()
NFData, Eq WorkspaceDiagnosticReport
Eq WorkspaceDiagnosticReport =>
(Int -> WorkspaceDiagnosticReport -> Int)
-> (WorkspaceDiagnosticReport -> Int)
-> Hashable WorkspaceDiagnosticReport
Int -> WorkspaceDiagnosticReport -> Int
WorkspaceDiagnosticReport -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> WorkspaceDiagnosticReport -> Int
hashWithSalt :: Int -> WorkspaceDiagnosticReport -> Int
$chash :: WorkspaceDiagnosticReport -> Int
hash :: WorkspaceDiagnosticReport -> Int
Hashable)
  deriving (forall ann. WorkspaceDiagnosticReport -> Doc ann)
-> (forall ann. [WorkspaceDiagnosticReport] -> Doc ann)
-> Pretty WorkspaceDiagnosticReport
forall ann. [WorkspaceDiagnosticReport] -> Doc ann
forall ann. WorkspaceDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. WorkspaceDiagnosticReport -> Doc ann
pretty :: forall ann. WorkspaceDiagnosticReport -> Doc ann
$cprettyList :: forall ann. [WorkspaceDiagnosticReport] -> Doc ann
prettyList :: forall ann. [WorkspaceDiagnosticReport] -> Doc ann
Pretty via (ViaJSON WorkspaceDiagnosticReport)

instance Aeson.ToJSON WorkspaceDiagnosticReport where
  toJSON :: WorkspaceDiagnosticReport -> Value
toJSON (WorkspaceDiagnosticReport [WorkspaceDocumentDiagnosticReport]
arg0) = [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
"items" Key -> [WorkspaceDocumentDiagnosticReport] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [WorkspaceDocumentDiagnosticReport]
arg0]]

instance Aeson.FromJSON WorkspaceDiagnosticReport where
  parseJSON :: Value -> Parser WorkspaceDiagnosticReport
parseJSON = String
-> (Object -> Parser WorkspaceDiagnosticReport)
-> Value
-> Parser WorkspaceDiagnosticReport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceDiagnosticReport" ((Object -> Parser WorkspaceDiagnosticReport)
 -> Value -> Parser WorkspaceDiagnosticReport)
-> (Object -> Parser WorkspaceDiagnosticReport)
-> Value
-> Parser WorkspaceDiagnosticReport
forall a b. (a -> b) -> a -> b
$ \Object
arg -> [WorkspaceDocumentDiagnosticReport] -> WorkspaceDiagnosticReport
WorkspaceDiagnosticReport ([WorkspaceDocumentDiagnosticReport] -> WorkspaceDiagnosticReport)
-> Parser [WorkspaceDocumentDiagnosticReport]
-> Parser WorkspaceDiagnosticReport
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser [WorkspaceDocumentDiagnosticReport]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"items"