tgbotxx 1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
GiveawayCreated.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
8 GiveawayCreated() = default;
9 explicit GiveawayCreated(const nl::json& json) {
11 }
12
14 std::int32_t prizeStarCount{};
15
18 nl::json toJson() const {
19 nl::json json = nl::json::object();
20 OBJECT_SERIALIZE_FIELD(json, "prize_star_count", prizeStarCount);
21 return json;
22 }
24 void fromJson(const nl::json& json) {
25 OBJECT_DESERIALIZE_FIELD(json, "prize_star_count", prizeStarCount, 0, true);
26 }
27 };
28}
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Serialize.
Definition Object.hpp:27
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition Object.hpp:64
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
This object represents a service message about the creation of a scheduled giveaway....
std::int32_t prizeStarCount
Optional. The number of Telegram Stars to be split between giveaway winners.
GiveawayCreated(const nl::json &json)
void fromJson(const nl::json &json)
Deserializes this object from JSON.
nl::json toJson() const
Serializes this object to JSON.