module TD.Query.AddQuickReplyShortcutInlineQueryResultMessage
(AddQuickReplyShortcutInlineQueryResultMessage(..)
, defaultAddQuickReplyShortcutInlineQueryResultMessage
) 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
data AddQuickReplyShortcutInlineQueryResultMessage
= AddQuickReplyShortcutInlineQueryResultMessage
{ AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
shortcut_name :: Maybe T.Text
, AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
reply_to_message_id :: Maybe Int
, AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
query_id :: Maybe Int
, AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
result_id :: Maybe T.Text
, AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Bool
hide_via_bot :: Maybe Bool
}
deriving (AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool
(AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool)
-> (AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool)
-> Eq AddQuickReplyShortcutInlineQueryResultMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool
== :: AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool
$c/= :: AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool
/= :: AddQuickReplyShortcutInlineQueryResultMessage
-> AddQuickReplyShortcutInlineQueryResultMessage -> Bool
Eq, Int -> AddQuickReplyShortcutInlineQueryResultMessage -> ShowS
[AddQuickReplyShortcutInlineQueryResultMessage] -> ShowS
AddQuickReplyShortcutInlineQueryResultMessage -> String
(Int -> AddQuickReplyShortcutInlineQueryResultMessage -> ShowS)
-> (AddQuickReplyShortcutInlineQueryResultMessage -> String)
-> ([AddQuickReplyShortcutInlineQueryResultMessage] -> ShowS)
-> Show AddQuickReplyShortcutInlineQueryResultMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddQuickReplyShortcutInlineQueryResultMessage -> ShowS
showsPrec :: Int -> AddQuickReplyShortcutInlineQueryResultMessage -> ShowS
$cshow :: AddQuickReplyShortcutInlineQueryResultMessage -> String
show :: AddQuickReplyShortcutInlineQueryResultMessage -> String
$cshowList :: [AddQuickReplyShortcutInlineQueryResultMessage] -> ShowS
showList :: [AddQuickReplyShortcutInlineQueryResultMessage] -> ShowS
Show)
instance I.ShortShow AddQuickReplyShortcutInlineQueryResultMessage where
shortShow :: AddQuickReplyShortcutInlineQueryResultMessage -> String
shortShow
AddQuickReplyShortcutInlineQueryResultMessage
{ shortcut_name :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
shortcut_name = Maybe Text
shortcut_name_
, reply_to_message_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
reply_to_message_id = Maybe Int
reply_to_message_id_
, query_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
query_id = Maybe Int
query_id_
, result_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
result_id = Maybe Text
result_id_
, hide_via_bot :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Bool
hide_via_bot = Maybe Bool
hide_via_bot_
}
= String
"AddQuickReplyShortcutInlineQueryResultMessage"
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
"query_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
query_id_
, String
"result_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
result_id_
, String
"hide_via_bot" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
hide_via_bot_
]
instance AT.ToJSON AddQuickReplyShortcutInlineQueryResultMessage where
toJSON :: AddQuickReplyShortcutInlineQueryResultMessage -> Value
toJSON
AddQuickReplyShortcutInlineQueryResultMessage
{ shortcut_name :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
shortcut_name = Maybe Text
shortcut_name_
, reply_to_message_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
reply_to_message_id = Maybe Int
reply_to_message_id_
, query_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Int
query_id = Maybe Int
query_id_
, result_id :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Text
result_id = Maybe Text
result_id_
, hide_via_bot :: AddQuickReplyShortcutInlineQueryResultMessage -> Maybe Bool
hide_via_bot = Maybe Bool
hide_via_bot_
}
= [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
"addQuickReplyShortcutInlineQueryResultMessage"
, 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
"query_id" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
query_id_
, Key
"result_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
result_id_
, Key
"hide_via_bot" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
hide_via_bot_
]
defaultAddQuickReplyShortcutInlineQueryResultMessage :: AddQuickReplyShortcutInlineQueryResultMessage
defaultAddQuickReplyShortcutInlineQueryResultMessage :: AddQuickReplyShortcutInlineQueryResultMessage
defaultAddQuickReplyShortcutInlineQueryResultMessage =
AddQuickReplyShortcutInlineQueryResultMessage
{ 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
, query_id :: Maybe Int
query_id = Maybe Int
forall a. Maybe a
Nothing
, result_id :: Maybe Text
result_id = Maybe Text
forall a. Maybe a
Nothing
, hide_via_bot :: Maybe Bool
hide_via_bot = Maybe Bool
forall a. Maybe a
Nothing
}