module TD.Query.DeletePollOption
(DeletePollOption(..)
, defaultDeletePollOption
) 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 DeletePollOption
= DeletePollOption
{ DeletePollOption -> Maybe Int
chat_id :: Maybe Int
, DeletePollOption -> Maybe Int
message_id :: Maybe Int
, DeletePollOption -> Maybe Text
option_id :: Maybe T.Text
}
deriving (DeletePollOption -> DeletePollOption -> Bool
(DeletePollOption -> DeletePollOption -> Bool)
-> (DeletePollOption -> DeletePollOption -> Bool)
-> Eq DeletePollOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeletePollOption -> DeletePollOption -> Bool
== :: DeletePollOption -> DeletePollOption -> Bool
$c/= :: DeletePollOption -> DeletePollOption -> Bool
/= :: DeletePollOption -> DeletePollOption -> Bool
Eq, Int -> DeletePollOption -> ShowS
[DeletePollOption] -> ShowS
DeletePollOption -> String
(Int -> DeletePollOption -> ShowS)
-> (DeletePollOption -> String)
-> ([DeletePollOption] -> ShowS)
-> Show DeletePollOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeletePollOption -> ShowS
showsPrec :: Int -> DeletePollOption -> ShowS
$cshow :: DeletePollOption -> String
show :: DeletePollOption -> String
$cshowList :: [DeletePollOption] -> ShowS
showList :: [DeletePollOption] -> ShowS
Show)
instance I.ShortShow DeletePollOption where
shortShow :: DeletePollOption -> String
shortShow
DeletePollOption
{ chat_id :: DeletePollOption -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: DeletePollOption -> Maybe Int
message_id = Maybe Int
message_id_
, option_id :: DeletePollOption -> Maybe Text
option_id = Maybe Text
option_id_
}
= String
"DeletePollOption"
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
"option_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
option_id_
]
instance AT.ToJSON DeletePollOption where
toJSON :: DeletePollOption -> Value
toJSON
DeletePollOption
{ chat_id :: DeletePollOption -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: DeletePollOption -> Maybe Int
message_id = Maybe Int
message_id_
, option_id :: DeletePollOption -> Maybe Text
option_id = Maybe Text
option_id_
}
= [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
"deletePollOption"
, 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
"option_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
option_id_
]
defaultDeletePollOption :: DeletePollOption
defaultDeletePollOption :: DeletePollOption
defaultDeletePollOption =
DeletePollOption
{ 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
, option_id :: Maybe Text
option_id = Maybe Text
forall a. Maybe a
Nothing
}