module TD.Query.AddQuickReplyShortcutMessage
(AddQuickReplyShortcutMessage(..)
, defaultAddQuickReplyShortcutMessage
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
import qualified TD.Data.InputMessageContent as InputMessageContent
data AddQuickReplyShortcutMessage
= AddQuickReplyShortcutMessage
{ AddQuickReplyShortcutMessage -> Maybe Text
shortcut_name :: Maybe T.Text
, AddQuickReplyShortcutMessage -> Maybe Int
reply_to_message_id :: Maybe Int
, AddQuickReplyShortcutMessage -> Maybe InputMessageContent
input_message_content :: Maybe InputMessageContent.InputMessageContent
}
deriving (AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool
(AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool)
-> (AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool)
-> Eq AddQuickReplyShortcutMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool
== :: AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool
$c/= :: AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool
/= :: AddQuickReplyShortcutMessage
-> AddQuickReplyShortcutMessage -> Bool
Eq, Int -> AddQuickReplyShortcutMessage -> ShowS
[AddQuickReplyShortcutMessage] -> ShowS
AddQuickReplyShortcutMessage -> String
(Int -> AddQuickReplyShortcutMessage -> ShowS)
-> (AddQuickReplyShortcutMessage -> String)
-> ([AddQuickReplyShortcutMessage] -> ShowS)
-> Show AddQuickReplyShortcutMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddQuickReplyShortcutMessage -> ShowS
showsPrec :: Int -> AddQuickReplyShortcutMessage -> ShowS
$cshow :: AddQuickReplyShortcutMessage -> String
show :: AddQuickReplyShortcutMessage -> String
$cshowList :: [AddQuickReplyShortcutMessage] -> ShowS
showList :: [AddQuickReplyShortcutMessage] -> ShowS
Show)
instance I.ShortShow AddQuickReplyShortcutMessage where
shortShow :: AddQuickReplyShortcutMessage -> String
shortShow
AddQuickReplyShortcutMessage
{ shortcut_name :: AddQuickReplyShortcutMessage -> Maybe Text
shortcut_name = Maybe Text
shortcut_name_
, reply_to_message_id :: AddQuickReplyShortcutMessage -> Maybe Int
reply_to_message_id = Maybe Int
reply_to_message_id_
, input_message_content :: AddQuickReplyShortcutMessage -> Maybe InputMessageContent
input_message_content = Maybe InputMessageContent
input_message_content_
}
= String
"AddQuickReplyShortcutMessage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"shortcut_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
shortcut_name_
, String
"reply_to_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
reply_to_message_id_
, String
"input_message_content" String -> Maybe InputMessageContent -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputMessageContent
input_message_content_
]
instance AT.ToJSON AddQuickReplyShortcutMessage where
toJSON :: AddQuickReplyShortcutMessage -> Value
toJSON
AddQuickReplyShortcutMessage
{ shortcut_name :: AddQuickReplyShortcutMessage -> Maybe Text
shortcut_name = Maybe Text
shortcut_name_
, reply_to_message_id :: AddQuickReplyShortcutMessage -> Maybe Int
reply_to_message_id = Maybe Int
reply_to_message_id_
, input_message_content :: AddQuickReplyShortcutMessage -> Maybe InputMessageContent
input_message_content = Maybe InputMessageContent
input_message_content_
}
= [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
"addQuickReplyShortcutMessage"
, Key
"shortcut_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
shortcut_name_
, Key
"reply_to_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
reply_to_message_id_
, Key
"input_message_content" Key -> Maybe InputMessageContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputMessageContent
input_message_content_
]
defaultAddQuickReplyShortcutMessage :: AddQuickReplyShortcutMessage
defaultAddQuickReplyShortcutMessage :: AddQuickReplyShortcutMessage
defaultAddQuickReplyShortcutMessage =
AddQuickReplyShortcutMessage
{ shortcut_name :: Maybe Text
shortcut_name = Maybe Text
forall a. Maybe a
Nothing
, reply_to_message_id :: Maybe Int
reply_to_message_id = Maybe Int
forall a. Maybe a
Nothing
, input_message_content :: Maybe InputMessageContent
input_message_content = Maybe InputMessageContent
forall a. Maybe a
Nothing
}