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