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

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

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

-- ** 'KeyboardButtonRequestUsers'

-- | This object defines the criteria used to request suitable users. 
-- The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.
-- [More about requesting users »](https://core.telegram.org/bots/features#chat-and-user-selection)
data KeyboardButtonRequestUsers = KeyboardButtonRequestUsers
  { KeyboardButtonRequestUsers -> RequestId
keyboardButtonRequestUsersRequestId :: RequestId -- ^ Signed 32-bit identifier of the request, which will be received back in the 'UserShared' object. Must be unique within the message
  , KeyboardButtonRequestUsers -> Maybe Bool
keyboardButtonRequestUsersUserIsBot :: Maybe Bool -- ^ Pass 'True' to request a bot, pass 'False' to request a regular user. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestUsers -> Maybe Bool
keyboardButtonRequestUsersUserIsPremium :: Maybe Bool -- ^ Pass 'True' to request a premium user, pass 'False' to request a non-premium user. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestUsers -> Maybe Int
keyboardButtonRequestUsersMaxQuantity :: Maybe Int -- ^ The maximum number of users to be selected; 1-10. Defaults to 1.
  , KeyboardButtonRequestUsers -> Maybe Bool
keyboardButtonRequestUsersRequestName :: Maybe Bool -- ^ Pass 'True' to request the users' first and last names.
  , KeyboardButtonRequestUsers -> Maybe Bool
keyboardButtonRequestUsersRequestUsername :: Maybe Bool -- ^ Pass 'True' to request the users' usernames.
  , KeyboardButtonRequestUsers -> Maybe Bool
keyboardButtonRequestUsersRequestPhoto :: Maybe Bool -- ^ Pass 'True' to request the users' photos.
  }
  deriving ((forall x.
 KeyboardButtonRequestUsers -> Rep KeyboardButtonRequestUsers x)
-> (forall x.
    Rep KeyboardButtonRequestUsers x -> KeyboardButtonRequestUsers)
-> Generic KeyboardButtonRequestUsers
forall x.
Rep KeyboardButtonRequestUsers x -> KeyboardButtonRequestUsers
forall x.
KeyboardButtonRequestUsers -> Rep KeyboardButtonRequestUsers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
KeyboardButtonRequestUsers -> Rep KeyboardButtonRequestUsers x
from :: forall x.
KeyboardButtonRequestUsers -> Rep KeyboardButtonRequestUsers x
$cto :: forall x.
Rep KeyboardButtonRequestUsers x -> KeyboardButtonRequestUsers
to :: forall x.
Rep KeyboardButtonRequestUsers x -> KeyboardButtonRequestUsers
Generic, Int -> KeyboardButtonRequestUsers -> ShowS
[KeyboardButtonRequestUsers] -> ShowS
KeyboardButtonRequestUsers -> String
(Int -> KeyboardButtonRequestUsers -> ShowS)
-> (KeyboardButtonRequestUsers -> String)
-> ([KeyboardButtonRequestUsers] -> ShowS)
-> Show KeyboardButtonRequestUsers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> KeyboardButtonRequestUsers -> ShowS
showsPrec :: Int -> KeyboardButtonRequestUsers -> ShowS
$cshow :: KeyboardButtonRequestUsers -> String
show :: KeyboardButtonRequestUsers -> String
$cshowList :: [KeyboardButtonRequestUsers] -> ShowS
showList :: [KeyboardButtonRequestUsers] -> ShowS
Show)

instance ToJSON   KeyboardButtonRequestUsers where toJSON :: KeyboardButtonRequestUsers -> Value
toJSON = KeyboardButtonRequestUsers -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON KeyboardButtonRequestUsers where parseJSON :: Value -> Parser KeyboardButtonRequestUsers
parseJSON = Value -> Parser KeyboardButtonRequestUsers
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON