tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
SuggestedPostDeclined.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
10 explicit SuggestedPostDeclined(const nl::json& json) {
11 fromJson(json);
12 }
13
16
18 std::string comment;
19
20
23 nl::json toJson() const {
24 nl::json json = nl::json::object();
25 OBJECT_SERIALIZE_FIELD_PTR(json, "suggested_post_message", suggestedPostMessage);
26 OBJECT_SERIALIZE_FIELD(json, "comment", comment);
27 return json;
28 }
30 void fromJson(const nl::json& json) {
31 OBJECT_DESERIALIZE_FIELD_PTR(json, "suggested_post_message", suggestedPostMessage, true);
32 OBJECT_DESERIALIZE_FIELD(json, "comment", comment, "", true);
33 }
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
Describes a service message about the rejection of a suggested post. https://core....
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::string comment
Optional. Comment with which the post was declined.
SuggestedPostDeclined(const nl::json &json)
Ptr< Message > suggestedPostMessage
Optional. Message containing the suggested post.
nl::json toJson() const
Serializes this object to JSON.
SuggestedPostDeclined()=default