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