tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
UniqueGiftBackdropColors.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
10 explicit UniqueGiftBackdropColors(const nl::json& json) {
11 fromJson(json);
12 }
13
15 std::int32_t centerColor{};
16
18 std::int32_t edgeColor{};
19
21 std::int32_t symbolColor{};
22
24 std::int32_t textColor{};
25
27 nl::json toJson() const {
28 nl::json json = nl::json::object();
29 OBJECT_SERIALIZE_FIELD(json, "center_color", centerColor);
30 OBJECT_SERIALIZE_FIELD(json, "edge_color", edgeColor);
31 OBJECT_SERIALIZE_FIELD(json, "symbol_color", symbolColor);
32 OBJECT_SERIALIZE_FIELD(json, "text_color", textColor);
33 return json;
34 }
35
37 void fromJson(const nl::json& json) {
38 OBJECT_DESERIALIZE_FIELD(json, "center_color", centerColor, 0, false);
39 OBJECT_DESERIALIZE_FIELD(json, "edge_color", edgeColor, 0, false);
40 OBJECT_DESERIALIZE_FIELD(json, "symbol_color", symbolColor, 0, false);
41 OBJECT_DESERIALIZE_FIELD(json, "text_color", textColor, 0, false);
42 }
43 };
44
45}
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
Definition Object.hpp:19
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition Object.hpp:46
This object describes the colors of the backdrop of a unique gift. https://core.telegram....
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::int32_t centerColor
The color in the center of the backdrop in RGB format.
std::int32_t textColor
The color for the text on the backdrop in RGB format.
nl::json toJson() const
Serializes this object to JSON.
std::int32_t edgeColor
The color on the edges of the backdrop in RGB format.
std::int32_t symbolColor
The color to be applied to the symbol in RGB format.