cpp Rest API master
C++ library for REST API access with Qt, Curl and cpp-httplib backends
 
Loading...
Searching...
No Matches
request.hpp
Go to the documentation of this file.
1
2#ifndef REQUEST_HPP
3#define REQUEST_HPP
4
5#include <memory>
6#include <string>
7
9#include "cpp_restapi_export.h"
10
11
12namespace cpp_restapi::GitHub
13{
26 class CPP_RESTAPI_EXPORT Request
27 {
28 public:
29 Request(std::shared_ptr<cpp_restapi::IConnection>);
30 Request(const Request &) = delete;
32
33 Request& operator=(const Request &) = delete;
34
42 std::string getUserInfo(const std::string& user);
43
52 std::string getReleases(const std::string& user, const std::string& repo);
53
63 std::string getRelease(const std::string& user, const std::string& repo, int id);
64
71 std::string getRateLimit();
72
80 std::string listUserRepo(const std::string& user);
81
82 // --------------- user info related api
83
89 std::string getAuthenticatedUser();
90
94 [[deprecated("Use getAuthenticatedUser() instead")]]
95 std::string getAuntenticatedUser();
96
104 std::string listUsers();
105
113 std::string getUser(const std::string& username);
114
115 // issues related api methods
124 std::string issues();
125
133 std::string orgIssues(const std::string& org);
134
142 std::string listRepoIssues(const std::string& owner, const std::string& repo);
143
152 std::string getIssue(const std::string& owner, const std::string& repo, const std::string& issueNumber);
153
154 // pull request related api methods
162 std::string listPullRequest(const std::string& owner, const std::string& repo);
163
172 std::string getPullRequest(const std::string& owner, const std::string& repo, const std::string& pullNumber);
173
182 std::string listPullRequestCommit(const std::string& owner, const std::string& repo, const std::string& pullNumber);
183
194 std::string listPullRequestfiles(const std::string& owner, const std::string& repo, const std::string& pullNumber);
195
204 std::string isPRmerged(const std::string& owner, const std::string& repo, const std::string& pullNumber);
205
206 // commits related api methods
216 std::string listCommits(const std::string& owner, const std::string& repo);
217
227 std::string listBranchHeadCommit(const std::string& owner, const std::string& repo,const std::string& commitSha);
228
237 std::string listCommitPullRequest(const std::string& owner, const std::string& repo, const std::string& commitSha);
238
249 std::string getCommits(const std::string& owner, const std::string& repo, const std::string& reference);
250
251 // metrics related api methods
260 std::string getWeeklyCommit(const std::string& owner, const std::string& repo);
261
270 std::string getLastYearCommit(const std::string& owner, const std::string& repo);
271
285 std::string getcontributorsActivity(const std::string& owner, const std::string& repo);
286
297 std::string getCommitCount(const std::string& owner, const std::string& repo);
298
309 std::string getHourlyCommitCount(const std::string& owner, const std::string& repo);
310
322 std::string getCommunityProfileMetrics(const std::string& owner, const std::string& repo);
323
334 std::string getRepoClones(const std::string& owner, const std::string& repo);
335
344 std::string getRefferalPaths(const std::string& owner, const std::string& repo);
345
353 std::string getTopreferralSource(const std::string& owner, const std::string& repo);
354
363 std::string getPageViews(const std::string& owner, const std::string& repo);
364
365 // event related apis
374 std::string listNetworkRepoEvent(const std::string& owner, const std::string& repo);
375
382 std::string listOrgEvent(const std::string& org);
383
391 std::string listRepoEvent(const std::string& owner, const std::string& repo);
392
400 std::string listUserEvent(const std::string& username);
401
402 // staring related api methods
403
411 std::string listStargazers(const std::string& owner, const std::string& repo);
412
419 std::string listUserStarredRepo(const std::string& username);
420
421 // watching related api
422
430 std::string listRepoWatchers(const std::string& owner, const std::string& repo);
431
439 std::string getRepoSubscription(const std::string& owner, const std::string& repo);
440
447 std::string listUserWatchedRepos(const std::string& username);
448
460 std::string listRepoCollaborators(const std::string& owner, const std::string& repo);
461
468 std::string getOrgRepo(const std::string& org);
469
480 std::string getRepository(const std::string& owner, const std::string& repo);
481
489 std::string listAuthUserRepo();
490
500 std::string getRepoLang(const std::string& owner, const std::string& repo);
501
511 std::string repoContributors(const std::string& owner, const std::string& repo);
512
513 private:
514 std::shared_ptr<cpp_restapi::IConnection> m_connection;
515
516 std::string doRequest(const std::string &);
517 };
518}
519
520#endif // REQUEST_H
GitHub api actions.
Definition request.hpp:27
std::string listCommitPullRequest(const std::string &owner, const std::string &repo, const std::string &commitSha)
List pull requests associated with a commit.
std::string getcontributorsActivity(const std::string &owner, const std::string &repo)
Get all contributor commit activity.
std::string getRepoLang(const std::string &owner, const std::string &repo)
List repository languages.
std::string getRateLimit()
Request api limits.
std::string getRefferalPaths(const std::string &owner, const std::string &repo)
Get top referral paths.
std::string getUser(const std::string &username)
Provides publicly available information about someone with a GitHub account.
std::string getRepoClones(const std::string &owner, const std::string &repo)
Get repository clones.
std::string listRepoIssues(const std::string &owner, const std::string &repo)
List issues in a repository.
std::string listUserEvent(const std::string &username)
List events for the authenticated user.
std::string getOrgRepo(const std::string &org)
List organization repositories.
Request(const Request &)=delete
std::string listPullRequest(const std::string &owner, const std::string &repo)
List pull request in a repository.
std::string getWeeklyCommit(const std::string &owner, const std::string &repo)
Get the weekly commit activity.
std::string repoContributors(const std::string &owner, const std::string &repo)
List repository contributors.
std::string listOrgEvent(const std::string &org)
List public organization events.
std::string getTopreferralSource(const std::string &owner, const std::string &repo)
Get top referral sources.
std::string getPullRequest(const std::string &owner, const std::string &repo, const std::string &pullNumber)
Lists details of a pull request by providing its number.
std::string getUserInfo(const std::string &user)
Request user info.
std::string listUsers()
Lists all users, in the order that they signed up on GitHub. This list includes personal user account...
std::string getHourlyCommitCount(const std::string &owner, const std::string &repo)
Get the hourly commit count for each day.
std::string listRepoCollaborators(const std::string &owner, const std::string &repo)
List repository collaborators.
std::string listNetworkRepoEvent(const std::string &owner, const std::string &repo)
List public events for a network of repositories.
std::string getPageViews(const std::string &owner, const std::string &repo)
Get page views. Get the total number of views and breakdown per day or week for the last 14 days.
std::string listAuthUserRepo()
List repositories for the authenticated user.
std::string getIssue(const std::string &owner, const std::string &repo, const std::string &issueNumber)
std::string isPRmerged(const std::string &owner, const std::string &repo, const std::string &pullNumber)
Check if a pull request has been merged.
std::string getRepoSubscription(const std::string &owner, const std::string &repo)
Get a repository subscription.
std::string getRelease(const std::string &user, const std::string &repo, int id)
Request release details.
std::string listCommits(const std::string &owner, const std::string &repo)
List commits.
std::string listPullRequestfiles(const std::string &owner, const std::string &repo, const std::string &pullNumber)
Responses include a maximum of 3000 files. The paginated response returns 30 files per page by defaul...
std::string issues()
List issues assigned to the authenticated user across all visible repositories including owned reposi...
std::string getCommunityProfileMetrics(const std::string &owner, const std::string &repo)
Get community profile metrics.
std::string listBranchHeadCommit(const std::string &owner, const std::string &repo, const std::string &commitSha)
List branches for HEAD commit.
Request & operator=(const Request &)=delete
std::string getAuthenticatedUser()
Get the authenticated user info.
std::string getLastYearCommit(const std::string &owner, const std::string &repo)
Get the last year of commit activity.
std::string getReleases(const std::string &user, const std::string &repo)
Request releases for repository.
std::string listStargazers(const std::string &owner, const std::string &repo)
Lists the people that have starred the repository.
std::string getCommitCount(const std::string &owner, const std::string &repo)
Get the weekly commit count.
std::string listPullRequestCommit(const std::string &owner, const std::string &repo, const std::string &pullNumber)
Lists a maximum of 250 commits for a pull request.
std::string listRepoWatchers(const std::string &owner, const std::string &repo)
Lists the people watching the specified repository.
std::string listRepoEvent(const std::string &owner, const std::string &repo)
List repository events.
std::string orgIssues(const std::string &org)
List issues in an organization assigned to the authenticated user.
std::string listUserWatchedRepos(const std::string &username)
List repositories watched by a user.
std::string getCommits(const std::string &owner, const std::string &repo, const std::string &reference)
Get a commit.
std::string listUserStarredRepo(const std::string &username)
List repositories starred by a user.
std::string listUserRepo(const std::string &user)
Request list of user repositories.
Request(std::shared_ptr< cpp_restapi::IConnection >)
std::string getRepository(const std::string &owner, const std::string &repo)
Get a repository.
std::string getAuntenticatedUser()
Definition connection_builder.hpp:13