blob: 2ed124e14daf42e7a5626a967e84977833394089 (
about) (
plain) (
blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
module;
#include <boost/asio/io_context.hpp>
export module routemon:rwgps;
import std;
import :http.client;
import :log;
namespace net = boost::asio;
namespace routemon::rwgps {
export struct route_summary
{
std::int64_t id;
std::int64_t user_id;
std::string url;
std::string name;
std::string description;
};
struct pagination
{
std::size_t record_count;
std::size_t page_count;
std::size_t page_size;
std::optional<std::string> next_page_url;
};
struct get_routes_meta
{
pagination pagination;
};
struct get_routes_response
{
std::vector<route_summary> routes;
get_routes_meta meta;
};
export class client
{
log::logger l_;
http::client hc_;
std::string api_key_;
std::string auth_token_;
auto get_routes_page(std::size_t page) -> get_routes_response;
public:
explicit client(
net::io_context& ioc, log::logger const& l, std::string api_key,
std::string auth_token);
auto get_all_routes() -> std::vector<route_summary>;
};
} // namespace routemon::rwgps
|