{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.PollAnswer where
import Data.Aeson (FromJSON (..), ToJSON (..))
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.User
import Telegram.Bot.API.Internal.Utils
data PollAnswer = PollAnswer
{ PollAnswer -> PollId
pollAnswerPollId :: PollId
, PollAnswer -> User
pollAnswerUser :: User
, PollAnswer -> [Int]
pollAnswerOptionIds :: [Int]
}
deriving (forall x. Rep PollAnswer x -> PollAnswer
forall x. PollAnswer -> Rep PollAnswer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PollAnswer x -> PollAnswer
$cfrom :: forall x. PollAnswer -> Rep PollAnswer x
Generic, Int -> PollAnswer -> ShowS
[PollAnswer] -> ShowS
PollAnswer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollAnswer] -> ShowS
$cshowList :: [PollAnswer] -> ShowS
show :: PollAnswer -> String
$cshow :: PollAnswer -> String
showsPrec :: Int -> PollAnswer -> ShowS
$cshowsPrec :: Int -> PollAnswer -> ShowS
Show)
instance ToJSON PollAnswer where toJSON :: PollAnswer -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON PollAnswer where parseJSON :: Value -> Parser PollAnswer
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON