module TD.Query.GetMessageLocally
(GetMessageLocally(..)
, defaultGetMessageLocally
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetMessageLocally
= GetMessageLocally
{ GetMessageLocally -> Maybe Int
chat_id :: Maybe Int
, GetMessageLocally -> Maybe Int
message_id :: Maybe Int
}
deriving (GetMessageLocally -> GetMessageLocally -> Bool
(GetMessageLocally -> GetMessageLocally -> Bool)
-> (GetMessageLocally -> GetMessageLocally -> Bool)
-> Eq GetMessageLocally
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetMessageLocally -> GetMessageLocally -> Bool
== :: GetMessageLocally -> GetMessageLocally -> Bool
$c/= :: GetMessageLocally -> GetMessageLocally -> Bool
/= :: GetMessageLocally -> GetMessageLocally -> Bool
Eq, Int -> GetMessageLocally -> ShowS
[GetMessageLocally] -> ShowS
GetMessageLocally -> String
(Int -> GetMessageLocally -> ShowS)
-> (GetMessageLocally -> String)
-> ([GetMessageLocally] -> ShowS)
-> Show GetMessageLocally
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetMessageLocally -> ShowS
showsPrec :: Int -> GetMessageLocally -> ShowS
$cshow :: GetMessageLocally -> String
show :: GetMessageLocally -> String
$cshowList :: [GetMessageLocally] -> ShowS
showList :: [GetMessageLocally] -> ShowS
Show)
instance I.ShortShow GetMessageLocally where
shortShow :: GetMessageLocally -> String
shortShow
GetMessageLocally
{ chat_id :: GetMessageLocally -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessageLocally -> Maybe Int
message_id = Maybe Int
message_id_
}
= String
"GetMessageLocally"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
]
instance AT.ToJSON GetMessageLocally where
toJSON :: GetMessageLocally -> Value
toJSON
GetMessageLocally
{ chat_id :: GetMessageLocally -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessageLocally -> Maybe Int
message_id = Maybe Int
message_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
"getMessageLocally"
, Key
"chat_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
, Key
"message_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
message_id_
]
defaultGetMessageLocally :: GetMessageLocally
defaultGetMessageLocally :: GetMessageLocally
defaultGetMessageLocally =
GetMessageLocally
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_id :: Maybe Int
message_id = Maybe Int
forall a. Maybe a
Nothing
}