{-# 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. BotCommand -> Rep BotCommand x)
-> (forall x. Rep BotCommand x -> BotCommand) -> Generic BotCommand
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
$cfrom :: forall x. BotCommand -> Rep BotCommand x
from :: forall x. BotCommand -> Rep BotCommand x
$cto :: forall x. Rep BotCommand x -> BotCommand
to :: forall x. Rep BotCommand x -> BotCommand
Generic, Int -> BotCommand -> ShowS
[BotCommand] -> ShowS
BotCommand -> String
(Int -> BotCommand -> ShowS)
-> (BotCommand -> String)
-> ([BotCommand] -> ShowS)
-> Show BotCommand
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BotCommand -> ShowS
showsPrec :: Int -> BotCommand -> ShowS
$cshow :: BotCommand -> String
show :: BotCommand -> String
$cshowList :: [BotCommand] -> ShowS
showList :: [BotCommand] -> ShowS
Show)

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