module TD.Query.SetChatMessageAutoDeleteTime
(SetChatMessageAutoDeleteTime(..)
, defaultSetChatMessageAutoDeleteTime
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data SetChatMessageAutoDeleteTime
= SetChatMessageAutoDeleteTime
{ SetChatMessageAutoDeleteTime -> Maybe Int
chat_id :: Maybe Int
, SetChatMessageAutoDeleteTime -> Maybe Int
message_auto_delete_time :: Maybe Int
}
deriving (SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool
(SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool)
-> (SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool)
-> Eq SetChatMessageAutoDeleteTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool
== :: SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool
$c/= :: SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool
/= :: SetChatMessageAutoDeleteTime
-> SetChatMessageAutoDeleteTime -> Bool
Eq, Int -> SetChatMessageAutoDeleteTime -> ShowS
[SetChatMessageAutoDeleteTime] -> ShowS
SetChatMessageAutoDeleteTime -> String
(Int -> SetChatMessageAutoDeleteTime -> ShowS)
-> (SetChatMessageAutoDeleteTime -> String)
-> ([SetChatMessageAutoDeleteTime] -> ShowS)
-> Show SetChatMessageAutoDeleteTime
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetChatMessageAutoDeleteTime -> ShowS
showsPrec :: Int -> SetChatMessageAutoDeleteTime -> ShowS
$cshow :: SetChatMessageAutoDeleteTime -> String
show :: SetChatMessageAutoDeleteTime -> String
$cshowList :: [SetChatMessageAutoDeleteTime] -> ShowS
showList :: [SetChatMessageAutoDeleteTime] -> ShowS
Show)
instance I.ShortShow SetChatMessageAutoDeleteTime where
shortShow :: SetChatMessageAutoDeleteTime -> String
shortShow
SetChatMessageAutoDeleteTime
{ chat_id :: SetChatMessageAutoDeleteTime -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_auto_delete_time :: SetChatMessageAutoDeleteTime -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
}
= String
"SetChatMessageAutoDeleteTime"
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_auto_delete_time" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_auto_delete_time_
]
instance AT.ToJSON SetChatMessageAutoDeleteTime where
toJSON :: SetChatMessageAutoDeleteTime -> Value
toJSON
SetChatMessageAutoDeleteTime
{ chat_id :: SetChatMessageAutoDeleteTime -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_auto_delete_time :: SetChatMessageAutoDeleteTime -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
}
= [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
"setChatMessageAutoDeleteTime"
, 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_auto_delete_time" 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_auto_delete_time_
]
defaultSetChatMessageAutoDeleteTime :: SetChatMessageAutoDeleteTime
defaultSetChatMessageAutoDeleteTime :: SetChatMessageAutoDeleteTime
defaultSetChatMessageAutoDeleteTime =
SetChatMessageAutoDeleteTime
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_auto_delete_time :: Maybe Int
message_auto_delete_time = Maybe Int
forall a. Maybe a
Nothing
}