{- 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
(Int -> RelatedFullDocumentDiagnosticReport -> ShowS)
-> (RelatedFullDocumentDiagnosticReport -> String)
-> ([RelatedFullDocumentDiagnosticReport] -> ShowS)
-> Show RelatedFullDocumentDiagnosticReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RelatedFullDocumentDiagnosticReport -> ShowS
showsPrec :: Int -> RelatedFullDocumentDiagnosticReport -> ShowS
$cshow :: RelatedFullDocumentDiagnosticReport -> String
show :: RelatedFullDocumentDiagnosticReport -> String
$cshowList :: [RelatedFullDocumentDiagnosticReport] -> ShowS
showList :: [RelatedFullDocumentDiagnosticReport] -> ShowS
Show, RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
(RelatedFullDocumentDiagnosticReport
 -> RelatedFullDocumentDiagnosticReport -> Bool)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport -> Bool)
-> Eq RelatedFullDocumentDiagnosticReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
== :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
$c/= :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
/= :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
Eq, Eq RelatedFullDocumentDiagnosticReport
Eq RelatedFullDocumentDiagnosticReport =>
(RelatedFullDocumentDiagnosticReport
 -> RelatedFullDocumentDiagnosticReport -> Ordering)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport -> Bool)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport -> Bool)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport -> Bool)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport -> Bool)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport)
-> (RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport
    -> RelatedFullDocumentDiagnosticReport)
-> Ord 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
$ccompare :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Ordering
compare :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Ordering
$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
>= :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport -> Bool
$cmax :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
max :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
$cmin :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
min :: RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
-> RelatedFullDocumentDiagnosticReport
Ord, (forall x.
 RelatedFullDocumentDiagnosticReport
 -> Rep RelatedFullDocumentDiagnosticReport x)
-> (forall x.
    Rep RelatedFullDocumentDiagnosticReport x
    -> RelatedFullDocumentDiagnosticReport)
-> Generic RelatedFullDocumentDiagnosticReport
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
$cfrom :: forall x.
RelatedFullDocumentDiagnosticReport
-> Rep RelatedFullDocumentDiagnosticReport x
from :: forall x.
RelatedFullDocumentDiagnosticReport
-> Rep RelatedFullDocumentDiagnosticReport x
$cto :: forall x.
Rep RelatedFullDocumentDiagnosticReport x
-> RelatedFullDocumentDiagnosticReport
to :: forall x.
Rep RelatedFullDocumentDiagnosticReport x
-> RelatedFullDocumentDiagnosticReport
Generic)
  deriving anyclass (RelatedFullDocumentDiagnosticReport -> ()
(RelatedFullDocumentDiagnosticReport -> ())
-> NFData RelatedFullDocumentDiagnosticReport
forall a. (a -> ()) -> NFData a
$crnf :: RelatedFullDocumentDiagnosticReport -> ()
rnf :: RelatedFullDocumentDiagnosticReport -> ()
NFData, Eq RelatedFullDocumentDiagnosticReport
Eq RelatedFullDocumentDiagnosticReport =>
(Int -> RelatedFullDocumentDiagnosticReport -> Int)
-> (RelatedFullDocumentDiagnosticReport -> Int)
-> Hashable RelatedFullDocumentDiagnosticReport
Int -> RelatedFullDocumentDiagnosticReport -> Int
RelatedFullDocumentDiagnosticReport -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> RelatedFullDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> RelatedFullDocumentDiagnosticReport -> Int
$chash :: RelatedFullDocumentDiagnosticReport -> Int
hash :: RelatedFullDocumentDiagnosticReport -> Int
Hashable)
  deriving (forall ann. RelatedFullDocumentDiagnosticReport -> Doc ann)
-> (forall ann. [RelatedFullDocumentDiagnosticReport] -> Doc ann)
-> Pretty RelatedFullDocumentDiagnosticReport
forall ann. [RelatedFullDocumentDiagnosticReport] -> Doc ann
forall ann. RelatedFullDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. RelatedFullDocumentDiagnosticReport -> Doc ann
pretty :: forall ann. RelatedFullDocumentDiagnosticReport -> Doc ann
$cprettyList :: forall ann. [RelatedFullDocumentDiagnosticReport] -> Doc ann
prettyList :: 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 ([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
"kind" Key -> AString "full" -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= AString "full"
arg0]
    ,String
"resultId" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1
    ,[Key
"items" Key -> [Diagnostic] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [Diagnostic]
arg2]
    ,String
"relatedDocuments" String
-> Maybe
     (Map
        Uri
        (FullDocumentDiagnosticReport
         |? UnchangedDocumentDiagnosticReport))
-> [Pair]
forall e kv v.
(KeyValue e 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 = String
-> (Object -> Parser RelatedFullDocumentDiagnosticReport)
-> Value
-> Parser RelatedFullDocumentDiagnosticReport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RelatedFullDocumentDiagnosticReport" ((Object -> Parser RelatedFullDocumentDiagnosticReport)
 -> Value -> Parser RelatedFullDocumentDiagnosticReport)
-> (Object -> Parser RelatedFullDocumentDiagnosticReport)
-> Value
-> Parser RelatedFullDocumentDiagnosticReport
forall a b. (a -> b) -> a -> b
$ \Object
arg -> AString "full"
-> Maybe Text
-> [Diagnostic]
-> Maybe
     (Map
        Uri
        (FullDocumentDiagnosticReport
         |? UnchangedDocumentDiagnosticReport))
-> RelatedFullDocumentDiagnosticReport
RelatedFullDocumentDiagnosticReport (AString "full"
 -> Maybe Text
 -> [Diagnostic]
 -> Maybe
      (Map
         Uri
         (FullDocumentDiagnosticReport
          |? UnchangedDocumentDiagnosticReport))
 -> RelatedFullDocumentDiagnosticReport)
-> Parser (AString "full")
-> Parser
     (Maybe Text
      -> [Diagnostic]
      -> Maybe
           (Map
              Uri
              (FullDocumentDiagnosticReport
               |? UnchangedDocumentDiagnosticReport))
      -> RelatedFullDocumentDiagnosticReport)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (AString "full")
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" Parser
  (Maybe Text
   -> [Diagnostic]
   -> Maybe
        (Map
           Uri
           (FullDocumentDiagnosticReport
            |? UnchangedDocumentDiagnosticReport))
   -> RelatedFullDocumentDiagnosticReport)
-> Parser (Maybe Text)
-> Parser
     ([Diagnostic]
      -> Maybe
           (Map
              Uri
              (FullDocumentDiagnosticReport
               |? UnchangedDocumentDiagnosticReport))
      -> RelatedFullDocumentDiagnosticReport)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"resultId" Parser
  ([Diagnostic]
   -> Maybe
        (Map
           Uri
           (FullDocumentDiagnosticReport
            |? UnchangedDocumentDiagnosticReport))
   -> RelatedFullDocumentDiagnosticReport)
-> Parser [Diagnostic]
-> Parser
     (Maybe
        (Map
           Uri
           (FullDocumentDiagnosticReport
            |? UnchangedDocumentDiagnosticReport))
      -> RelatedFullDocumentDiagnosticReport)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser [Diagnostic]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"items" Parser
  (Maybe
     (Map
        Uri
        (FullDocumentDiagnosticReport
         |? UnchangedDocumentDiagnosticReport))
   -> RelatedFullDocumentDiagnosticReport)
-> Parser
     (Maybe
        (Map
           Uri
           (FullDocumentDiagnosticReport
            |? UnchangedDocumentDiagnosticReport)))
-> Parser RelatedFullDocumentDiagnosticReport
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object
-> Key
-> Parser
     (Maybe
        (Map
           Uri
           (FullDocumentDiagnosticReport
            |? UnchangedDocumentDiagnosticReport)))
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"relatedDocuments"