{- 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.WorkspaceUnchangedDocumentDiagnosticReport 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.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Data.Text
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Singletons
import qualified Language.LSP.Protocol.Types.Uri

{-|
An unchanged document diagnostic report for a workspace diagnostic result.

@since 3.17.0
-}
data WorkspaceUnchangedDocumentDiagnosticReport = WorkspaceUnchangedDocumentDiagnosticReport 
  { {-|
  A document diagnostic report indicating
  no changes to the last result. A server can
  only return `unchanged` if result ids are
  provided.
  -}
  WorkspaceUnchangedDocumentDiagnosticReport -> 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.
  -}
  WorkspaceUnchangedDocumentDiagnosticReport -> Text
_resultId :: Data.Text.Text
  , {-|
  The URI for which diagnostic information is reported.
  -}
  WorkspaceUnchangedDocumentDiagnosticReport -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  The version number for which the diagnostics are reported.
  If the document is not marked as open `null` can be provided.
  -}
  WorkspaceUnchangedDocumentDiagnosticReport -> Int32 |? Null
_version :: (Language.LSP.Protocol.Types.Common.Int32 Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  }
  deriving stock (Int -> WorkspaceUnchangedDocumentDiagnosticReport -> ShowS
[WorkspaceUnchangedDocumentDiagnosticReport] -> ShowS
WorkspaceUnchangedDocumentDiagnosticReport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceUnchangedDocumentDiagnosticReport] -> ShowS
$cshowList :: [WorkspaceUnchangedDocumentDiagnosticReport] -> ShowS
show :: WorkspaceUnchangedDocumentDiagnosticReport -> String
$cshow :: WorkspaceUnchangedDocumentDiagnosticReport -> String
showsPrec :: Int -> WorkspaceUnchangedDocumentDiagnosticReport -> ShowS
$cshowsPrec :: Int -> WorkspaceUnchangedDocumentDiagnosticReport -> ShowS
Show, WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c/= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
== :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c== :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
Eq, Eq WorkspaceUnchangedDocumentDiagnosticReport
WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Ordering
WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
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 :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
$cmin :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
max :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
$cmax :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport
>= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c>= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
> :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c> :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
<= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c<= :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
< :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
$c< :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Bool
compare :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Ordering
$ccompare :: WorkspaceUnchangedDocumentDiagnosticReport
-> WorkspaceUnchangedDocumentDiagnosticReport -> Ordering
Ord, forall x.
Rep WorkspaceUnchangedDocumentDiagnosticReport x
-> WorkspaceUnchangedDocumentDiagnosticReport
forall x.
WorkspaceUnchangedDocumentDiagnosticReport
-> Rep WorkspaceUnchangedDocumentDiagnosticReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceUnchangedDocumentDiagnosticReport x
-> WorkspaceUnchangedDocumentDiagnosticReport
$cfrom :: forall x.
WorkspaceUnchangedDocumentDiagnosticReport
-> Rep WorkspaceUnchangedDocumentDiagnosticReport x
Generic)
  deriving anyclass (WorkspaceUnchangedDocumentDiagnosticReport -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceUnchangedDocumentDiagnosticReport -> ()
$crnf :: WorkspaceUnchangedDocumentDiagnosticReport -> ()
NFData, Eq WorkspaceUnchangedDocumentDiagnosticReport
Int -> WorkspaceUnchangedDocumentDiagnosticReport -> Int
WorkspaceUnchangedDocumentDiagnosticReport -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceUnchangedDocumentDiagnosticReport -> Int
$chash :: WorkspaceUnchangedDocumentDiagnosticReport -> Int
hashWithSalt :: Int -> WorkspaceUnchangedDocumentDiagnosticReport -> Int
$chashWithSalt :: Int -> WorkspaceUnchangedDocumentDiagnosticReport -> Int
Hashable)
  deriving forall ann. [WorkspaceUnchangedDocumentDiagnosticReport] -> Doc ann
forall ann. WorkspaceUnchangedDocumentDiagnosticReport -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceUnchangedDocumentDiagnosticReport] -> Doc ann
$cprettyList :: forall ann. [WorkspaceUnchangedDocumentDiagnosticReport] -> Doc ann
pretty :: forall ann. WorkspaceUnchangedDocumentDiagnosticReport -> Doc ann
$cpretty :: forall ann. WorkspaceUnchangedDocumentDiagnosticReport -> Doc ann
Pretty via (ViaJSON WorkspaceUnchangedDocumentDiagnosticReport)

instance Aeson.ToJSON WorkspaceUnchangedDocumentDiagnosticReport where
  toJSON :: WorkspaceUnchangedDocumentDiagnosticReport -> Value
toJSON (WorkspaceUnchangedDocumentDiagnosticReport AString "unchanged"
arg0 Text
arg1 Uri
arg2 Int32 |? Null
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 "unchanged"
arg0]
    ,[Key
"resultId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]
    ,[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg2]
    ,[Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Int32 |? Null
arg3]]

instance Aeson.FromJSON WorkspaceUnchangedDocumentDiagnosticReport where
  parseJSON :: Value -> Parser WorkspaceUnchangedDocumentDiagnosticReport
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceUnchangedDocumentDiagnosticReport" forall a b. (a -> b) -> a -> b
$ \Object
arg -> AString "unchanged"
-> Text
-> Uri
-> (Int32 |? Null)
-> WorkspaceUnchangedDocumentDiagnosticReport
WorkspaceUnchangedDocumentDiagnosticReport 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 a
Aeson..: Key
"uri" 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
"version"