tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
BusinessIntro.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
8 struct BusinessIntro {
9 BusinessIntro() = default;
10 explicit BusinessIntro(const nl::json& json) {
11 fromJson(json);
12 }
13
15 std::string title;
16
18 std::string message;
19
22
23
26 nl::json toJson() const {
27 nl::json json = nl::json::object();
28 OBJECT_SERIALIZE_FIELD(json, "title", title);
29 OBJECT_SERIALIZE_FIELD(json, "message", message);
30 OBJECT_SERIALIZE_FIELD_PTR(json, "sticker", sticker);
31 return json;
32 }
33
35 void fromJson(const nl::json& json) {
36 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
37 OBJECT_DESERIALIZE_FIELD(json, "message", message, "", true);
38 OBJECT_DESERIALIZE_FIELD_PTR(json, "sticker", sticker, true);
39 }
40 };
41}
#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
#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
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
Contains information about the start page settings of a Telegram Business account....
std::string title
Optional. Title text of the business intro.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
BusinessIntro(const nl::json &json)
std::string message
Optional. Message text of the business intro.
Ptr< Sticker > sticker
Optional. Sticker of the business intro.
nl::json toJson() const
Serializes this object to JSON.