{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SendContact where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import Data.Text
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.MakingRequests
import Telegram.Bot.API.Types
import Telegram.Bot.API.Internal.TH
data SendContactRequest = SendContactRequest
{ SendContactRequest -> SomeChatId
sendContactChatId :: SomeChatId
, SendContactRequest -> Maybe MessageThreadId
sendContactMessageThreadId :: Maybe MessageThreadId
, SendContactRequest -> Text
sendContactPhoneNumber :: Text
, SendContactRequest -> Text
sendContactFirstName :: Text
, SendContactRequest -> Text
sendContactLastName :: Text
, SendContactRequest -> Text
sendContactVcard :: Text
, SendContactRequest -> Maybe Bool
sendContactDisableNotification :: Maybe Bool
, SendContactRequest -> Maybe Bool
sendContactProtectContent :: Maybe Bool
, SendContactRequest -> Maybe MessageId
sendContactReplyToMessageId :: Maybe MessageId
, SendContactRequest -> Maybe Bool
sendContactAllowSendingWithoutReply :: Maybe Bool
, SendContactRequest -> Maybe InlineKeyboardMarkup
sendContactReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving forall x. Rep SendContactRequest x -> SendContactRequest
forall x. SendContactRequest -> Rep SendContactRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendContactRequest x -> SendContactRequest
$cfrom :: forall x. SendContactRequest -> Rep SendContactRequest x
Generic
instance ToJSON SendContactRequest where toJSON :: SendContactRequest -> 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 SendContactRequest where parseJSON :: Value -> Parser SendContactRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type SendContact = "sendContact"
:> ReqBody '[JSON] SendContactRequest
:> Post '[JSON] (Response Message)
sendContact :: SendContactRequest -> ClientM (Response Message)
sendContact :: SendContactRequest -> ClientM (Response Message)
sendContact = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SendContact)
makeDefault ''SendContactRequest