{- 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.DocumentDiagnosticReportPartialResult 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.Map
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.FullDocumentDiagnosticReport
import qualified Language.LSP.Protocol.Internal.Types.UnchangedDocumentDiagnosticReport
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Uri

{-|
A partial result for a document diagnostic report.

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

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

instance Aeson.ToJSON DocumentDiagnosticReportPartialResult where
  toJSON :: DocumentDiagnosticReportPartialResult -> Value
toJSON (DocumentDiagnosticReportPartialResult Map
  Uri
  (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)
arg0) = [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
"relatedDocuments" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Map
  Uri
  (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)
arg0]]

instance Aeson.FromJSON DocumentDiagnosticReportPartialResult where
  parseJSON :: Value -> Parser DocumentDiagnosticReportPartialResult
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentDiagnosticReportPartialResult" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Map
  Uri
  (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)
-> DocumentDiagnosticReportPartialResult
DocumentDiagnosticReportPartialResult forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"relatedDocuments"