{- 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.RelatedUnchangedDocumentDiagnosticReport 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.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

{-|
An unchanged diagnostic report with a set of related documents.

@since 3.17.0
-}
data RelatedUnchangedDocumentDiagnosticReport = RelatedUnchangedDocumentDiagnosticReport 
  { {-|
  A document diagnostic report indicating
  no changes to the last result. A server can
  only return `unchanged` if result ids are
  provided.
  -}
  RelatedUnchangedDocumentDiagnosticReport -> AString "unchanged"
_kind :: (Language.LSP.Protocol.Types.Singletons.AString "unchanged")
  , {-|
  A result id which will be sent on the next
  diagnostic request for the same document.
  -}
  RelatedUnchangedDocumentDiagnosticReport -> Text
_resultId :: Data.Text.Text
  , {-|
  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
  -}
  RelatedUnchangedDocumentDiagnosticReport
-> 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 -> RelatedUnchangedDocumentDiagnosticReport -> ShowS
[RelatedUnchangedDocumentDiagnosticReport] -> ShowS
RelatedUnchangedDocumentDiagnosticReport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelatedUnchangedDocumentDiagnosticReport] -> ShowS
$cshowList :: [RelatedUnchangedDocumentDiagnosticReport] -> ShowS
show :: RelatedUnchangedDocumentDiagnosticReport -> String
$cshow :: RelatedUnchangedDocumentDiagnosticReport -> String
showsPrec :: Int -> RelatedUnchangedDocumentDiagnosticReport -> ShowS
$cshowsPrec :: Int -> RelatedUnchangedDocumentDiagnosticReport -> ShowS
Show, RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c/= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
== :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c== :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
Eq, Eq RelatedUnchangedDocumentDiagnosticReport
RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Ordering
RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
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 :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
$cmin :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
max :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
$cmax :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport
>= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c>= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
> :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c> :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
<= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c<= :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
< :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
$c< :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Bool
compare :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Ordering
$ccompare :: RelatedUnchangedDocumentDiagnosticReport
-> RelatedUnchangedDocumentDiagnosticReport -> Ordering
Ord, forall x.
Rep RelatedUnchangedDocumentDiagnosticReport x
-> RelatedUnchangedDocumentDiagnosticReport
forall x.
RelatedUnchangedDocumentDiagnosticReport
-> Rep RelatedUnchangedDocumentDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RelatedUnchangedDocumentDiagnosticReport x
-> RelatedUnchangedDocumentDiagnosticReport
$cfrom :: forall x.
RelatedUnchangedDocumentDiagnosticReport
-> Rep RelatedUnchangedDocumentDiagnosticReport x
Generic)
  deriving anyclass (RelatedUnchangedDocumentDiagnosticReport -> ()
forall a. (a -> ()) -> NFData a
rnf :: RelatedUnchangedDocumentDiagnosticReport -> ()
$crnf :: RelatedUnchangedDocumentDiagnosticReport -> ()
NFData, Eq RelatedUnchangedDocumentDiagnosticReport
Int -> RelatedUnchangedDocumentDiagnosticReport -> Int
RelatedUnchangedDocumentDiagnosticReport -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: RelatedUnchangedDocumentDiagnosticReport -> Int
$chash :: RelatedUnchangedDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> RelatedUnchangedDocumentDiagnosticReport -> Int
$chashWithSalt :: Int -> RelatedUnchangedDocumentDiagnosticReport -> Int
Hashable)
  deriving forall ann. [RelatedUnchangedDocumentDiagnosticReport] -> Doc ann
forall ann. RelatedUnchangedDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [RelatedUnchangedDocumentDiagnosticReport] -> Doc ann
$cprettyList :: forall ann. [RelatedUnchangedDocumentDiagnosticReport] -> Doc ann
pretty :: forall ann. RelatedUnchangedDocumentDiagnosticReport -> Doc ann
$cpretty :: forall ann. RelatedUnchangedDocumentDiagnosticReport -> Doc ann
Pretty via (ViaJSON RelatedUnchangedDocumentDiagnosticReport)

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

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