2019-09-08 16:42:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "api.h"
|
|
|
|
|
|
|
|
#include <string>
|
2020-01-28 03:49:11 +00:00
|
|
|
#include <map>
|
2019-11-05 19:39:33 +00:00
|
|
|
#include <utility>
|
2019-09-08 16:42:10 +00:00
|
|
|
|
2019-10-03 22:43:39 +00:00
|
|
|
class Okapi : public Api {
|
2019-09-08 16:42:10 +00:00
|
|
|
private:
|
|
|
|
std::string url;
|
|
|
|
std::string key;
|
|
|
|
|
2020-01-25 15:49:32 +00:00
|
|
|
std::string service;
|
|
|
|
|
2019-09-08 16:42:10 +00:00
|
|
|
static size_t write_cb(char* ptr, size_t size, size_t nmemb, void* userdata);
|
|
|
|
std::string curl_post(std::string url, std::string post);
|
|
|
|
std::string get_user_caches_json(std::string uuid, int count = 0, int offset = 0);
|
|
|
|
// std::string get_cache_json(std::string code);
|
|
|
|
std::string get_caches_json(std::string codes);
|
|
|
|
|
|
|
|
public:
|
2020-01-25 15:49:32 +00:00
|
|
|
Okapi(std::string server_url, std::string consumer_key);
|
2019-09-08 16:42:10 +00:00
|
|
|
|
|
|
|
// Cache get_cache(std::string code);
|
2020-01-28 03:49:11 +00:00
|
|
|
Caches get_caches(std::map<std::string, std::tm> codes);
|
2019-09-08 16:42:10 +00:00
|
|
|
Caches get_user_caches(std::string uuid, int count = 0);
|
2019-09-30 23:49:25 +00:00
|
|
|
std::string get_changelog_json(int revision);
|
2019-09-08 16:42:10 +00:00
|
|
|
|
|
|
|
std::string get_uuid(std::string username);
|
2020-01-04 18:24:00 +00:00
|
|
|
std::string get_profile_url(std::string uuid);
|
2019-09-08 16:42:10 +00:00
|
|
|
};
|