{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.WorkDoneProgressParams 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 Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Types.Common
data WorkDoneProgressParams = WorkDoneProgressParams
{
WorkDoneProgressParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
}
deriving stock (Int -> WorkDoneProgressParams -> ShowS
[WorkDoneProgressParams] -> ShowS
WorkDoneProgressParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkDoneProgressParams] -> ShowS
$cshowList :: [WorkDoneProgressParams] -> ShowS
show :: WorkDoneProgressParams -> String
$cshow :: WorkDoneProgressParams -> String
showsPrec :: Int -> WorkDoneProgressParams -> ShowS
$cshowsPrec :: Int -> WorkDoneProgressParams -> ShowS
Show, WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c/= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
== :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c== :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
Eq, Eq WorkDoneProgressParams
WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
WorkDoneProgressParams -> WorkDoneProgressParams -> Ordering
WorkDoneProgressParams
-> WorkDoneProgressParams -> WorkDoneProgressParams
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 :: WorkDoneProgressParams
-> WorkDoneProgressParams -> WorkDoneProgressParams
$cmin :: WorkDoneProgressParams
-> WorkDoneProgressParams -> WorkDoneProgressParams
max :: WorkDoneProgressParams
-> WorkDoneProgressParams -> WorkDoneProgressParams
$cmax :: WorkDoneProgressParams
-> WorkDoneProgressParams -> WorkDoneProgressParams
>= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c>= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
> :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c> :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
<= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c<= :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
< :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
$c< :: WorkDoneProgressParams -> WorkDoneProgressParams -> Bool
compare :: WorkDoneProgressParams -> WorkDoneProgressParams -> Ordering
$ccompare :: WorkDoneProgressParams -> WorkDoneProgressParams -> Ordering
Ord, forall x. Rep WorkDoneProgressParams x -> WorkDoneProgressParams
forall x. WorkDoneProgressParams -> Rep WorkDoneProgressParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkDoneProgressParams x -> WorkDoneProgressParams
$cfrom :: forall x. WorkDoneProgressParams -> Rep WorkDoneProgressParams x
Generic)
deriving anyclass (WorkDoneProgressParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkDoneProgressParams -> ()
$crnf :: WorkDoneProgressParams -> ()
NFData, Eq WorkDoneProgressParams
Int -> WorkDoneProgressParams -> Int
WorkDoneProgressParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkDoneProgressParams -> Int
$chash :: WorkDoneProgressParams -> Int
hashWithSalt :: Int -> WorkDoneProgressParams -> Int
$chashWithSalt :: Int -> WorkDoneProgressParams -> Int
Hashable)
deriving forall ann. [WorkDoneProgressParams] -> Doc ann
forall ann. WorkDoneProgressParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkDoneProgressParams] -> Doc ann
$cprettyList :: forall ann. [WorkDoneProgressParams] -> Doc ann
pretty :: forall ann. WorkDoneProgressParams -> Doc ann
$cpretty :: forall ann. WorkDoneProgressParams -> Doc ann
Pretty via (ViaJSON WorkDoneProgressParams)
instance Aeson.ToJSON WorkDoneProgressParams where
toJSON :: WorkDoneProgressParams -> Value
toJSON (WorkDoneProgressParams Maybe ProgressToken
arg0) = [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
$ [String
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0]
instance Aeson.FromJSON WorkDoneProgressParams where
parseJSON :: Value -> Parser WorkDoneProgressParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkDoneProgressParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken -> WorkDoneProgressParams
WorkDoneProgressParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"workDoneToken"