tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
BusinessMessagesDeleted.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
6
11 explicit BusinessMessagesDeleted(const nl::json& json) {
12 fromJson(json);
13 }
14
17
21
23 std::vector<std::int32_t> messageIds;
24
27 nl::json toJson() const {
28 nl::json json = nl::json::object();
29 OBJECT_SERIALIZE_FIELD(json, "business_connection_id", businessConnectionId);
30 OBJECT_SERIALIZE_FIELD_PTR(json, "chat", chat);
31 OBJECT_SERIALIZE_FIELD(json, "message_ids", messageIds);
32 return json;
33 }
34
36 void fromJson(const nl::json& json) {
37 OBJECT_DESERIALIZE_FIELD(json, "business_connection_id", businessConnectionId, "", false);
38 OBJECT_DESERIALIZE_FIELD_PTR(json, "chat", chat, false);
39 OBJECT_DESERIALIZE_FIELD(json, "message_ids", messageIds, {}, false);
40 }
41 };
42
43}
#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
This object is received when messages are deleted from a connected business account....
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::string businessConnectionId
Unique identifier of the business connection.
nl::json toJson() const
Serializes this object to JSON.
std::vector< std::int32_t > messageIds
The list of identifiers of deleted messages in the chat of the business account.
Ptr< Chat > chat
Information about a chat in the business account. The bot may not have access to the chat or the corr...