tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
ChecklistTasksDone.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
9 ChecklistTasksDone() = default;
10 explicit ChecklistTasksDone(const nl::json& json) {
11 fromJson(json);
12 }
13
17
19 std::vector<std::int32_t> markedAsDoneTaskIds;
20
22 std::vector<std::int32_t> markedAsNotDoneTaskIds;
23
26 nl::json toJson() const {
27 nl::json json = nl::json::object();
28 OBJECT_SERIALIZE_FIELD_PTR(json, "checklist_message", checklistMessage);
29 OBJECT_SERIALIZE_FIELD(json, "marked_as_done_task_ids", markedAsDoneTaskIds);
30 OBJECT_SERIALIZE_FIELD(json, "marked_as_not_done_task_ids", markedAsNotDoneTaskIds);
31 return json;
32 }
34 void fromJson(const nl::json& json) {
35 OBJECT_DESERIALIZE_FIELD_PTR(json, "checklist_message", checklistMessage, true);
36 OBJECT_DESERIALIZE_FIELD(json, "marked_as_done_task_ids", markedAsDoneTaskIds, {}, true);
37 OBJECT_DESERIALIZE_FIELD(json, "marked_as_not_done_task_ids", markedAsNotDoneTaskIds, {}, true);
38 }
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
Describes a service message about checklist tasks marked as done or not done. https://core....
std::vector< std::int32_t > markedAsDoneTaskIds
Optional. Identifiers of the tasks that were marked as done.
nl::json toJson() const
Serializes this object to JSON.
std::vector< std::int32_t > markedAsNotDoneTaskIds
Optional. Identifiers of the tasks that were marked as not done.
Ptr< Message > checklistMessage
Optional. Message containing the checklist whose tasks were marked as done or not done....
ChecklistTasksDone(const nl::json &json)
void fromJson(const nl::json &json)
Deserializes this object from JSON.