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