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