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

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

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

-- ** 'KeyboardButtonRequestUser'

-- | This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed.
data KeyboardButtonRequestUser = KeyboardButtonRequestUser
  { KeyboardButtonRequestUser -> RequestId
keyboardButtonRequestUserRequestId :: RequestId -- ^ Signed 32-bit identifier of the request, which will be received back in the 'UserShared' object. Must be unique within the message
  , KeyboardButtonRequestUser -> Maybe Bool
keyboardButtonRequestUserUserIsBot :: Maybe Bool -- ^ Pass 'True' to request a bot, pass 'False' to request a regular user. If not specified, no additional restrictions are applied.
  , KeyboardButtonRequestUser -> Maybe Bool
keyboardButtonRequestUserUserIsPremium :: 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.
  }
  deriving (forall x.
Rep KeyboardButtonRequestUser x -> KeyboardButtonRequestUser
forall x.
KeyboardButtonRequestUser -> Rep KeyboardButtonRequestUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KeyboardButtonRequestUser x -> KeyboardButtonRequestUser
$cfrom :: forall x.
KeyboardButtonRequestUser -> Rep KeyboardButtonRequestUser x
Generic, Int -> KeyboardButtonRequestUser -> ShowS
[KeyboardButtonRequestUser] -> ShowS
KeyboardButtonRequestUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyboardButtonRequestUser] -> ShowS
$cshowList :: [KeyboardButtonRequestUser] -> ShowS
show :: KeyboardButtonRequestUser -> String
$cshow :: KeyboardButtonRequestUser -> String
showsPrec :: Int -> KeyboardButtonRequestUser -> ShowS
$cshowsPrec :: Int -> KeyboardButtonRequestUser -> ShowS
Show)

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