module TD.Query.GetMessageEffect
(GetMessageEffect(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetMessageEffect
= GetMessageEffect
{ GetMessageEffect -> Maybe Int
effect_id :: Maybe Int
}
deriving (GetMessageEffect -> GetMessageEffect -> Bool
(GetMessageEffect -> GetMessageEffect -> Bool)
-> (GetMessageEffect -> GetMessageEffect -> Bool)
-> Eq GetMessageEffect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetMessageEffect -> GetMessageEffect -> Bool
== :: GetMessageEffect -> GetMessageEffect -> Bool
$c/= :: GetMessageEffect -> GetMessageEffect -> Bool
/= :: GetMessageEffect -> GetMessageEffect -> Bool
Eq, Int -> GetMessageEffect -> ShowS
[GetMessageEffect] -> ShowS
GetMessageEffect -> String
(Int -> GetMessageEffect -> ShowS)
-> (GetMessageEffect -> String)
-> ([GetMessageEffect] -> ShowS)
-> Show GetMessageEffect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetMessageEffect -> ShowS
showsPrec :: Int -> GetMessageEffect -> ShowS
$cshow :: GetMessageEffect -> String
show :: GetMessageEffect -> String
$cshowList :: [GetMessageEffect] -> ShowS
showList :: [GetMessageEffect] -> ShowS
Show)
instance I.ShortShow GetMessageEffect where
shortShow :: GetMessageEffect -> String
shortShow
GetMessageEffect
{ effect_id :: GetMessageEffect -> Maybe Int
effect_id = Maybe Int
effect_id_
}
= String
"GetMessageEffect"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"effect_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
effect_id_
]
instance AT.ToJSON GetMessageEffect where
toJSON :: GetMessageEffect -> Value
toJSON
GetMessageEffect
{ effect_id :: GetMessageEffect -> Maybe Int
effect_id = Maybe Int
effect_id_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"getMessageEffect"
, Key
"effect_id" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
effect_id_
]