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