tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
BusinessLocation.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
9 BusinessLocation() = default;
10 explicit BusinessLocation(const nl::json& json) {
11 fromJson(json);
12 }
13
15 std::string address;
16
19
20
23 nl::json toJson() const {
24 nl::json json = nl::json::object();
25 OBJECT_SERIALIZE_FIELD(json, "address", address);
26 OBJECT_SERIALIZE_FIELD_PTR(json, "location", location);
27 return json;
28 }
29
31 void fromJson(const nl::json& json) {
32 OBJECT_DESERIALIZE_FIELD(json, "address", address, "", false);
33 OBJECT_DESERIALIZE_FIELD_PTR(json, "location", location, true);
34 }
35 };
36}
#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
Contains information about the location of a Telegram Business account. https://core....
Ptr< Location > location
Optional. Location of the business.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
BusinessLocation(const nl::json &json)
std::string address
Address of the business.
nl::json toJson() const
Serializes this object to JSON.