tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
BusinessOpeningHoursInterval.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
9 explicit BusinessOpeningHoursInterval(const nl::json& json) {
10 fromJson(json);
11 }
12
14 std::int32_t openingMinute{};
15
17 std::int32_t closingMinute{};
18
21 nl::json toJson() const {
22 nl::json json = nl::json::object();
23 OBJECT_SERIALIZE_FIELD(json, "opening_minute", openingMinute);
24 OBJECT_SERIALIZE_FIELD(json, "closing_minute", closingMinute);
25 return json;
26 }
27
29 void fromJson(const nl::json& json) {
30 OBJECT_DESERIALIZE_FIELD(json, "opening_minute", openingMinute, 0, false);
31 OBJECT_DESERIALIZE_FIELD(json, "closing_minute", closingMinute, 0, false);
32 }
33 };
34}
#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
Describes an interval of time during which a business is open. https://core.telegram....
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::int32_t openingMinute
The minute's sequence number in a week, starting on Monday, marking the start of the time interval du...
std::int32_t closingMinute
The minute's sequence number in a week, starting on Monday, marking the end of the time interval duri...
nl::json toJson() const
Serializes this object to JSON.