{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.InlineKeyboardButton where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.CallbackGame
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Internal.Utils
data InlineKeyboardButton = InlineKeyboardButton
{ InlineKeyboardButton -> Text
inlineKeyboardButtonText :: Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonUrl :: Maybe Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonCallbackData :: Maybe Text
, InlineKeyboardButton -> Maybe WebAppInfo
inlineKeyboardButtonWebApp :: Maybe WebAppInfo
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQuery :: Maybe Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQueryCurrentChat :: Maybe Text
, InlineKeyboardButton -> Maybe CallbackGame
inlineKeyboardButtonCallbackGame :: Maybe CallbackGame
, InlineKeyboardButton -> Maybe Bool
inlineKeyboardButtonPay :: Maybe Bool
}
deriving (forall x. Rep InlineKeyboardButton x -> InlineKeyboardButton
forall x. InlineKeyboardButton -> Rep InlineKeyboardButton x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineKeyboardButton x -> InlineKeyboardButton
$cfrom :: forall x. InlineKeyboardButton -> Rep InlineKeyboardButton x
Generic, Int -> InlineKeyboardButton -> ShowS
[InlineKeyboardButton] -> ShowS
InlineKeyboardButton -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineKeyboardButton] -> ShowS
$cshowList :: [InlineKeyboardButton] -> ShowS
show :: InlineKeyboardButton -> String
$cshow :: InlineKeyboardButton -> String
showsPrec :: Int -> InlineKeyboardButton -> ShowS
$cshowsPrec :: Int -> InlineKeyboardButton -> ShowS
Show)
labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
labeledInlineKeyboardButton Text
label = Text
-> Maybe Text
-> Maybe Text
-> Maybe WebAppInfo
-> Maybe Text
-> Maybe Text
-> Maybe CallbackGame
-> Maybe Bool
-> InlineKeyboardButton
InlineKeyboardButton Text
label forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing
instance ToJSON InlineKeyboardButton where toJSON :: InlineKeyboardButton -> 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 InlineKeyboardButton where parseJSON :: Value -> Parser InlineKeyboardButton
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON