module TD.Query.AddBotMediaPreview
(AddBotMediaPreview(..)
, defaultAddBotMediaPreview
) 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.InputStoryContent as InputStoryContent
data AddBotMediaPreview
= AddBotMediaPreview
{ AddBotMediaPreview -> Maybe Int
bot_user_id :: Maybe Int
, AddBotMediaPreview -> Maybe Text
language_code :: Maybe T.Text
, AddBotMediaPreview -> Maybe InputStoryContent
content :: Maybe InputStoryContent.InputStoryContent
}
deriving (AddBotMediaPreview -> AddBotMediaPreview -> Bool
(AddBotMediaPreview -> AddBotMediaPreview -> Bool)
-> (AddBotMediaPreview -> AddBotMediaPreview -> Bool)
-> Eq AddBotMediaPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddBotMediaPreview -> AddBotMediaPreview -> Bool
== :: AddBotMediaPreview -> AddBotMediaPreview -> Bool
$c/= :: AddBotMediaPreview -> AddBotMediaPreview -> Bool
/= :: AddBotMediaPreview -> AddBotMediaPreview -> Bool
Eq, Int -> AddBotMediaPreview -> ShowS
[AddBotMediaPreview] -> ShowS
AddBotMediaPreview -> String
(Int -> AddBotMediaPreview -> ShowS)
-> (AddBotMediaPreview -> String)
-> ([AddBotMediaPreview] -> ShowS)
-> Show AddBotMediaPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddBotMediaPreview -> ShowS
showsPrec :: Int -> AddBotMediaPreview -> ShowS
$cshow :: AddBotMediaPreview -> String
show :: AddBotMediaPreview -> String
$cshowList :: [AddBotMediaPreview] -> ShowS
showList :: [AddBotMediaPreview] -> ShowS
Show)
instance I.ShortShow AddBotMediaPreview where
shortShow :: AddBotMediaPreview -> String
shortShow
AddBotMediaPreview
{ bot_user_id :: AddBotMediaPreview -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, language_code :: AddBotMediaPreview -> Maybe Text
language_code = Maybe Text
language_code_
, content :: AddBotMediaPreview -> Maybe InputStoryContent
content = Maybe InputStoryContent
content_
}
= String
"AddBotMediaPreview"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"language_code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
language_code_
, String
"content" String -> Maybe InputStoryContent -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputStoryContent
content_
]
instance AT.ToJSON AddBotMediaPreview where
toJSON :: AddBotMediaPreview -> Value
toJSON
AddBotMediaPreview
{ bot_user_id :: AddBotMediaPreview -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, language_code :: AddBotMediaPreview -> Maybe Text
language_code = Maybe Text
language_code_
, content :: AddBotMediaPreview -> Maybe InputStoryContent
content = Maybe InputStoryContent
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
"addBotMediaPreview"
, Key
"bot_user_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
bot_user_id_
, Key
"language_code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
language_code_
, Key
"content" Key -> Maybe InputStoryContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputStoryContent
content_
]
defaultAddBotMediaPreview :: AddBotMediaPreview
defaultAddBotMediaPreview :: AddBotMediaPreview
defaultAddBotMediaPreview =
AddBotMediaPreview
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, language_code :: Maybe Text
language_code = Maybe Text
forall a. Maybe a
Nothing
, content :: Maybe InputStoryContent
content = Maybe InputStoryContent
forall a. Maybe a
Nothing
}