tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
ChatBackground.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
6
10 ChatBackground() = default;
11 explicit ChatBackground(const nl::json& json) {
12 fromJson(json);
13 }
14
17
18 nl::json toJson() const {
19 nl::json json = nl::json::object();
20 OBJECT_SERIALIZE_FIELD_PTR(json, "type", type);
21 return json;
22 }
23
24 void fromJson(const nl::json& json) {
25 OBJECT_DESERIALIZE_FIELD_PTR(json, "type", type, false);
26 }
27 };
28
29}
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
Definition Object.hpp:22
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
Definition Object.hpp:72
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
This object represents a chat background. https://core.telegram.org/bots/api#chatbackground.
ChatBackground(const nl::json &json)
Ptr< BackgroundType > type
Type of the background.
void fromJson(const nl::json &json)