#pragma once #include #include #include #include #include struct Images { std::optional original; std::vector 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 cover_images; Images profile_pictures; std::vector> links; }; struct Tag { std::string japanese; std::optional romaji; std::optional english; }; struct Illust { std::string username; std::string display_name; uint64_t user_id; Images user_profile_pictures; uint64_t illust_id; std::string title; bool ai_generated; time_t upload_time; std::optional comment_html; std::vector tags; std::vector images; }; void from_json(const nlohmann::json& j, User& user); void from_json(const nlohmann::json& j, Tag& tag); void from_json(const nlohmann::json& j, Illust& illust);