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

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

import Telegram.Bot.API.Internal.Utils

-- ** 'BotCommand'

-- | This object represents a bot command.
data BotCommand = BotCommand
  { BotCommand -> Text
botCommandCommand :: Text -- ^ Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
  , BotCommand -> Text
botCommandDescription :: Text -- ^ Description of the command; 1-256 characters.
  }
  deriving (forall x. Rep BotCommand x -> BotCommand
forall x. BotCommand -> Rep BotCommand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotCommand x -> BotCommand
$cfrom :: forall x. BotCommand -> Rep BotCommand x
Generic, Int -> BotCommand -> ShowS
[BotCommand] -> ShowS
BotCommand -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotCommand] -> ShowS
$cshowList :: [BotCommand] -> ShowS
show :: BotCommand -> String
$cshow :: BotCommand -> String
showsPrec :: Int -> BotCommand -> ShowS
$cshowsPrec :: Int -> BotCommand -> ShowS
Show)

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