pixwhile/pixivmodels.h

29 lines
610 B
C
Raw Normal View History

#pragma once
#include <string>
#include <vector>
#include <optional>
#include <utility>
#include <nlohmann/json.hpp>
struct Images {
std::optional<std::string> original;
std::vector<std::string> thumbnails;
const std::string& original_or_thumbnail() const;
const std::string& thumbnail_or_original() const;
};
struct User {
std::string username;
std::string display_name;
uint64_t user_id;
std::optional<Images> cover_images;
Images profile_pictures;
std::vector<std::pair<std::string, std::string>> links;
};
void from_json(const nlohmann::json& j, User& user);