tgbotxx  1.1.6.9
Telegram Bot C++ Library
UserProfilePhotos.hpp
Go to the documentation of this file.
1 #pragma once
4 
5 namespace tgbotxx {
9  UserProfilePhotos() = default;
10  explicit UserProfilePhotos(const nl::json& json) {
11  fromJson(json);
12  }
13 
15  std::int32_t totalCount{};
16 
18  std::vector<std::vector<Ptr<PhotoSize>>> photos;
19 
20 
23  nl::json toJson() const {
24  nl::json json = nl::json::object();
25  OBJECT_SERIALIZE_FIELD(json, "total_count", totalCount);
27  return json;
28  }
29 
31  void fromJson(const nl::json& json) {
32  OBJECT_DESERIALIZE_FIELD(json, "total_count", totalCount, 0, false);
33  OBJECT_DESERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, "photos", photos, false);
34  }
35  };
36 }
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
Definition: Object.hpp:19
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, json_field, array_array_field)
Definition: Object.hpp:32
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY_ARRAY(json, json_field, array_array_field, optional)
Definition: Object.hpp:108
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition: Object.hpp:44
Definition: Api.hpp:14
This object represent a user's profile pictures. https://core.telegram.org/bots/api#userprofilephotos...
std::vector< std::vector< Ptr< PhotoSize > > > photos
Requested profile pictures (in up to 4 sizes each)
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::int32_t totalCount
Total number of profile pictures the target user has.
UserProfilePhotos(const nl::json &json)
nl::json toJson() const
Serializes this object to JSON.