28 nl::json json = nl::json::object();
40 void _fromJson(
const nl::json& json) {
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
Describes a transaction with an affiliate program.
nl::json toJson() const override
Serializes this object to JSON.
TransactionPartnerAffiliateProgram()
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
TransactionPartnerAffiliateProgram(const nl::json &json)
Ptr< User > sponsorUser
Optional. Information about the bot sponsoring the affiliate program.
std::int32_t commissionPerMille
Number of Telegram Stars received per 1000 Stars of referred users.
Describes a transaction with a chat.
Ptr< Chat > chat
Information about the chat.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
Ptr< Gift > gift
Optional. Gift sent to the chat by the bot.
TransactionPartnerChat(const nl::json &json)
nl::json toJson() const override
Serializes this object to JSON.
Describes a withdrawal transaction with Fragment.
TransactionPartnerFragment()
TransactionPartnerFragment(const nl::json &json)
Ptr< RevenueWithdrawalState > withdrawalState
Optional. State of the withdrawal if transaction is outgoing.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
nl::json toJson() const override
Serializes this object to JSON.
Base class for all transaction partners https://core.telegram.org/bots/api#transactionpartner.
virtual void fromJson(const nl::json &json)
Deserializes this object from JSON.
TransactionPartner()=default
virtual nl::json toJson() const
Serializes this object to JSON.
TransactionPartner(const nl::json &json)
std::string type
Type of the transaction partner.
virtual ~TransactionPartner()=default
Describes a transaction with an unknown source or recipient.
TransactionPartnerOther()
TransactionPartnerOther(const nl::json &json)
Describes a withdrawal transaction to Telegram Ads platform.
TransactionPartnerTelegramAds(const nl::json &json)
TransactionPartnerTelegramAds()
Describes a transaction for paid broadcasting (Telegram API).
nl::json toJson() const override
Serializes this object to JSON.
TransactionPartnerTelegramApi(const nl::json &json)
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
TransactionPartnerTelegramApi()
std::int32_t requestCount
Number of successful requests exceeding regular limits that were billed.
Describes a transaction with a user.
Ptr< User > user
Information about the user.
std::string paidMediaPayload
Optional. Bot-specified paid media payload.
TransactionPartnerUser(const nl::json &json)
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
std::string invoicePayload
Optional. Bot-specified invoice payload.
std::string transactionType
Type of the transaction, e.g., "invoice_payment", "paid_media_payment", etc.
std::vector< Ptr< PaidMedia > > paidMedia
Optional. Information about the paid media bought by the user.
Ptr< AffiliateInfo > affiliate
Optional. Affiliate that received a commission via this transaction.
std::int32_t premiumSubscriptionDuration
Optional. Number of months for gifted Telegram Premium subscription.
Ptr< Gift > gift
Optional. Gift sent to the user by the bot.
std::int32_t subscriptionPeriod
Optional. Duration of paid subscription.
nl::json toJson() const override
Serializes this object to JSON.