tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
ChecklistTasksAdded.hpp
Go to the documentation of this file.
1#pragma once
5
6namespace tgbotxx {
7
12 explicit ChecklistTasksAdded(const nl::json& json) {
13 fromJson(json);
14 }
15
18
20 std::vector<Ptr<ChecklistTask>> tasks;
21
24 nl::json toJson() const {
25 nl::json json = nl::json::object();
26 OBJECT_SERIALIZE_FIELD_PTR(json, "checklist_message", checklistMessage);
28 return json;
29 }
31 void fromJson(const nl::json& json) {
32 OBJECT_DESERIALIZE_FIELD_PTR(json, "checklist_message", checklistMessage, true);
33 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "tasks", tasks, false);
34 }
35 };
36
37}
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
Definition Object.hpp:22
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
Definition Object.hpp:27
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
Definition Object.hpp:72
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
Definition Object.hpp:89
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
Describes a service message about tasks added to a checklist. https://core.telegram....
std::vector< Ptr< ChecklistTask > > tasks
List of tasks added to the checklist.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
nl::json toJson() const
Serializes this object to JSON.
Ptr< Message > checklistMessage
Optional. Message containing the checklist to which the tasks were added.
ChecklistTasksAdded(const nl::json &json)