module TD.Query.GetMessageProperties
(GetMessageProperties(..)
, defaultGetMessageProperties
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetMessageProperties
= GetMessageProperties
{ GetMessageProperties -> Maybe Int
chat_id :: Maybe Int
, GetMessageProperties -> Maybe Int
message_id :: Maybe Int
}
deriving (GetMessageProperties -> GetMessageProperties -> Bool
(GetMessageProperties -> GetMessageProperties -> Bool)
-> (GetMessageProperties -> GetMessageProperties -> Bool)
-> Eq GetMessageProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetMessageProperties -> GetMessageProperties -> Bool
== :: GetMessageProperties -> GetMessageProperties -> Bool
$c/= :: GetMessageProperties -> GetMessageProperties -> Bool
/= :: GetMessageProperties -> GetMessageProperties -> Bool
Eq, Int -> GetMessageProperties -> ShowS
[GetMessageProperties] -> ShowS
GetMessageProperties -> String
(Int -> GetMessageProperties -> ShowS)
-> (GetMessageProperties -> String)
-> ([GetMessageProperties] -> ShowS)
-> Show GetMessageProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetMessageProperties -> ShowS
showsPrec :: Int -> GetMessageProperties -> ShowS
$cshow :: GetMessageProperties -> String
show :: GetMessageProperties -> String
$cshowList :: [GetMessageProperties] -> ShowS
showList :: [GetMessageProperties] -> ShowS
Show)
instance I.ShortShow GetMessageProperties where
shortShow :: GetMessageProperties -> String
shortShow
GetMessageProperties
{ chat_id :: GetMessageProperties -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessageProperties -> Maybe Int
message_id = Maybe Int
message_id_
}
= String
"GetMessageProperties"
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 GetMessageProperties where
toJSON :: GetMessageProperties -> Value
toJSON
GetMessageProperties
{ chat_id :: GetMessageProperties -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessageProperties -> 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
"getMessageProperties"
, 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_
]
defaultGetMessageProperties :: GetMessageProperties
defaultGetMessageProperties :: GetMessageProperties
defaultGetMessageProperties =
GetMessageProperties
{ 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
}