cpp Rest API
|
#include <request.hpp>
Public Member Functions | |
Request (std::shared_ptr< cpp_restapi::IConnection >) | |
Request (const Request &)=delete | |
~Request () | |
Request & | operator= (const Request &)=delete |
std::string | getUserInfo (const std::string &user) |
Request user info. | |
std::string | getReleases (const std::string &user, const std::string &repo) |
Request releases for repository. | |
std::string | getRelease (const std::string &user, const std::string &repo, int id) |
Request release details. | |
std::string | getRateLimit () |
Request api limits. | |
std::string | listUserRepo (const std::string &user) |
Request list of user repositories. | |
std::string | getAuntenticatedUser () |
get the authenticated user info | |
std::string | listUsers () |
Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. | |
std::string | getUser (const std::string &username) |
Provides publicly available information about someone with a GitHub account. | |
std::string | issues () |
List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. | |
std::string | orgIssues (const std::string &org) |
List issues in an organization assigned to the authenticated user. | |
std::string | listRepoIssues (const std::string &owner, const std::string &repo) |
List issues in a repository. | |
std::string | getIssue (const std::string &owner, const std::string &repo, const std::string &issueNumber) |
std::string | listPullRequest (const std::string &owner, const std::string &repo) |
List pull request in a repository. | |
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 | 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 | 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 default. | |
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 | listCommits (const std::string &owner, const std::string &repo) |
List commits. | |
std::string | listBranchHeadCommit (const std::string &owner, const std::string &repo, const std::string &commitSha) |
List branches for HEAD commit. | |
std::string | listCommitPullRequest (const std::string &owner, const std::string &repo, const std::string &commitSha) |
List pull requests associated with a commit. | |
std::string | getCommits (const std::string &owner, const std::string &repo, const std::string &reference) |
Get a commit. | |
std::string | getWeeklyCommit (const std::string &owner, const std::string &repo) |
Get the weekly commit activity. | |
std::string | getLastYearCommit (const std::string &owner, const std::string &repo) |
Get the last year of commit activity. | |
std::string | getcontributorsActivity (const std::string &owner, const std::string &repo) |
Get all contributor commit activity. | |
std::string | getCommitCount (const std::string &owner, const std::string &repo) |
Get the weekly commit count. | |
std::string | getHourlyCommitCount (const std::string &owner, const std::string &repo) |
Get the hourly commit count for each day. | |
std::string | getCommunityProfileMetrics (const std::string &owner, const std::string &repo) |
Get community profile metrics. | |
std::string | getRepoClones (const std::string &owner, const std::string &repo) |
Get repository clones. | |
std::string | getRefferalPaths (const std::string &owner, const std::string &repo) |
Get top referral paths. | |
std::string | getTopreferralSource (const std::string &owner, const std::string &repo) |
Get top referral sources. | |
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 | listNetworkRepoEvent (const std::string &owner, const std::string &repo) |
List public events for a network of repositories. | |
std::string | listOrgEvent (const std::string &org) |
List public organization events. | |
std::string | listRepoEvent (const std::string &owner, const std::string &repo) |
List repository events. | |
std::string | listUserEvent (const std::string &username) |
List events for the authenticated user. | |
std::string | listStargazers (const std::string &owner, const std::string &repo) |
Lists the people that have starred the repository. | |
std::string | listUserStarredRepo (const std::string &username) |
List repositories starred by a user. | |
std::string | listRepoWatchers (const std::string &owner, const std::string &repo) |
Lists the people watching the specified repository. | |
std::string | getRepoSubscription (const std::string &owner, const std::string &repo) |
Get a repository subscription. | |
std::string | listUserWatchedRepos (const std::string &username) |
List repositories watched by a user. | |
std::string | listRepoCollaborators (const std::string &owner, const std::string &repo) |
List repository collaborators. | |
std::string | getOrgRepo (const std::string &org) |
List organization repositories. | |
std::string | getRepository (const std::string &owner, const std::string &repo) |
Get a repository. | |
std::string | listAuthUserRepo () |
List repositories for the authenticated user. | |
std::string | getRepoLang (const std::string &owner, const std::string &repo) |
List repository languages. | |
std::string | repoContributors (const std::string &owner, const std::string &repo) |
List repository contributors. | |
GitHub api actions.
Class contains a convenient set of actions which can be executed on GitHub's api.
Before one can use it a connection with github needs to be established. Use cpp_restapi::GitHub::ConnectionBuilder to construct a cpp_restapi::IConnection object.
All methods return a response in json format.
cpp_restapi::GitHub::Request::Request | ( | std::shared_ptr< cpp_restapi::IConnection > | ) |
|
delete |
cpp_restapi::GitHub::Request::~Request | ( | ) |
std::string cpp_restapi::GitHub::Request::getAuntenticatedUser | ( | ) |
get the authenticated user info
std::string cpp_restapi::GitHub::Request::getCommitCount | ( | const std::string & | owner, |
const std::string & | repo ) |
Get the weekly commit count.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getCommits | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | reference ) |
Get a commit.
owner | The account owner of the repository. |
repo | The name of the repository. |
reference | ref parameter |
std::string cpp_restapi::GitHub::Request::getCommunityProfileMetrics | ( | const std::string & | owner, |
const std::string & | repo ) |
Get community profile metrics.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getcontributorsActivity | ( | const std::string & | owner, |
const std::string & | repo ) |
Get all contributor commit activity.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getHourlyCommitCount | ( | const std::string & | owner, |
const std::string & | repo ) |
Get the hourly commit count for each day.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getIssue | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | issueNumber ) |
owner | The account owner of the repository. |
repo | the name of the repository. |
issueNumber | The number that identifies the issue. |
std::string cpp_restapi::GitHub::Request::getLastYearCommit | ( | const std::string & | owner, |
const std::string & | repo ) |
Get the last year of commit activity.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getOrgRepo | ( | const std::string & | org | ) |
List organization repositories.
org | The organization name |
std::string cpp_restapi::GitHub::Request::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.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::getPullRequest | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | pullNumber ) |
Lists details of a pull request by providing its number.
owner | The account owner of the repository. |
repo | the name of the repository. |
pullNumber | The number that identifies the PR. |
std::string cpp_restapi::GitHub::Request::getRateLimit | ( | ) |
Request api limits.
Request limits for api calls. Equivalent of fetching https://api.github.com/rate_limit
std::string cpp_restapi::GitHub::Request::getRefferalPaths | ( | const std::string & | owner, |
const std::string & | repo ) |
Get top referral paths.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getRelease | ( | const std::string & | user, |
const std::string & | repo, | ||
int | id ) |
Request release details.
user | GitHub user name |
repo | user's repository name |
id | release id. Id is returned as a part of getReleases |
Request details of release. Equivalent of fetching https://api.github.com/repos/<user>/<repo>/releases/<id>
std::string cpp_restapi::GitHub::Request::getReleases | ( | const std::string & | user, |
const std::string & | repo ) |
Request releases for repository.
user | GitHub user name |
repo | user's repository name |
Request list of releases for repository. Equivalent of fetching https://api.github.com/repos/<user>/<repo>/releases
std::string cpp_restapi::GitHub::Request::getRepoClones | ( | const std::string & | owner, |
const std::string & | repo ) |
Get repository clones.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::getRepoLang | ( | const std::string & | owner, |
const std::string & | repo ) |
List repository languages.
owner | The account owner of the repository |
repo | The name of the repository |
std::string cpp_restapi::GitHub::Request::getRepository | ( | const std::string & | owner, |
const std::string & | repo ) |
Get a repository.
owner | The account owner of the repository |
repo | The name of the repository |
std::string cpp_restapi::GitHub::Request::getRepoSubscription | ( | const std::string & | owner, |
const std::string & | repo ) |
Get a repository subscription.
owner | The account owner of the repository |
repo | The name of the repository |
std::string cpp_restapi::GitHub::Request::getTopreferralSource | ( | const std::string & | owner, |
const std::string & | repo ) |
Get top referral sources.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::getUser | ( | const std::string & | username | ) |
Provides publicly available information about someone with a GitHub account.
username | github user name |
std::string cpp_restapi::GitHub::Request::getUserInfo | ( | const std::string & | user | ) |
Request user info.
user | GitHub user name |
Request user information. Equivalent of fetching https://api.github.com/users/<user>
std::string cpp_restapi::GitHub::Request::getWeeklyCommit | ( | const std::string & | owner, |
const std::string & | repo ) |
Get the weekly commit activity.
owner | The account owner of the repository. |
repo | the name of the repository. |
std::string cpp_restapi::GitHub::Request::isPRmerged | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | pullNumber ) |
Check if a pull request has been merged.
owner | The account owner of the repository. |
repo | the name of the repository |
pullNumber | The number that identifies the PR. |
std::string cpp_restapi::GitHub::Request::issues | ( | ) |
List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories.
std::string cpp_restapi::GitHub::Request::listAuthUserRepo | ( | ) |
List repositories for the authenticated user.
std::string cpp_restapi::GitHub::Request::listBranchHeadCommit | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | commitSha ) |
List branches for HEAD commit.
owner | The account owner of the repository. |
repo | the name of the repository |
commitSha | The SHA of the commit. |
std::string cpp_restapi::GitHub::Request::listCommitPullRequest | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | commitSha ) |
List pull requests associated with a commit.
owner | The account owner of the repository. |
repo | the name of the repository |
commitSha | The SHA of the commit. |
std::string cpp_restapi::GitHub::Request::listCommits | ( | const std::string & | owner, |
const std::string & | repo ) |
List commits.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listNetworkRepoEvent | ( | const std::string & | owner, |
const std::string & | repo ) |
List public events for a network of repositories.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listOrgEvent | ( | const std::string & | org | ) |
List public organization events.
org | The organization name. |
std::string cpp_restapi::GitHub::Request::listPullRequest | ( | const std::string & | owner, |
const std::string & | repo ) |
List pull request in a repository.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listPullRequestCommit | ( | const std::string & | owner, |
const std::string & | repo, | ||
const std::string & | pullNumber ) |
Lists a maximum of 250 commits for a pull request.
owner | The account owner of the repository. |
repo | the name of the repository |
pullNumber | The number that identifies the PR. |
std::string cpp_restapi::GitHub::Request::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 default.
owner | The account owner of the repository. |
repo | the name of the repository |
pullNumber | The number that identifies the PR. |
std::string cpp_restapi::GitHub::Request::listRepoCollaborators | ( | const std::string & | owner, |
const std::string & | repo ) |
List repository collaborators.
owner | The account owner of the repository |
repo | The name of the repository |
std::string cpp_restapi::GitHub::Request::listRepoEvent | ( | const std::string & | owner, |
const std::string & | repo ) |
List repository events.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listRepoIssues | ( | const std::string & | owner, |
const std::string & | repo ) |
List issues in a repository.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listRepoWatchers | ( | const std::string & | owner, |
const std::string & | repo ) |
Lists the people watching the specified repository.
owner | The account owner of the repository |
repo | The name of the repository |
std::string cpp_restapi::GitHub::Request::listStargazers | ( | const std::string & | owner, |
const std::string & | repo ) |
Lists the people that have starred the repository.
owner | The account owner of the repository. |
repo | The name of the repository. |
std::string cpp_restapi::GitHub::Request::listUserEvent | ( | const std::string & | username | ) |
List events for the authenticated user.
username | The handle for the GitHub user account |
std::string cpp_restapi::GitHub::Request::listUserRepo | ( | const std::string & | user | ) |
Request list of user repositories.
user | GitHub user name |
Request list of repositories for user. Equivalent of fetching https://api.github.com/users/<user>/repos
std::string cpp_restapi::GitHub::Request::listUsers | ( | ) |
Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.
std::string cpp_restapi::GitHub::Request::listUserStarredRepo | ( | const std::string & | username | ) |
List repositories starred by a user.
username | The handle for the GitHub user account |
std::string cpp_restapi::GitHub::Request::listUserWatchedRepos | ( | const std::string & | username | ) |
List repositories watched by a user.
username | The handle for the GitHub user account |
std::string cpp_restapi::GitHub::Request::orgIssues | ( | const std::string & | org | ) |
List issues in an organization assigned to the authenticated user.
org | github organization |
std::string cpp_restapi::GitHub::Request::repoContributors | ( | const std::string & | owner, |
const std::string & | repo ) |
List repository contributors.
owner | The account owner of the repository |
repo | The name of the repository |