cpp Rest API
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 getAuntenticatedUser();
90
98 std::string listUsers();
99
107 std::string getUser(const std::string& username);
108
109 // issues related api methods
118 std::string issues();
119
127 std::string orgIssues(const std::string& org);
128
136 std::string listRepoIssues(const std::string& owner, const std::string& repo);
137
146 std::string getIssue(const std::string& owner, const std::string& repo, const std::string& issueNumber);
147
148 // pull request related api methods
156 std::string listPullRequest(const std::string& owner, const std::string& repo);
157
166 std::string getPullRequest(const std::string& owner, const std::string& repo, const std::string& pullNumber);
167
176 std::string listPullRequestCommit(const std::string& owner, const std::string& repo, const std::string& pullNumber);
177
188 std::string listPullRequestfiles(const std::string& owner, const std::string& repo, const std::string& pullNumber);
189
198 std::string isPRmerged(const std::string& owner, const std::string& repo, const std::string& pullNumber);
199
200 // commits related api methods
210 std::string listCommits(const std::string& owner, const std::string& repo);
211
221 std::string listBranchHeadCommit(const std::string& owner, const std::string& repo,const std::string& commitSha);
222
231 std::string listCommitPullRequest(const std::string& owner, const std::string& repo, const std::string& commitSha);
232
243 std::string getCommits(const std::string& owner, const std::string& repo, const std::string& reference);
244
245 // metrics related api methods
254 std::string getWeeklyCommit(const std::string& owner, const std::string& repo);
255
264 std::string getLastYearCommit(const std::string& owner, const std::string& repo);
265
279 std::string getcontributorsActivity(const std::string& owner, const std::string& repo);
280
291 std::string getCommitCount(const std::string& owner, const std::string& repo);
292
303 std::string getHourlyCommitCount(const std::string& owner, const std::string& repo);
304
316 std::string getCommunityProfileMetrics(const std::string& owner, const std::string& repo);
317
328 std::string getRepoClones(const std::string& owner, const std::string& repo);
329
338 std::string getRefferalPaths(const std::string& owner, const std::string& repo);
339
347 std::string getTopreferralSource(const std::string& owner, const std::string& repo);
348
357 std::string getPageViews(const std::string& owner, const std::string& repo);
358
359 // event related apis
368 std::string listNetworkRepoEvent(const std::string& owner, const std::string& repo);
369
376 std::string listOrgEvent(const std::string& org);
377
385 std::string listRepoEvent(const std::string& owner, const std::string& repo);
386
394 std::string listUserEvent(const std::string& username);
395
396 // staring related api methods
397
405 std::string listStargazers(const std::string& owner, const std::string& repo);
406
413 std::string listUserStarredRepo(const std::string& username);
414
415 // watching related api
416
424 std::string listRepoWatchers(const std::string& owner, const std::string& repo);
425
433 std::string getRepoSubscription(const std::string& owner, const std::string& repo);
434
441 std::string listUserWatchedRepos(const std::string& username);
442
454 std::string listRepoCollaborators(const std::string& owner, const std::string& repo);
455
462 std::string getOrgRepo(const std::string& org);
463
474 std::string getRepository(const std::string& owner, const std::string& repo);
475
483 std::string listAuthUserRepo();
484
494 std::string getRepoLang(const std::string& owner, const std::string& repo);
495
505 std::string repoContributors(const std::string& owner, const std::string& repo);
506
507 private:
508 std::shared_ptr<cpp_restapi::IConnection> m_connection;
509
510 std::string doRequest(const std::string &);
511 };
512}
513
514#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 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()
get the authenticated user info
Definition connection_builder.hpp:12