{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DataKinds #-}
module Telegram.Bot.API.Payments where
import Data.Aeson
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.Types
import Telegram.Bot.API.MakingRequests
data SendInvoiceRequest = SendInvoiceRequest
{ SendInvoiceRequest -> ChatId
sendInvoiceChatId :: ChatId
, SendInvoiceRequest -> Maybe MessageThreadId
sendInvoiceMessageThreadId :: Maybe MessageThreadId
, SendInvoiceRequest -> Text
sendInvoiceTitle :: Text
, SendInvoiceRequest -> Text
sendInvoiceDescription :: Text
, SendInvoiceRequest -> Text
sendInvoicePayload :: Text
, SendInvoiceRequest -> Text
sendInvoiceProviderToken :: Text
, SendInvoiceRequest -> Text
sendInvoiceCurrency :: Text
, SendInvoiceRequest -> [LabeledPrice]
sendInvoicePrices :: [LabeledPrice]
, SendInvoiceRequest -> Maybe Integer
sendInvoiceMaxTipAmount :: Maybe Integer
, SendInvoiceRequest -> Maybe [Integer]
sendInvoiceequestSuggestedTipAmounts :: Maybe [Integer]
, SendInvoiceRequest -> Maybe Text
sendInvoiceStartParameter :: Maybe Text
, SendInvoiceRequest -> Maybe Text
sendInvoiceProviderData :: Maybe Text
, SendInvoiceRequest -> Maybe Text
sendInvoicePhotoUrl :: Maybe Text
, SendInvoiceRequest -> Maybe Int
sendInvoicePhotoSize :: Maybe Int
, SendInvoiceRequest -> Maybe Int
sendInvoicePhotoWidth :: Maybe Int
, SendInvoiceRequest -> Maybe Int
sendInvoicePhotoHeight :: Maybe Int
, SendInvoiceRequest -> Maybe Bool
sendInvoiceNeedName :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceNeedPhoneNumber :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceNeedEmail :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceNeedShippingAddress :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceSendPhoneNumberToProvider :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceSendEmailToProvider :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceIsFlexible :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceDisableNotification :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceProtectContent :: Maybe Bool
, SendInvoiceRequest -> Maybe MessageId
sendInvoiceReplyToMessageId :: Maybe MessageId
, SendInvoiceRequest -> Maybe Bool
sendInvoiceAllowSendingWithoutReply :: Maybe Bool
, SendInvoiceRequest -> Maybe InlineKeyboardMarkup
sendInvoiceReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving (forall x. Rep SendInvoiceRequest x -> SendInvoiceRequest
forall x. SendInvoiceRequest -> Rep SendInvoiceRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendInvoiceRequest x -> SendInvoiceRequest
$cfrom :: forall x. SendInvoiceRequest -> Rep SendInvoiceRequest x
Generic, Int -> SendInvoiceRequest -> ShowS
[SendInvoiceRequest] -> ShowS
SendInvoiceRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendInvoiceRequest] -> ShowS
$cshowList :: [SendInvoiceRequest] -> ShowS
show :: SendInvoiceRequest -> String
$cshow :: SendInvoiceRequest -> String
showsPrec :: Int -> SendInvoiceRequest -> ShowS
$cshowsPrec :: Int -> SendInvoiceRequest -> ShowS
Show)
instance ToJSON SendInvoiceRequest where toJSON :: SendInvoiceRequest -> 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 SendInvoiceRequest where parseJSON :: Value -> Parser SendInvoiceRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type SendInvoice
= "sendInvoice"
:> ReqBody '[JSON] SendInvoiceRequest
:> Post '[JSON] (Response Message)
sendInvoice :: SendInvoiceRequest -> ClientM (Response Message)
sendInvoice :: SendInvoiceRequest -> ClientM (Response Message)
sendInvoice = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SendInvoice)
data CreateInvoiceLinkRequest = CreateInvoiceLinkRequest
{ CreateInvoiceLinkRequest -> Text
createInvoiceLinkTitle :: Text
, CreateInvoiceLinkRequest -> Text
createInvoiceLinkDescription :: Text
, CreateInvoiceLinkRequest -> Text
createInvoiceLinkPayload :: Text
, CreateInvoiceLinkRequest -> Text
createInvoiceLinkProviderToken :: Text
, CreateInvoiceLinkRequest -> Text
createInvoiceLinkCurrency :: Text
, CreateInvoiceLinkRequest -> [LabeledPrice]
createInvoiceLinkPrices :: [LabeledPrice]
, CreateInvoiceLinkRequest -> Maybe Integer
createInvoiceLinkMaxTipAmount :: Maybe Integer
, CreateInvoiceLinkRequest -> Maybe [Integer]
createInvoiceLinkSuggestedTipAmounts :: Maybe [Integer]
, CreateInvoiceLinkRequest -> Maybe Text
createInvoiceLinkProviderData :: Maybe Text
, CreateInvoiceLinkRequest -> Maybe Text
createInvoiceLinkPhotoUrl :: Maybe Text
, CreateInvoiceLinkRequest -> Maybe Int
createInvoiceLinkPhotoSize :: Maybe Int
, CreateInvoiceLinkRequest -> Maybe Int
createInvoiceLinkPhotoWidth :: Maybe Int
, CreateInvoiceLinkRequest -> Maybe Int
createInvoiceLinkPhotoHeight :: Maybe Int
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkNeedName :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkNeedPhoneNumber :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkNeedEmail :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkNeedShippingAddress :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkSendPhoneNumberToProvider :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkSendEmailToProvider :: Maybe Bool
, CreateInvoiceLinkRequest -> Maybe Bool
createInvoiceLinkIsFlexible :: Maybe Bool
}
deriving (forall x.
Rep CreateInvoiceLinkRequest x -> CreateInvoiceLinkRequest
forall x.
CreateInvoiceLinkRequest -> Rep CreateInvoiceLinkRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInvoiceLinkRequest x -> CreateInvoiceLinkRequest
$cfrom :: forall x.
CreateInvoiceLinkRequest -> Rep CreateInvoiceLinkRequest x
Generic, Int -> CreateInvoiceLinkRequest -> ShowS
[CreateInvoiceLinkRequest] -> ShowS
CreateInvoiceLinkRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInvoiceLinkRequest] -> ShowS
$cshowList :: [CreateInvoiceLinkRequest] -> ShowS
show :: CreateInvoiceLinkRequest -> String
$cshow :: CreateInvoiceLinkRequest -> String
showsPrec :: Int -> CreateInvoiceLinkRequest -> ShowS
$cshowsPrec :: Int -> CreateInvoiceLinkRequest -> ShowS
Show)
instance ToJSON CreateInvoiceLinkRequest where toJSON :: CreateInvoiceLinkRequest -> 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 CreateInvoiceLinkRequest where parseJSON :: Value -> Parser CreateInvoiceLinkRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type CreateInvoiceLink
= "createInvoiceLink"
:> ReqBody '[JSON] CreateInvoiceLinkRequest
:> Post '[JSON] (Response Text)
createInvoiceLink :: CreateInvoiceLinkRequest -> ClientM (Response Text)
createInvoiceLink :: CreateInvoiceLinkRequest -> ClientM (Response Text)
createInvoiceLink = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @CreateInvoiceLink)
data AnswerShippingQueryRequest = AnswerShippingQueryRequest
{ AnswerShippingQueryRequest -> Text
answerShippingQueryShippingQueryId :: Text
, AnswerShippingQueryRequest -> Bool
answerShippingQueryOk :: Bool
, AnswerShippingQueryRequest -> Maybe [ShippingOption]
answerShippingQueryShippingOptions :: Maybe [ShippingOption]
, AnswerShippingQueryRequest -> Maybe Text
answerShippingQueryErrorMessage :: Maybe Text
}
deriving (forall x.
Rep AnswerShippingQueryRequest x -> AnswerShippingQueryRequest
forall x.
AnswerShippingQueryRequest -> Rep AnswerShippingQueryRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnswerShippingQueryRequest x -> AnswerShippingQueryRequest
$cfrom :: forall x.
AnswerShippingQueryRequest -> Rep AnswerShippingQueryRequest x
Generic, Int -> AnswerShippingQueryRequest -> ShowS
[AnswerShippingQueryRequest] -> ShowS
AnswerShippingQueryRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnswerShippingQueryRequest] -> ShowS
$cshowList :: [AnswerShippingQueryRequest] -> ShowS
show :: AnswerShippingQueryRequest -> String
$cshow :: AnswerShippingQueryRequest -> String
showsPrec :: Int -> AnswerShippingQueryRequest -> ShowS
$cshowsPrec :: Int -> AnswerShippingQueryRequest -> ShowS
Show)
instance ToJSON AnswerShippingQueryRequest where toJSON :: AnswerShippingQueryRequest -> 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 AnswerShippingQueryRequest where parseJSON :: Value -> Parser AnswerShippingQueryRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type AnswerShippingQuery
= "answerShippingQuery"
:> ReqBody '[JSON] AnswerShippingQueryRequest
:> Post '[JSON] (Response Bool)
answerShippingQuery :: AnswerShippingQueryRequest -> ClientM (Response Bool)
answerShippingQuery :: AnswerShippingQueryRequest -> ClientM (Response Bool)
answerShippingQuery = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @AnswerShippingQuery)
data AnswerPreCheckoutQueryRequest = AnswerPreCheckoutQueryRequest
{ AnswerPreCheckoutQueryRequest -> Text
answerPreCheckoutQueryPreCheckoutQueryId :: Text
, AnswerPreCheckoutQueryRequest -> Bool
answerPreCheckoutQueryOk :: Bool
, AnswerPreCheckoutQueryRequest -> Maybe Text
answerPreCheckoutQueryErrorMessage :: Maybe Text
}
deriving (forall x.
Rep AnswerPreCheckoutQueryRequest x
-> AnswerPreCheckoutQueryRequest
forall x.
AnswerPreCheckoutQueryRequest
-> Rep AnswerPreCheckoutQueryRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnswerPreCheckoutQueryRequest x
-> AnswerPreCheckoutQueryRequest
$cfrom :: forall x.
AnswerPreCheckoutQueryRequest
-> Rep AnswerPreCheckoutQueryRequest x
Generic, Int -> AnswerPreCheckoutQueryRequest -> ShowS
[AnswerPreCheckoutQueryRequest] -> ShowS
AnswerPreCheckoutQueryRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnswerPreCheckoutQueryRequest] -> ShowS
$cshowList :: [AnswerPreCheckoutQueryRequest] -> ShowS
show :: AnswerPreCheckoutQueryRequest -> String
$cshow :: AnswerPreCheckoutQueryRequest -> String
showsPrec :: Int -> AnswerPreCheckoutQueryRequest -> ShowS
$cshowsPrec :: Int -> AnswerPreCheckoutQueryRequest -> ShowS
Show)
instance ToJSON AnswerPreCheckoutQueryRequest where toJSON :: AnswerPreCheckoutQueryRequest -> 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 AnswerPreCheckoutQueryRequest where parseJSON :: Value -> Parser AnswerPreCheckoutQueryRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type AnswerPreCheckoutQuery
= "answerPreCheckoutQuery"
:> ReqBody '[JSON] AnswerPreCheckoutQueryRequest
:> Post '[JSON] (Response Bool)
answerPreCheckoutQuery :: AnswerPreCheckoutQueryRequest -> ClientM (Response Bool)
answerPreCheckoutQuery :: AnswerPreCheckoutQueryRequest -> ClientM (Response Bool)
answerPreCheckoutQuery = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @AnswerPreCheckoutQuery)