tgbotxx  1.1.6.9
Telegram Bot C++ Library
ChatBoostUpdated.hpp
Go to the documentation of this file.
1 #pragma once
5 
6 namespace tgbotxx {
9  struct ChatBoostUpdated {
10  ChatBoostUpdated() = default;
11  explicit ChatBoostUpdated(const nl::json& json) {
12  fromJson(json);
13  }
14 
17 
20 
21 
24  nl::json toJson() const {
25  nl::json json = nl::json::object();
26  OBJECT_SERIALIZE_FIELD_PTR(json, "chat", chat);
27  OBJECT_SERIALIZE_FIELD_PTR(json, "boost", boost);
28  return json;
29  }
30 
32  void fromJson(const nl::json& json) {
33  OBJECT_DESERIALIZE_FIELD_PTR(json, "chat", chat, false);
34  OBJECT_DESERIALIZE_FIELD_PTR(json, "boost", boost, false);
35  }
36  };
37 }
#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:70
Definition: Api.hpp:14
std::shared_ptr< T > Ptr
Definition: Ptr.hpp:6
This object represents a boost added to a chat or changed. https://core.telegram.org/bots/api#chatboo...
ChatBoostUpdated(const nl::json &json)
Ptr< Chat > chat
Chat which was boosted.
nl::json toJson() const
Serializes this object to JSON.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
Ptr< ChatBoost > boost
Information about the chat boost.