25 nl::json json = nl::json::object();
35 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)
Base class for a gift owned by a user or a chat Can be either OwnedGiftRegular or OwnedGiftUnique.
OwnedGift(const nl::json &json)
std::string type
Type of the gift: "regular" or "unique".
virtual nl::json toJson() const
Serializes this object to JSON.
virtual ~OwnedGift()=default
virtual void fromJson(const nl::json &json)
Deserializes this object from JSON.
Describes a regular gift owned by a user or a chat.
bool wasRefunded
Optional. True, if the gift was refunded and isn't available anymore.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
~OwnedGiftRegular() override=default
Ptr< Gift > gift
Information about the regular gift.
std::vector< Ptr< MessageEntity > > entities
Optional. Special entities that appear in the text.
std::string text
Optional. Text of the message that was added to the gift.
std::int64_t sendDate
Date the gift was sent in Unix time.
bool isSaved
Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf ...
std::int32_t convertStarCount
Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift.
bool canBeUpgraded
Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of busines...
bool isPrivate
Optional. True, if the sender and gift text are shown only to the gift receiver.
std::int32_t prepaidUpgradeStarCount
Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift.
OwnedGiftRegular(const nl::json &json)
std::string ownedGiftId
Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business account...
Ptr< User > senderUser
Optional. Sender of the gift if it is a known user.
nl::json toJson() const override
Serializes this object to JSON.
Describes a unique gift owned by a user or a chat.
~OwnedGiftUnique() override=default
OwnedGiftUnique(const nl::json &json)
Ptr< UniqueGift > gift
Information about the unique gift.
std::int64_t nextTransferDate
Optional. Point in time (Unix timestamp) when the gift can be transferred. If it is in the past,...
std::int64_t sendDate
Date the gift was sent in Unix time.
std::int32_t transferStarCount
Optional. Number of Telegram Stars that must be paid to transfer the gift.
std::string ownedGiftId
Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of busines...
Ptr< User > senderUser
Optional. Sender of the gift if it is a known user.
bool canBeTransferred
Optional. True, if the gift can be transferred to another owner; for gifts received on behalf of busi...
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
bool isSaved
Optional. True, if the gift is displayed on the account's profile page; for gifts received on behalf ...
nl::json toJson() const override
Serializes this object to JSON.