{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.InlineKeyboardMarkup where

import Data.Aeson (FromJSON (..), ToJSON (..))
import GHC.Generics (Generic)

import Telegram.Bot.API.Types.InlineKeyboardButton
import Telegram.Bot.API.Internal.Utils

-- ** 'InlineKeyboardMarkup'

-- | This object represents an inline keyboard that appears
-- right next to the message it belongs to.
data InlineKeyboardMarkup = InlineKeyboardMarkup
  { InlineKeyboardMarkup -> [[InlineKeyboardButton]]
inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]] -- ^ Array of button rows, each represented by an Array of InlineKeyboardButton objects
  }
  deriving (forall x. Rep InlineKeyboardMarkup x -> InlineKeyboardMarkup
forall x. InlineKeyboardMarkup -> Rep InlineKeyboardMarkup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineKeyboardMarkup x -> InlineKeyboardMarkup
$cfrom :: forall x. InlineKeyboardMarkup -> Rep InlineKeyboardMarkup x
Generic, Int -> InlineKeyboardMarkup -> ShowS
[InlineKeyboardMarkup] -> ShowS
InlineKeyboardMarkup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineKeyboardMarkup] -> ShowS
$cshowList :: [InlineKeyboardMarkup] -> ShowS
show :: InlineKeyboardMarkup -> String
$cshow :: InlineKeyboardMarkup -> String
showsPrec :: Int -> InlineKeyboardMarkup -> ShowS
$cshowsPrec :: Int -> InlineKeyboardMarkup -> ShowS
Show)

-- ^ 
-- **Note**: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

instance ToJSON   InlineKeyboardMarkup where toJSON :: InlineKeyboardMarkup -> 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 InlineKeyboardMarkup where parseJSON :: Value -> Parser InlineKeyboardMarkup
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON