tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
SuggestedPostRefunded.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace tgbotxx {
10 explicit SuggestedPostRefunded(const nl::json& json) {
11 fromJson(json);
12 }
13
17
21 std::string reason;
22
25 nl::json toJson() const {
26 nl::json json = nl::json::object();
27 OBJECT_SERIALIZE_FIELD_PTR(json, "suggested_post_message", suggestedPostMessage);
28 OBJECT_SERIALIZE_FIELD(json, "reason", reason);
29 return json;
30 }
32 void fromJson(const nl::json& json) {
33 OBJECT_DESERIALIZE_FIELD_PTR(json, "suggested_post_message", suggestedPostMessage, true);
34 OBJECT_DESERIALIZE_FIELD(json, "reason", reason, "", false);
35 }
36 };
37
38}
#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 a payment refund for a suggested post. https://core....
SuggestedPostRefunded(const nl::json &json)
void fromJson(const nl::json &json)
Deserializes this object from JSON.
SuggestedPostRefunded()=default
Ptr< Message > suggestedPostMessage
Optional. Message containing the suggested post. Note that the Message object in this field will not ...
nl::json toJson() const
Serializes this object to JSON.
std::string reason
Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of be...