module TD.Query.StopBusinessPoll
(StopBusinessPoll(..)
, defaultStopBusinessPoll
) 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.ReplyMarkup as ReplyMarkup
data StopBusinessPoll
= StopBusinessPoll
{ StopBusinessPoll -> Maybe Text
business_connection_id :: Maybe T.Text
, StopBusinessPoll -> Maybe Int
chat_id :: Maybe Int
, StopBusinessPoll -> Maybe Int
message_id :: Maybe Int
, StopBusinessPoll -> Maybe ReplyMarkup
reply_markup :: Maybe ReplyMarkup.ReplyMarkup
}
deriving (StopBusinessPoll -> StopBusinessPoll -> Bool
(StopBusinessPoll -> StopBusinessPoll -> Bool)
-> (StopBusinessPoll -> StopBusinessPoll -> Bool)
-> Eq StopBusinessPoll
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StopBusinessPoll -> StopBusinessPoll -> Bool
== :: StopBusinessPoll -> StopBusinessPoll -> Bool
$c/= :: StopBusinessPoll -> StopBusinessPoll -> Bool
/= :: StopBusinessPoll -> StopBusinessPoll -> Bool
Eq, Int -> StopBusinessPoll -> ShowS
[StopBusinessPoll] -> ShowS
StopBusinessPoll -> String
(Int -> StopBusinessPoll -> ShowS)
-> (StopBusinessPoll -> String)
-> ([StopBusinessPoll] -> ShowS)
-> Show StopBusinessPoll
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StopBusinessPoll -> ShowS
showsPrec :: Int -> StopBusinessPoll -> ShowS
$cshow :: StopBusinessPoll -> String
show :: StopBusinessPoll -> String
$cshowList :: [StopBusinessPoll] -> ShowS
showList :: [StopBusinessPoll] -> ShowS
Show)
instance I.ShortShow StopBusinessPoll where
shortShow :: StopBusinessPoll -> String
shortShow
StopBusinessPoll
{ business_connection_id :: StopBusinessPoll -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, chat_id :: StopBusinessPoll -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: StopBusinessPoll -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: StopBusinessPoll -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
}
= String
"StopBusinessPoll"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
, 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
"reply_markup" String -> Maybe ReplyMarkup -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ReplyMarkup
reply_markup_
]
instance AT.ToJSON StopBusinessPoll where
toJSON :: StopBusinessPoll -> Value
toJSON
StopBusinessPoll
{ business_connection_id :: StopBusinessPoll -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, chat_id :: StopBusinessPoll -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: StopBusinessPoll -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: StopBusinessPoll -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
}
= [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
"stopBusinessPoll"
, Key
"business_connection_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
business_connection_id_
, 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
"reply_markup" Key -> Maybe ReplyMarkup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ReplyMarkup
reply_markup_
]
defaultStopBusinessPoll :: StopBusinessPoll
defaultStopBusinessPoll :: StopBusinessPoll
defaultStopBusinessPoll =
StopBusinessPoll
{ business_connection_id :: Maybe Text
business_connection_id = Maybe Text
forall a. Maybe a
Nothing
, 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
, reply_markup :: Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
forall a. Maybe a
Nothing
}