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