aboutsummaryrefslogtreecommitdiff
path: root/oop2eindopdr/PokemonTCGAPIClient.h
blob: c6b6a231ccc8f6dff0ce8bea8dd4f47951f4d1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <nlohmann/json.hpp>
#include <cpr/cpr.h>

#include "PokemonCard.h"

/** @brief direct api access class */
class PokemonTCGAPIClient {
public:
	PokemonTCGAPIClient();
	virtual ~PokemonTCGAPIClient();

private:
	const char* API_URL = "https://api.pokemontcg.io/v2";
	virtual nlohmann::json raw_request(const char* endpoint, cpr::Parameters params);
	virtual nlohmann::json raw_get_cards(const char* query);
	virtual nlohmann::json raw_get_card(const char* id);
	virtual nlohmann::json raw_get_sets(const char* query);

public:
	virtual std::vector<PokemonCard*> get_set_cards(const char* set_name);
	virtual PokemonCard* get_full_card(const char* id);
	virtual std::vector<std::string> get_sets();
};