coyote/models.h

44 lines
973 B
C++

#pragma once
#include <string>
#include <vector>
#include <nlohmann/json_fwd.hpp>
#include "blankie/serializer.h"
enum PostSortingMethod {
Posts = 0,
PostsAndReplies,
Media,
};
struct Emoji {
std::string shortcode;
std::string url;
};
struct AccountField {
std::string name;
blankie::html::HTMLString value_html;
time_t verified_at; // negative is not verified
};
struct Account {
std::string id;
std::string username;
std::string domain_name;
std::string display_name;
time_t created_at;
blankie::html::HTMLString note_html;
std::string avatar;
std::string header;
uint64_t followers_count;
uint64_t following_count;
uint64_t statuses_count;
std::vector<Emoji> emojis;
std::vector<AccountField> fields;
};
void from_json(const nlohmann::json& j, Emoji& emoji);
void from_json(const nlohmann::json& j, AccountField& field);
void from_json(const nlohmann::json& j, Account& account);