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

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

import Telegram.Bot.API.Types.ChatAdministratorRights
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Internal.Utils

-- ** 'KeyboardButtonRequestChat'

-- | This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
data KeyboardButtonRequestChat = KeyboardButtonRequestChat
  { KeyboardButtonRequestChat -> RequestId
keyboardButtonRequestChatRequestId :: RequestId -- ^ Signed 32-bit identifier of the request, which will be received back in the 'ChatShared' object. Must be unique within the message
  , KeyboardButtonRequestChat -> Bool
keyboardButtonRequestChatChatIsChannel :: Bool -- ^ Pass 'True' to request a channel chat, pass 'False' to request a group or a supergroup chat. 
  , KeyboardButtonRequestChat -> Maybe Bool
keyboardButtonRequestChatChatIsForum :: Maybe Bool -- ^ Pass 'True' to request a forum supergroup, pass 'False' to request a non-forum chat. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestChat -> Maybe Bool
keyboardButtonRequestChatChatHasUsername :: Maybe Bool -- ^ Pass 'True' to request a supergroup or a channel with a username, pass 'False' to request a chat without a username. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestChat -> Maybe Bool
keyboardButtonRequestChatChatIsCreated :: Maybe Bool -- ^ Pass 'True' to request a chat owned by the user. Otherwise, no additional restrictions are applied.
  , KeyboardButtonRequestChat -> Maybe ChatAdministratorRights
keyboardButtonRequestChatUserAdministratorRights :: Maybe ChatAdministratorRights -- ^ A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of @bot_administrator_rights@. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestChat -> Maybe ChatAdministratorRights
keyboardButtonRequestChatBotAdministratorRights :: Maybe ChatAdministratorRights -- ^ A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of @user_administrator_rights@. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestChat -> Maybe Bool
keyboardButtonRequestChatBotIsMember :: Maybe Bool -- ^ Pass 'True' to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
  }
  deriving (forall x.
Rep KeyboardButtonRequestChat x -> KeyboardButtonRequestChat
forall x.
KeyboardButtonRequestChat -> Rep KeyboardButtonRequestChat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KeyboardButtonRequestChat x -> KeyboardButtonRequestChat
$cfrom :: forall x.
KeyboardButtonRequestChat -> Rep KeyboardButtonRequestChat x
Generic, Int -> KeyboardButtonRequestChat -> ShowS
[KeyboardButtonRequestChat] -> ShowS
KeyboardButtonRequestChat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyboardButtonRequestChat] -> ShowS
$cshowList :: [KeyboardButtonRequestChat] -> ShowS
show :: KeyboardButtonRequestChat -> String
$cshow :: KeyboardButtonRequestChat -> String
showsPrec :: Int -> KeyboardButtonRequestChat -> ShowS
$cshowsPrec :: Int -> KeyboardButtonRequestChat -> ShowS
Show)

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