{- 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
(Int -> DocumentDiagnosticReportPartialResult -> ShowS)
-> (DocumentDiagnosticReportPartialResult -> String)
-> ([DocumentDiagnosticReportPartialResult] -> ShowS)
-> Show DocumentDiagnosticReportPartialResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DocumentDiagnosticReportPartialResult -> ShowS
showsPrec :: Int -> DocumentDiagnosticReportPartialResult -> ShowS
$cshow :: DocumentDiagnosticReportPartialResult -> String
show :: DocumentDiagnosticReportPartialResult -> String
$cshowList :: [DocumentDiagnosticReportPartialResult] -> ShowS
showList :: [DocumentDiagnosticReportPartialResult] -> ShowS
Show, DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
(DocumentDiagnosticReportPartialResult
 -> DocumentDiagnosticReportPartialResult -> Bool)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult -> Bool)
-> Eq DocumentDiagnosticReportPartialResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
== :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
$c/= :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
/= :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
Eq, Eq DocumentDiagnosticReportPartialResult
Eq DocumentDiagnosticReportPartialResult =>
(DocumentDiagnosticReportPartialResult
 -> DocumentDiagnosticReportPartialResult -> Ordering)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult -> Bool)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult -> Bool)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult -> Bool)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult -> Bool)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult)
-> (DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult
    -> DocumentDiagnosticReportPartialResult)
-> Ord 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
$ccompare :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Ordering
compare :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Ordering
$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
>= :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult -> Bool
$cmax :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
max :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
$cmin :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
min :: DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
-> DocumentDiagnosticReportPartialResult
Ord, (forall x.
 DocumentDiagnosticReportPartialResult
 -> Rep DocumentDiagnosticReportPartialResult x)
-> (forall x.
    Rep DocumentDiagnosticReportPartialResult x
    -> DocumentDiagnosticReportPartialResult)
-> Generic DocumentDiagnosticReportPartialResult
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
$cfrom :: forall x.
DocumentDiagnosticReportPartialResult
-> Rep DocumentDiagnosticReportPartialResult x
from :: forall x.
DocumentDiagnosticReportPartialResult
-> Rep DocumentDiagnosticReportPartialResult x
$cto :: forall x.
Rep DocumentDiagnosticReportPartialResult x
-> DocumentDiagnosticReportPartialResult
to :: forall x.
Rep DocumentDiagnosticReportPartialResult x
-> DocumentDiagnosticReportPartialResult
Generic)
  deriving anyclass (DocumentDiagnosticReportPartialResult -> ()
(DocumentDiagnosticReportPartialResult -> ())
-> NFData DocumentDiagnosticReportPartialResult
forall a. (a -> ()) -> NFData a
$crnf :: DocumentDiagnosticReportPartialResult -> ()
rnf :: DocumentDiagnosticReportPartialResult -> ()
NFData, Eq DocumentDiagnosticReportPartialResult
Eq DocumentDiagnosticReportPartialResult =>
(Int -> DocumentDiagnosticReportPartialResult -> Int)
-> (DocumentDiagnosticReportPartialResult -> Int)
-> Hashable DocumentDiagnosticReportPartialResult
Int -> DocumentDiagnosticReportPartialResult -> Int
DocumentDiagnosticReportPartialResult -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DocumentDiagnosticReportPartialResult -> Int
hashWithSalt :: Int -> DocumentDiagnosticReportPartialResult -> Int
$chash :: DocumentDiagnosticReportPartialResult -> Int
hash :: DocumentDiagnosticReportPartialResult -> Int
Hashable)
  deriving (forall ann. DocumentDiagnosticReportPartialResult -> Doc ann)
-> (forall ann. [DocumentDiagnosticReportPartialResult] -> Doc ann)
-> Pretty DocumentDiagnosticReportPartialResult
forall ann. [DocumentDiagnosticReportPartialResult] -> Doc ann
forall ann. DocumentDiagnosticReportPartialResult -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DocumentDiagnosticReportPartialResult -> Doc ann
pretty :: forall ann. DocumentDiagnosticReportPartialResult -> Doc ann
$cprettyList :: forall ann. [DocumentDiagnosticReportPartialResult] -> Doc ann
prettyList :: 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 ([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
"relatedDocuments" Key
-> Map
     Uri
     (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)
-> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Map
  Uri
  (FullDocumentDiagnosticReport |? UnchangedDocumentDiagnosticReport)
arg0]]

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