{- 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.RelatedFullDocumentDiagnosticReport 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 Data.Text
import qualified Language.LSP.Protocol.Internal.Types.Diagnostic
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.Singletons
import qualified Language.LSP.Protocol.Types.Uri

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

@since 3.17.0
-}
data RelatedFullDocumentDiagnosticReport = RelatedFullDocumentDiagnosticReport 
  { {-|
  A full document diagnostic report.
  -}
  RelatedFullDocumentDiagnosticReport -> 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.
  -}
  RelatedFullDocumentDiagnosticReport -> Maybe Text
_resultId :: (Maybe Data.Text.Text)
  , {-|
  The actual items.
  -}
  RelatedFullDocumentDiagnosticReport -> [Diagnostic]
_items :: [Language.LSP.Protocol.Internal.Types.Diagnostic.Diagnostic]
  , {-|
  Diagnostics of related documents. This information is useful
  in programming languages where code in a file A can generate
  diagnostics in a file B which A depends on. An example of
  such a language is C/C++ where marco definitions in a file
  a.cpp and result in errors in a header file b.hpp.

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

instance Aeson.ToJSON RelatedFullDocumentDiagnosticReport where
  toJSON :: RelatedFullDocumentDiagnosticReport -> Value
toJSON (RelatedFullDocumentDiagnosticReport AString "full"
arg0 Maybe Text
arg1 [Diagnostic]
arg2 Maybe
  (Map
     Uri
     (FullDocumentDiagnosticReport
      |? UnchangedDocumentDiagnosticReport))
arg3) = [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]
    ,String
"relatedDocuments" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Map
     Uri
     (FullDocumentDiagnosticReport
      |? UnchangedDocumentDiagnosticReport))
arg3]

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