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