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

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