Horizon
github_client.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "http_client.hpp"
4 
5 namespace horizon {
6 using json = nlohmann::json;
7 class GitHubClient {
8 public:
9  GitHubClient();
10  json login(const std::string &user, const std::string &passwd);
11  json get_repo(const std::string &owner, const std::string &repo);
12  json create_fork(const std::string &owner, const std::string &repo);
13  json create_pull_request(const std::string &owner, const std::string &repo, const std::string &title,
14  const std::string &branch, const std::string &base, const std::string &body);
15  json get_pull_requests(const std::string &owner, const std::string &repo);
16 
17  HTTP::RESTClient client;
18 
19 private:
20  std::string login_user;
21 };
22 } // namespace horizon
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:161
horizon::GitHubClient
Definition: github_client.hpp:7
HTTP::RESTClient
Definition: http_client.hpp:43