{-# 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
sendInvoiceRequestChatId :: ChatId
, SendInvoiceRequest -> Text
sendInvoiceRequestTitle :: Text
, SendInvoiceRequest -> Text
sendInvoiceRequestDescription :: Text
, SendInvoiceRequest -> Text
sendInvoiceRequestPayload :: Text
, SendInvoiceRequest -> Text
sendInvoiceRequestProviderToken :: Text
, SendInvoiceRequest -> Text
sendInvoiceRequestCurrency :: Text
, SendInvoiceRequest -> [LabeledPrice]
sendInvoiceRequestPrices :: [LabeledPrice]
, SendInvoiceRequest -> Maybe Integer
sendInvoiceRequestMaxTipAmount :: Maybe Integer
, SendInvoiceRequest -> Maybe [Integer]
sendInvoiceRequestSuggestedTipAmounts :: Maybe [Integer]
, SendInvoiceRequest -> Maybe Text
sendInvoiceRequestStartParameter :: Maybe Text
, SendInvoiceRequest -> Maybe Text
sendInvoiceRequestProviderData :: Maybe Text
, SendInvoiceRequest -> Maybe Text
sendInvoiceRequestPhotoUrl :: Maybe Text
, SendInvoiceRequest -> Maybe Int
sendInvoiceRequestPhotoSize :: Maybe Int
, SendInvoiceRequest -> Maybe Int
sendInvoiceRequestPhotoWidth :: Maybe Int
, SendInvoiceRequest -> Maybe Int
sendInvoiceRequestPhotoHeight :: Maybe Int
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestNeedName :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestNeedPhoneNumber :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestNeedEmail :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestNeedShippingAddress :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestSendPhoneNumberToProvider :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestSendEmailToProvider :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestIsFlexible :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestDisableNotification :: Maybe Bool
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestProtectContent :: Maybe Bool
, SendInvoiceRequest -> Maybe MessageId
sendInvoiceRequestReplyToMessageId :: Maybe MessageId
, SendInvoiceRequest -> Maybe Bool
sendInvoiceRequestAllowSendingWithoutReply :: Maybe Bool
, SendInvoiceRequest -> Maybe InlineKeyboardMarkup
sendInvoiceRequestReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving ((forall x. SendInvoiceRequest -> Rep SendInvoiceRequest x)
-> (forall x. Rep SendInvoiceRequest x -> SendInvoiceRequest)
-> Generic SendInvoiceRequest
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
(Int -> SendInvoiceRequest -> ShowS)
-> (SendInvoiceRequest -> String)
-> ([SendInvoiceRequest] -> ShowS)
-> Show SendInvoiceRequest
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 = SendInvoiceRequest -> Value
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 = Value -> Parser SendInvoiceRequest
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 = Proxy SendInvoice -> Client ClientM SendInvoice
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (Proxy SendInvoice
forall k (t :: k). Proxy t
Proxy @SendInvoice)
data AnswerShippingQueryRequest = AnswerShippingQueryRequest
{ AnswerShippingQueryRequest -> Text
answerShippingQueryRequestShippingQueryId :: Text
, AnswerShippingQueryRequest -> Bool
answerShippingQueryRequestOk :: Bool
, AnswerShippingQueryRequest -> Maybe [ShippingOption]
answerShippingQueryRequestShippingOptions :: Maybe [ShippingOption]
, AnswerShippingQueryRequest -> Maybe Text
answerShippingQueryRequestErrorMessage :: Maybe Text
}
deriving ((forall x.
AnswerShippingQueryRequest -> Rep AnswerShippingQueryRequest x)
-> (forall x.
Rep AnswerShippingQueryRequest x -> AnswerShippingQueryRequest)
-> Generic AnswerShippingQueryRequest
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
(Int -> AnswerShippingQueryRequest -> ShowS)
-> (AnswerShippingQueryRequest -> String)
-> ([AnswerShippingQueryRequest] -> ShowS)
-> Show AnswerShippingQueryRequest
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 = AnswerShippingQueryRequest -> Value
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 = Value -> Parser AnswerShippingQueryRequest
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 = Proxy AnswerShippingQuery -> Client ClientM AnswerShippingQuery
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (Proxy AnswerShippingQuery
forall k (t :: k). Proxy t
Proxy @AnswerShippingQuery)
data AnswerPreCheckoutQueryRequest = AnswerPreCheckoutQueryRequest
{ AnswerPreCheckoutQueryRequest -> Text
answerPreCheckoutQueryRequestPreCheckoutQueryId :: Text
, AnswerPreCheckoutQueryRequest -> Bool
answerPreCheckoutQueryRequestOk :: Bool
, AnswerPreCheckoutQueryRequest -> Maybe Text
answerPreCheckoutQueryRequestErrorMessage :: Maybe Text
}
deriving ((forall x.
AnswerPreCheckoutQueryRequest
-> Rep AnswerPreCheckoutQueryRequest x)
-> (forall x.
Rep AnswerPreCheckoutQueryRequest x
-> AnswerPreCheckoutQueryRequest)
-> Generic AnswerPreCheckoutQueryRequest
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
(Int -> AnswerPreCheckoutQueryRequest -> ShowS)
-> (AnswerPreCheckoutQueryRequest -> String)
-> ([AnswerPreCheckoutQueryRequest] -> ShowS)
-> Show AnswerPreCheckoutQueryRequest
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 = AnswerPreCheckoutQueryRequest -> Value
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 = Value -> Parser AnswerPreCheckoutQueryRequest
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 = Proxy AnswerPreCheckoutQuery
-> Client ClientM AnswerPreCheckoutQuery
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (Proxy AnswerPreCheckoutQuery
forall k (t :: k). Proxy t
Proxy @AnswerPreCheckoutQuery)