using System;
using System.Diagnostics.CodeAnalysis;
namespace Octokit
{
///
/// Class for retrieving GitHub API URLs
///
public static partial class ApiUrls
{
static readonly Uri _currentUserRepositoriesUrl = new Uri("user/repos", UriKind.Relative);
static readonly Uri _currentUserSshKeys = new Uri("user/keys", UriKind.Relative);
static readonly Uri _currentUserGpgKeys = new Uri("user/gpg_keys", UriKind.Relative);
static readonly Uri _currentUserStars = new Uri("user/starred", UriKind.Relative);
static readonly Uri _currentUserWatched = new Uri("user/subscriptions", UriKind.Relative);
static readonly Uri _currentUserEmailsEndpoint = new Uri("user/emails", UriKind.Relative);
static readonly Uri _currentUserNotificationsEndpoint = new Uri("notifications", UriKind.Relative);
static readonly Uri _currentUserAllIssues = new Uri("issues", UriKind.Relative);
static readonly Uri _currentUserOwnedAndMemberIssues = new Uri("user/issues", UriKind.Relative);
static readonly Uri _currentUserAllCodespaces = new Uri("user/codespaces", UriKind.Relative);
///
/// Returns the that returns all public repositories in
/// response to a GET request.
///
public static Uri AllPublicRepositories()
{
return "repositories".FormatUri();
}
///
/// Returns the that returns all public repositories in
/// response to a GET request.
///
/// The integer Id of the last Repository that you’ve seen.
public static Uri AllPublicRepositories(long since)
{
return "repositories?since={0}".FormatUri(since);
}
///
/// Returns the that returns all of the repositories for the currently logged in user in
/// response to a GET request. A POST to this URL creates a new repository.
///
///
public static Uri Repositories()
{
return _currentUserRepositoriesUrl;
}
///
/// Returns the that returns all of the repositories for the specified login.
///
/// The login for the user
///
public static Uri Repositories(string login)
{
return "users/{0}/repos".FormatUri(login);
}
///
/// Returns the that create a repository using a template.
///
///
public static Uri Repositories(string owner, string repo)
{
return "repos/{0}/{1}/generate".FormatUri(owner, repo);
}
///
/// Returns the that returns all of the repositories for the specified organization in
/// response to a GET request. A POST to this URL creates a new repository for the organization.
///
/// The name of the organization
///
public static Uri OrganizationRepositories(string organization)
{
return "orgs/{0}/repos".FormatUri(organization);
}
///
/// Returns the that returns all of the secrets for the specified organization in
/// response to a GET request.
///
/// The name of the organization
///
public static Uri OrganizationRepositorySecrets(string organization)
{
return "orgs/{0}/actions/secrets".FormatUri(organization);
}
///
/// Returns the that returns a secret for the specified organization in
/// response to a GET request. A POST to this URL creates a new secret for the organization.
///
/// The name of the organization
/// The name of the secret
///
public static Uri OrganizationRepositorySecret(string organization, string secret)
{
return "orgs/{0}/actions/secrets/{1}".FormatUri(organization, secret);
}
///
/// Returns the that returns the public key for signing secrets for the specified organization in
/// response to a GET request.
///
/// The name of the organization
///
public static Uri OrganizationRepositorySecretPublicKey(string organization)
{
return "orgs/{0}/actions/secrets/public-key".FormatUri(organization);
}
///
/// Returns the that returns a list of repositories for a secret for the specified organization in
/// response to a GET request. A POST to this URL sets the full repository list for a secret in the organization.
///
/// The name of the organization
/// The name of the secret
///
public static Uri OrganizationRepositorySecretRepositories(string organization, string secret)
{
return "orgs/{0}/actions/secrets/{1}/repositories".FormatUri(organization, secret);
}
///
/// Returns the that adds (PUT) or removes (DELETE) a repository from the visibility list of a secret.
///
/// The name of the organization
/// The name of the secret
/// The id of the repo to target
///
public static Uri OrganizationRepositorySecretRepository(string organization, string secret, long repoId)
{
return "orgs/{0}/actions/secrets/{1}/repositories/{2}".FormatUri(organization, secret, repoId.ToString());
}
///
/// Returns the that returns all of the organizations for the currently logged in user.
///
///
public static Uri UserOrganizations()
{
return "user/orgs".FormatUri();
}
///
/// Returns the that returns all of the organization memberships for the currently logged in user.
///
///
public static Uri UserOrganizationMemberships()
{
return "user/memberships/orgs".FormatUri();
}
///
/// Returns the that returns all of the organizations for the specified login.
///
/// The login for the user
///
public static Uri UserOrganizations(string login)
{
return "users/{0}/orgs".FormatUri(login);
}
///
/// Returns the that returns all of the organizations.
///
///
public static Uri AllOrganizations()
{
return "organizations".FormatUri();
}
///
/// Returns the that returns all of the organizations.
///
/// The integer Id of the last Organization that you’ve seen.
///
public static Uri AllOrganizations(long since)
{
return "organizations?since={0}".FormatUri(since);
}
///
/// Returns the that returns the organization for the specified organization name
///
/// The name of the organization
/// The that returns the organization for the specified organization name
public static Uri Organization(string organizationName)
{
return "orgs/{0}".FormatUri(organizationName);
}
///
/// Returns the that returns all of the SSH keys for the currently logged in user.
///
///
public static Uri SshKeys()
{
return _currentUserSshKeys;
}
///
/// Returns the that returns all of the SSH keys for the specified user.
///
/// The login for the user
///
public static Uri SshKeys(string login)
{
return "users/{0}/keys".FormatUri(login);
}
///
/// Returns the to retrieve keys for the current user.
///
public static Uri Keys()
{
return "user/keys".FormatUri();
}
///
/// Returns the to retrieve keys for a given user.
///
/// The user to search on
public static Uri Keys(string userName)
{
return "users/{0}/keys".FormatUri(userName);
}
///
/// Returns the to retrieve a given key.
///
/// The Key Id to retrieve
public static Uri Keys(int keyId)
{
return "user/keys/{0}".FormatUri(keyId);
}
///
/// Returns the that returns all of the email addresses for the currently logged in user.
///
///
public static Uri Emails()
{
return _currentUserEmailsEndpoint;
}
///
/// Returns the that returns all of the releases for the specified repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Releases(string owner, string name)
{
return "repos/{0}/{1}/releases".FormatUri(owner, name);
}
///
/// Returns the that generates release notes for the specified repository.
///
/// The owner of the repository
/// The name of the repository
/// The that generates release notes for the specified repository.
public static Uri ReleasesGenerateNotes(string owner, string name)
{
return "repos/{0}/{1}/releases/generate-notes".FormatUri(owner, name);
}
///
/// Returns the that returns a single release for the specified repository
///
/// The owner of the repository
/// The name of the repository
/// The id of the release
///
public static Uri Releases(string owner, string name, int releaseId)
{
return "repos/{0}/{1}/releases/{2}".FormatUri(owner, name, releaseId);
}
///
/// Returns the that returns a single release for the specified repository
///
/// The owner of the repository
/// The name of the repository
/// The tag of the release
///
public static Uri Releases(string owner, string name, string tag)
{
return "repos/{0}/{1}/releases/tags/{2}".FormatUri(owner, name, tag);
}
///
/// Returns the that returns the latest release for the specified repository
///
/// The owner of the repository
/// The name of the repository
///
public static Uri LatestRelease(string owner, string name)
{
return "repos/{0}/{1}/releases/latest".FormatUri(owner, name);
}
///
/// Returns the that returns all the assets for the specified release for the specified repository.
///
/// The owner of the repository
/// The name of the repository
/// The id of the release
///
public static Uri ReleaseAssets(string owner, string name, int releaseId)
{
return "repos/{0}/{1}/releases/{2}/assets".FormatUri(owner, name, releaseId);
}
///
/// Returns the that returns the assets specified by the asset id.
///
/// The owner of the repository
/// The name of the repository
/// The id of the release asset
///
public static Uri Asset(string owner, string name, int releaseAssetId)
{
return "repos/{0}/{1}/releases/assets/{2}".FormatUri(owner, name, releaseAssetId);
}
///
/// Returns the that returns all of the notifications for the currently logged in user.
///
///
public static Uri Notifications()
{
return _currentUserNotificationsEndpoint;
}
///
/// Returns the that returns all of the notifications for the currently logged in user
/// specific to the repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Notifications(string owner, string name)
{
return "repos/{0}/{1}/notifications".FormatUri(owner, name);
}
///
/// Returns the for the specified notification.
///
/// The Id of the notification.
///
public static Uri Notification(int notificationId)
{
return "notifications/threads/{0}".FormatUri(notificationId);
}
///
/// Returns the for the specified notification's subscription status.
///
/// The Id of the notification.
public static Uri NotificationSubscription(int notificationId)
{
return "notifications/threads/{0}/subscription".FormatUri(notificationId);
}
///
/// Returns the for creating a new installation token.
///
/// The Id of the GitHub App installation.
public static Uri AccessTokens(long installationId)
{
return "app/installations/{0}/access_tokens".FormatUri(installationId);
}
///
/// Returns the that creates a github app.
///
public static Uri App()
{
return "app".FormatUri();
}
///
/// Returns the that creates a github app.
///
public static Uri App(string slug)
{
return "apps/{0}".FormatUri(slug);
}
///
/// Returns the that returns all the installations of the authenticated application.
///
public static Uri Installations()
{
return "app/installations".FormatUri();
}
///
/// Returns the that lists repositories accessible to the user for an installation..
///
/// The id of the installation
public static Uri UserInstallationRepositories(long installationId)
{
return "user/installations/{0}/repositories".FormatUri(installationId);
}
///
/// Returns the that returns the repository's installation information.
///
///
public static Uri RepoInstallation(string owner, string repo)
{
return "repos/{0}/{1}/installation".FormatUri(owner, repo);
}
///
/// Returns the that returns the repository's installation information.
///
///
public static Uri RepoInstallation(long repositoryId)
{
return "repositories/{0}/installation".FormatUri(repositoryId);
}
///
/// Returns the that returns the organization's installation information.
///
public static Uri OrganizationInstallation(string organization)
{
return "orgs/{0}/installation".FormatUri(organization); ;
}
///
/// Returns the that returns the user's installation information.
///
public static Uri UserInstallation(string username)
{
return "users/{0}/installation".FormatUri(username);
}
///
/// Returns the that returns a single installation of the authenticated application.
///
public static Uri Installation(long installationId)
{
return "app/installations/{0}".FormatUri(installationId);
}
///
/// Returns the that returns all the installations in repositories the user has explicit permission to access
///
public static Uri UserInstallations()
{
return "user/installations".FormatUri();
}
///
/// Returns the that returns all the repositories
///
///
public static Uri InstallationRepositories()
{
return "installation/repositories".FormatUri();
}
///
/// Returns the that returns all of the issues across all the authenticated user’s visible
/// repositories including owned repositories, member repositories, and organization repositories:
///
public static Uri Issues()
{
return _currentUserAllIssues;
}
///
/// Returns the that returns all of the issues across owned and member repositories for the
/// authenticated user:
///
public static Uri IssuesForOwnedAndMember()
{
return _currentUserOwnedAndMemberIssues;
}
///
/// Returns the that returns all of the issues for the currently logged in user
/// specific to the repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Issues(string owner, string name)
{
return "repos/{0}/{1}/issues".FormatUri(owner, name);
}
///
/// Returns the that returns all of the issues for the specified organization for the
/// currently logged in user.
///
/// The name of the organization
///
public static Uri Issues(string organization)
{
return "orgs/{0}/issues".FormatUri(organization);
}
///
/// Returns the for the specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri Issue(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}".FormatUri(owner, name, number);
}
///
/// Returns the for the specified issue to be locked/unlocked.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueLock(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/lock".FormatUri(owner, name, number);
}
///
/// Returns the for the reaction of a specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueReactions(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/reactions".FormatUri(owner, name, number);
}
///
/// Returns the for the reaction of a specified issue.
///
/// The Id of the repository
/// The issue number
///
public static Uri IssueReactions(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/reactions".FormatUri(repositoryId, number);
}
///
/// Returns the for the reaction of a specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
/// The reactionid for the issue
///
public static Uri IssueReaction(string owner, string name, int number, long reactionId)
{
return "repos/{0}/{1}/issues/{2}/reactions/{3}".FormatUri(owner, name, number, reactionId);
}
///
/// Returns the for the reaction of a specified issue.
///
/// The Id of the repository
/// The issue number
/// The reactionid for the issue
///
public static Uri IssueReaction(long repositoryId, int number, long reactionId)
{
return "repositories/{0}/issues/{1}/reactions/{2}".FormatUri(repositoryId, number, reactionId);
}
///
/// Returns the for the timeline of a specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueTimeline(string owner, string repo, int number)
{
return "repos/{0}/{1}/issues/{2}/timeline".FormatUri(owner, repo, number);
}
///
/// Returns the for the timeline of a specified issue.
///
/// The Id of the repository
/// The issue number
///
public static Uri IssueTimeline(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/timeline".FormatUri(repositoryId, number);
}
///
/// Returns the for the comments for all issues in a specific repo.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri IssueComments(string owner, string name)
{
return "repos/{0}/{1}/issues/comments".FormatUri(owner, name);
}
///
/// Returns the for the comments of a specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueComments(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/comments".FormatUri(owner, name, number);
}
///
/// Returns the for the specified comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
///
public static Uri IssueComment(string owner, string name, long commentId)
{
return "repos/{0}/{1}/issues/comments/{2}".FormatUri(owner, name, commentId);
}
///
/// Returns the for the reaction of a specified issue comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
///
public static Uri IssueCommentReactions(string owner, string name, long commentId)
{
return "repos/{0}/{1}/issues/comments/{2}/reactions".FormatUri(owner, name, commentId);
}
///
/// Returns the for the reaction of a specified issue comment.
///
/// The owner of the repository
/// The comment id
///
public static Uri IssueCommentReactions(long repositoryId, long commentId)
{
return "repositories/{0}/issues/comments/{1}/reactions".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the reaction of a specified issue comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
/// The reactionid for the comment
///
public static Uri IssueCommentReaction(string owner, string name, long commentId, long reaction)
{
return "repos/{0}/{1}/issues/comments/{2}/reactions/{3}".FormatUri(owner, name, commentId, reaction);
}
///
/// Returns the for the reaction of a specified issue comment.
///
/// The owner of the repository
/// The comment id
/// The reactionid for the comment
///
public static Uri IssueCommentReaction(long repositoryId, long commentId, long reaction)
{
return "repositories/{0}/issues/comments/{1}/reactions/{2}".FormatUri(repositoryId, commentId, reaction);
}
///
/// Returns the for the specified comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
///
public static Uri CommitComment(string owner, string name, long commentId)
{
return "repos/{0}/{1}/comments/{2}".FormatUri(owner, name, commentId);
}
///
/// Returns the for the comments of a specified commit.
///
/// The owner of the repository
/// The name of the repository
/// The sha of the commit
///
public static Uri CommitComments(string owner, string name, string sha)
{
return "repos/{0}/{1}/commits/{2}/comments".FormatUri(owner, name, sha);
}
///
/// Returns the for the comments of a specified commit.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri CommitComments(string owner, string name)
{
return "repos/{0}/{1}/comments".FormatUri(owner, name);
}
///
/// Returns the for the reaction of a specified commit comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
///
public static Uri CommitCommentReactions(string owner, string name, long commentId)
{
return "repos/{0}/{1}/comments/{2}/reactions".FormatUri(owner, name, commentId);
}
///
/// Returns the for the reaction of a specified commit comment.
///
/// The Id of the repository
/// The comment id
///
public static Uri CommitCommentReactions(long repositoryId, long commentId)
{
return "repositories/{0}/comments/{1}/reactions".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the reaction of a specified commit comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
/// The reaction number
///
public static Uri CommitCommentReaction(string owner, string name, long commentId, long reaction)
{
return "repos/{0}/{1}/comments/{2}/reactions/{3}".FormatUri(owner, name, commentId, reaction);
}
///
/// Returns the for the reaction of a specified commit comment.
///
/// The Id of the repository
/// The comment id
/// The reaction number
///
public static Uri CommitCommentReaction(long repositoryId, long commentId, long reaction)
{
return "repositories/{0}/comments/{1}/reactions/{2}".FormatUri(repositoryId, commentId, reaction);
}
///
/// Returns the that returns all of the assignees to which issues may be assigned.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Assignees(string owner, string name)
{
return "repos/{0}/{1}/assignees".FormatUri(owner, name);
}
///
/// Returns the that returns a 204 if the login belongs to an assignee of the repository.
/// Otherwise returns a 404.
///
/// The owner of the repository
/// The name of the repository
/// The login for the user
///
public static Uri CheckAssignee(string owner, string name, string login)
{
return "repos/{0}/{1}/assignees/{2}".FormatUri(owner, name, login);
}
///
/// Returns the to add and remove assignees for an issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueAssignees(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/assignees".FormatUri(owner, name, number);
}
///
/// Returns the that returns all of the members of the organization
///
/// The organization
///
public static Uri Members(string org)
{
return "orgs/{0}/members".FormatUri(org);
}
///
/// Returns the that returns all of the members of the organization
///
/// The organization
/// The member filter,
/// The correct uri
public static Uri Members(string org, OrganizationMembersFilter filter)
{
return "orgs/{0}/members?filter={1}".FormatUri(org, filter.ToParameter());
}
///
/// Returns the that returns all of the members of the organization
///
/// The organization
/// The role filter,
/// The correct uri
public static Uri Members(string org, OrganizationMembersRole role)
{
return "orgs/{0}/members?role={1}".FormatUri(org, role.ToParameter());
}
///
/// Returns the that returns all of the members of the organization
///
/// The organization
/// The member filter,
/// The role filter,
/// The correct uri
public static Uri Members(string org, OrganizationMembersFilter filter, OrganizationMembersRole role)
{
return "orgs/{0}/members?filter={1}&role={2}".FormatUri(org, filter.ToParameter(), role.ToParameter());
}
///
/// Returns the that returns all of the public members of the organization
///
/// Organization
///
public static Uri PublicMembers(string org)
{
return "orgs/{0}/public_members".FormatUri(org);
}
///
/// Returns the that returns a 204 if requester is an organization member and
/// the user is, publicly or privately a member of the organization.
/// Returns a 404 if the requester is an organization member and the user is not a member or
/// the requester is not an organization member and is inquiring about themselves.
/// Returns a 302 if the requester is not an organization member.
///
/// The organization being inquired about
/// The user being inquired about
///
public static Uri CheckMember(string org, string name)
{
return "orgs/{0}/members/{1}".FormatUri(org, name);
}
///
/// Returns the that returns member of organization
///
/// The organization being inquired about
/// The user being inquired about
/// The that returns member of organization
public static Uri OrganizationMember(string org, string user)
{
return "orgs/{0}/members/{1}".FormatUri(org, user);
}
///
/// Returns the that returns a 204 if the user is a public member of the
/// organization.
/// Otherwise returns a 404.
///
/// The organization being inquired about
/// The user being inquired about
///
public static Uri CheckMemberPublic(string org, string name)
{
return "orgs/{0}/public_members/{1}".FormatUri(org, name);
}
///
/// Returns the that returns a 204 if the user is publicizing, or concealing
/// their membership in an organization.
///
/// The organization to publicize, or conceal their membership of
/// The user publicizing, or concealing their membership of the organization
///
public static Uri OrganizationMembership(string org, string name)
{
return "orgs/{0}/public_members/{1}".FormatUri(org, name);
}
///
/// Returns the for the organization memberships
///
/// The name of the organization
/// The name of the user
///
public static Uri OrganizationMemberships(string org, string name)
{
return "orgs/{0}/memberships/{1}".FormatUri(org, name);
}
///
/// Returns the for the organization's invitations
///
/// The name of the organization
///
public static Uri OrganizationInvitations(string org)
{
return "orgs/{0}/invitations".FormatUri(org);
}
///
/// Returns the for the organizations pending invitations
///
/// The name of the organization
///
public static Uri OrganizationPendingInvitations(string org)
{
return "orgs/{0}/invitations".FormatUri(org);
}
///
/// Returns the for the organizations failed invitations
///
/// The name of the organization
///
public static Uri OrganizationFailedInvitations(string org)
{
return "orgs/{0}/failed_invitations".FormatUri(org);
}
///
/// Returns the to cancel an organization invitation
///
/// The name of the organization
/// The unique identifier of the invitation
///
public static Uri CancelOrganizationInvitation(string org, int invitationId)
{
return "orgs/{0}/invitations/{1}".FormatUri(org, invitationId);
}
///
/// Returns the that returns all of the outside collaborators of the organization
///
/// The organization
///
public static Uri OutsideCollaborators(string org)
{
return "orgs/{0}/outside_collaborators".FormatUri(org);
}
///
/// Returns the that returns all of the outside collaborators of the organization
///
/// The organization
/// The collaborator filter,
/// The correct uri
public static Uri OutsideCollaborators(string org, OrganizationMembersFilter filter)
{
return "orgs/{0}/outside_collaborators?filter={1}".FormatUri(org, filter.ToParameter());
}
public static Uri OutsideCollaborator(string org, string user)
{
return "orgs/{0}/outside_collaborators/{1}".FormatUri(org, user);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Events(string owner, string name)
{
return "repos/{0}/{1}/events".FormatUri(owner, name);
}
///
/// Returns the that returns the issue/pull request event info for the specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssuesEvents(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/events".FormatUri(owner, name, number);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri IssuesEvents(string owner, string name)
{
return "repos/{0}/{1}/issues/events".FormatUri(owner, name);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified event.
///
/// The owner of the repository
/// The name of the repository
/// The event id
///
public static Uri IssuesEvent(string owner, string name, long eventId)
{
return "repos/{0}/{1}/issues/events/{2}".FormatUri(owner, name, eventId);
}
///
/// Returns the that returns the specified milestone.
///
/// The owner of the repository
/// The name of the repository
/// The milestone number
///
public static Uri Milestone(string owner, string name, int number)
{
return "repos/{0}/{1}/milestones/{2}".FormatUri(owner, name, number);
}
///
/// Returns the that returns all of the milestones for the specified repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Milestones(string owner, string name)
{
return "repos/{0}/{1}/milestones".FormatUri(owner, name);
}
///
/// Returns the that returns the specified label.
///
/// The owner of the repository
/// The name of the repository
/// The name of label
///
public static Uri Label(string owner, string name, string labelName)
{
return "repos/{0}/{1}/labels/{2}".FormatUri(owner, name, labelName);
}
///
/// Returns the that returns all of the labels for the specified repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Labels(string owner, string name)
{
return "repos/{0}/{1}/labels".FormatUri(owner, name);
}
///
/// Returns the that returns the named label for the specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
/// The name of the label
///
public static Uri IssueLabel(string owner, string name, int number, string labelName)
{
return "repos/{0}/{1}/issues/{2}/labels/{3}".FormatUri(owner, name, number, labelName);
}
///
/// Returns the that returns all of the labels for the specified issue.
///
/// The owner of the repository
/// The name of the repository
/// The issue number
///
public static Uri IssueLabels(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/labels".FormatUri(owner, name, number);
}
///
/// Returns the that returns all of the labels for all issues in the specified milestone.
///
/// The owner of the repository
/// The name of the repository
/// The milestone number
///
public static Uri MilestoneLabels(string owner, string name, int number)
{
return "repos/{0}/{1}/milestones/{2}/labels".FormatUri(owner, name, number);
}
///
/// Returns the to use when creating a commit status for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
///
public static Uri CreateCommitStatus(string owner, string name, string reference)
{
return "repos/{0}/{1}/statuses/{2}".FormatUri(owner, name, reference);
}
///
/// Returns the that lists the repository hooks for the specified reference.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryHooks(string owner, string name)
{
return "repos/{0}/{1}/hooks".FormatUri(owner, name);
}
///
/// Returns the that gets the repository hook for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The identifier of the repository hook
///
public static Uri RepositoryHookById(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}".FormatUri(owner, name, hookId);
}
///
/// Returns the that can tests a specified repository hook
///
/// The owner of the repository
/// The name of the repository
/// The identifier of the repository hook
///
public static Uri RepositoryHookTest(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}/tests".FormatUri(owner, name, hookId);
}
///
/// Returns the that can ping a specified repository hook
///
/// The owner of the repository
/// The name of the repository
/// The identifier of the repository hook
///
public static Uri RepositoryHookPing(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}/pings".FormatUri(owner, name, hookId);
}
///
/// Returns the that lists the organization hooks for the specified reference.
///
/// The name of the organization
///
public static Uri OrganizationHooks(string org)
{
return "orgs/{0}/hooks".FormatUri(org);
}
///
/// Returns the that gets the organization hook for the specified reference.
///
/// The name of the organization
/// The identifier of the organization hook
///
public static Uri OrganizationHookById(string org, int hookId)
{
return "orgs/{0}/hooks/{1}".FormatUri(org, hookId);
}
///
/// Returns the that can ping a specified organization hook
///
/// The name of the organization
/// The identifier of the organization hook
///
public static Uri OrganizationHookPing(string org, int hookId)
{
return "orgs/{0}/hooks/{1}/pings".FormatUri(org, hookId);
}
///
/// Returns the that lists the commit statuses for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
///
public static Uri CommitStatuses(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}/statuses".FormatUri(owner, name, reference);
}
///
/// Returns the that returns a combined view of commit statuses for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
///
public static Uri CombinedCommitStatus(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}/status".FormatUri(owner, name, reference);
}
///
/// Returns the that lists the repository forks for the specified reference.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryForks(string owner, string name)
{
return "repos/{0}/{1}/forks".FormatUri(owner, name);
}
///
/// Returns the that lists the watched repositories for the authenticated user.
///
/// The owner of the repository
/// The name of the repository
/// The that lists the watched repositories for the authenticated user.
public static Uri Watchers(string owner, string name)
{
return "repos/{0}/{1}/subscribers".FormatUri(owner, name);
}
///
/// Returns the that lists the watched repositories for the authenticated user.
///
public static Uri Watched()
{
return _currentUserWatched;
}
///
/// Returns the that lists the watched repositories for the specified user.
///
/// The user that has the watches
public static Uri WatchedByUser(string user)
{
return "users/{0}/subscriptions".FormatUri(user);
}
///
/// Returns the that shows whether the repo is starred by the current user.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Watched(string owner, string name)
{
return "repos/{0}/{1}/subscription".FormatUri(owner, name);
}
///
/// Returns the that lists the starred repositories for the authenticated user.
///
/// The owner of the repository
/// The name of the repository
/// The that lists the starred repositories for the authenticated user.
public static Uri Stargazers(string owner, string name)
{
return "repos/{0}/{1}/stargazers".FormatUri(owner, name);
}
///
/// Returns the that lists the starred repositories for the authenticated user.
///
public static Uri Starred()
{
return _currentUserStars;
}
///
/// Returns the that lists the starred repositories for the specified user.
///
/// The user that has the stars
public static Uri StarredByUser(string user)
{
return "users/{0}/starred".FormatUri(user);
}
///
/// Returns the that shows whether the repo is starred by the current user.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Starred(string owner, string name)
{
return "user/starred/{0}/{1}".FormatUri(owner, name);
}
///
/// Returns the for the specified tag.
///
/// The owner of the repository
/// The name of the repository
/// The tag reference (SHA)
///
public static Uri Tag(string owner, string name, string reference)
{
return "repos/{0}/{1}/git/tags/{2}".FormatUri(owner, name, reference);
}
///
/// Returns the for creating a tag object.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri CreateTag(string owner, string name)
{
return "repos/{0}/{1}/git/tags".FormatUri(owner, name);
}
///
/// Returns the that returns the list of public events.
///
///
public static Uri Events()
{
return "events".FormatUri();
}
///
/// Returns the that returns the feeds available to the authenticating user.
///
///
public static Uri Feeds()
{
return "feeds".FormatUri();
}
///
/// Returns the that returns the list of public gists.
///
public static Uri Gist()
{
return "gists".FormatUri();
}
///
/// Returns the for the specified gist.
///
/// The id of the gist
public static Uri Gist(string gistId)
{
return "gists/{0}".FormatUri(gistId);
}
///
/// Returns the for the forks for the specified gist.
///
/// The id of the gist
public static Uri ForkGist(string gistId)
{
return "gists/{0}/forks".FormatUri(gistId);
}
///
/// Returns the for all public gists.
///
public static Uri PublicGists()
{
return "gists/public".FormatUri();
}
///
/// Returns the for all started public gists.
///
public static Uri StarredGists()
{
return "gists/starred".FormatUri();
}
///
/// Returns the for all gists for a given user.
///
/// The user to search for
public static Uri UsersGists(string user)
{
return "users/{0}/gists".FormatUri(user);
}
///
/// Returns the to star a given gist.
///
/// The id of the gist
public static Uri StarGist(string gistId)
{
return "gists/{0}/star".FormatUri(gistId);
}
///
/// Returns the for the comments for the specified gist.
///
/// The id of the gist
public static Uri GistComments(string gistId)
{
return "gists/{0}/comments".FormatUri(gistId);
}
///
/// Returns the for the commits for the specified gist.
///
/// The id of the gist
public static Uri GistCommits(string gistId)
{
return "gists/{0}/commits".FormatUri(gistId);
}
///
/// Returns the that returns the specified pull request.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
///
public static Uri PullRequest(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}".FormatUri(owner, name, number);
}
///
/// Returns the that lists the pull requests for a repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri PullRequests(string owner, string name)
{
return "repos/{0}/{1}/pulls".FormatUri(owner, name);
}
///
/// Returns the that returns the pull request merge state.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The that returns the pull request merge state.
public static Uri MergePullRequest(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}/merge".FormatUri(owner, name, number);
}
///
/// Returns the that returns the commits on a pull request.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The that returns the commits on a pull request.
public static Uri PullRequestCommits(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}/commits".FormatUri(owner, name, number);
}
///
/// Returns the that returns the files on a pull request.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The that returns the files on a pull request.
public static Uri PullRequestFiles(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}/files".FormatUri(owner, name, number);
}
///
/// Returns the for a specific comment for the specified commit.
///
/// The id of the gist
/// The id of the comment
public static Uri GistComment(string gistId, long commentId)
{
return "gists/{0}/comments/{1}".FormatUri(gistId, commentId);
}
///
/// Returns the for the specified commit.
///
/// The owner of the repository
/// The name of the repository
/// The commit reference (SHA)
///
public static Uri Commit(string owner, string name, string reference)
{
return "repos/{0}/{1}/git/commits/{2}".FormatUri(owner, name, reference);
}
///
/// Returns the for the specified reference.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Reference(string owner, string name)
{
return "repos/{0}/{1}/git/refs".FormatUri(owner, name);
}
///
/// Returns the for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The reference name
///
public static Uri Reference(string owner, string name, string referenceName)
{
return "repos/{0}/{1}/git/refs/{2}".FormatUri(owner, name, referenceName);
}
///
/// Returns the for creating a commit object.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri CreateCommit(string owner, string name)
{
return "repos/{0}/{1}/git/commits".FormatUri(owner, name);
}
///
/// Returns the for creating a merge object.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri CreateMerge(string owner, string name)
{
return "repos/{0}/{1}/merges".FormatUri(owner, name);
}
///
/// Returns the for the network of repositories.
///
/// The owner of the repository
/// The name of the repository
/// The for the network of repositories.
public static Uri NetworkEvents(string owner, string name)
{
return "networks/{0}/{1}/events".FormatUri(owner, name);
}
///
/// Returns the for the organization.
///
/// The name of the organization
///
public static Uri OrganizationEvents(string organization)
{
return "orgs/{0}/events".FormatUri(organization);
}
///
/// Returns the for the received events for a user.
///
/// The login of the user
///
public static Uri ReceivedEvents(string user)
{
return ReceivedEvents(user, false);
}
///
/// Returns the for the received events for a user.
///
/// The login of the user
/// Whether to return public events or not
///
public static Uri ReceivedEvents(string user, bool isPublic)
{
string usersReceivedEvents = "users/{0}/received_events";
if (isPublic)
{
usersReceivedEvents += "/public";
}
return usersReceivedEvents.FormatUri(user);
}
///
/// Returns the for events performed by a user.
///
/// The login of the user
///
public static Uri PerformedEvents(string user)
{
return PerformedEvents(user, false);
}
///
/// Returns the for events performed by a user.
///
/// The login of the user
/// Whether to return public events or not
///
public static Uri PerformedEvents(string user, bool isPublic)
{
string usersEvents = "users/{0}/events";
if (isPublic)
{
usersEvents += "/public";
}
return usersEvents.FormatUri(user);
}
///
/// Returns the for events associated with an organization.
///
/// The login of the user
/// The name of the organization
///
public static Uri OrganizationEvents(string user, string organization)
{
return "users/{0}/events/orgs/{1}".FormatUri(user, organization);
}
///
/// Returns the for the comments of a specified pull request review.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The
public static Uri PullRequestReviewComments(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}/comments".FormatUri(owner, name, number);
}
///
/// Returns the for the reviews opf a specified pull request
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The
public static Uri PullRequestReviews(string owner, string name, int number)
{
return "repos/{0}/{1}/pulls/{2}/reviews".FormatUri(owner, name, number);
}
///
/// Returns the for the specified pull request review comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
/// The
public static Uri PullRequestReviewComment(string owner, string name, long commentId)
{
return "repos/{0}/{1}/pulls/comments/{2}".FormatUri(owner, name, commentId);
}
///
/// Returns the for the specified pull request review.
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReview(string owner, string name, int number, long reviewId)
{
return "repos/{0}/{1}/pulls/{2}/reviews/{3}".FormatUri(owner, name, number, reviewId);
}
///
/// Returns the for dismissing a specified pull request review
///
/// The Id of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReviewDismissal(long repositoryId, int number, long reviewId)
{
return "repositories/{0}/pulls/{1}/reviews/{2}/dismissals".FormatUri(repositoryId, number, reviewId);
}
///
/// Returns the for dismissing a specified pull request review
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReviewDismissal(string owner, string name, int number, long reviewId)
{
return "repos/{0}/{1}/pulls/{2}/reviews/{3}/dismissals".FormatUri(owner, name, number, reviewId);
}
///
/// Returns the for submitting a pull request review
///
/// The Id of the repository
/// The pull request number
/// The pull request review number
/// The that
public static Uri PullRequestReviewSubmit(long repositoryId, int number, long reviewId)
{
return "repositories/{0}/pulls/{1}/reviews/{2}/events".FormatUri(repositoryId, number, reviewId);
}
///
/// Returns the for submitting a pull request review
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReviewSubmit(string owner, string name, int number, long reviewId)
{
return "repos/{0}/{1}/pulls/{2}/reviews/{3}/events".FormatUri(owner, name, number, reviewId);
}
///
/// Returns the for submitting a pull request review
///
/// The Id of the repository
/// The pull request number
/// The pull request review number
/// The that
public static Uri PullRequestReviewComments(long repositoryId, int number, long reviewId)
{
return "repositories/{0}/pulls/{1}/reviews/{2}/comments".FormatUri(repositoryId, number, reviewId);
}
///
/// Returns the for submitting a pull request review
///
/// The owner of the repository
/// The name of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReviewComments(string owner, string name, int number, long reviewId)
{
return "repos/{0}/{1}/pulls/{2}/reviews/{3}/comments".FormatUri(owner, name, number, reviewId);
}
///
/// Returns the for a specified pull request review.
///
/// The Id of the repository
/// The pull request number
/// The pull request review number
/// The
public static Uri PullRequestReview(long repositoryId, int number, long reviewId)
{
return "repositories/{0}/pulls/{1}/reviews/{2}".FormatUri(repositoryId, number, reviewId);
}
///
/// Returns the for the reactions of a specified pull request review comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
///
public static Uri PullRequestReviewCommentReactions(string owner, string name, long commentId)
{
return "repos/{0}/{1}/pulls/comments/{2}/reactions".FormatUri(owner, name, commentId);
}
///
/// Returns the for the reactions of a specified pull request review comment.
///
/// The Id of the repository
/// The comment id
///
public static Uri PullRequestReviewCommentReactions(long repositoryId, long commentId)
{
return "repositories/{0}/pulls/comments/{1}/reactions".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the reaction of a specified pull request review comment.
///
/// The owner of the repository
/// The name of the repository
/// The comment id
/// The reactionid for the comment
///
public static Uri PullRequestReviewCommentReaction(string owner, string name, long commentId, long reaction)
{
return "repos/{0}/{1}/pulls/comments/{2}/reactions/{3}".FormatUri(owner, name, commentId, reaction);
}
///
/// Returns the for the reaction of a specified pull request review comment.
///
/// The Id of the repository
/// The comment id
/// The reactionid for the comment
///
public static Uri PullRequestReviewCommentReaction(long repositoryId, long commentId, long reaction)
{
return "repositories/{0}/pulls/comments/{1}/reactions/{2}".FormatUri(repositoryId, commentId, reaction);
}
///
/// Returns the for the pull request review comments on a specified repository.
///
/// The owner of the repository
/// The name of the repository
/// The
public static Uri PullRequestReviewCommentsRepository(string owner, string name)
{
return "repos/{0}/{1}/pulls/comments".FormatUri(owner, name);
}
///
/// Returns the for a specific blob.
///
/// The owner of the blob
/// The name of the organization
///
public static Uri Blobs(string owner, string name)
{
return Blob(owner, name, "");
}
///
/// Returns the for a specific blob.
///
/// The owner of the blob
/// The name of the organization
/// The SHA of the blob
///
public static Uri Blob(string owner, string name, string reference)
{
string blob = "repos/{0}/{1}/git/blobs";
if (!string.IsNullOrEmpty(reference))
{
blob += "/{2}";
}
return blob.FormatUri(owner, name, reference);
}
///
/// Returns the for the specified tree.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Tree(string owner, string name)
{
return "repos/{0}/{1}/git/trees".FormatUri(owner, name);
}
///
/// Returns the for the specified tree.
///
/// The owner of the repository
/// The name of the repository
/// The tree reference (SHA)
///
public static Uri Tree(string owner, string name, string reference)
{
return "repos/{0}/{1}/git/trees/{2}".FormatUri(owner, name, reference);
}
///
/// Returns the for the specified tree.
///
/// The owner of the repository
/// The name of the repository
/// The tree reference (SHA)
///
public static Uri TreeRecursive(string owner, string name, string reference)
{
return "repos/{0}/{1}/git/trees/{2}?recursive=1".FormatUri(owner, name, reference.TrimEnd('/'));
}
///
/// returns the for org teams
/// use for both Get and Create methods
///
///
///
public static Uri OrganizationTeams(string organization)
{
return "orgs/{0}/teams".FormatUri(organization);
}
///
/// Returns the to discover teams
/// for the current user
///
///
public static Uri UserTeams()
{
return "user/teams".FormatUri();
}
///
/// Returns the for child teams
///
/// The id of the parent team
///
public static Uri TeamChildTeams(int parentTeamId)
{
return "teams/{0}/teams".FormatUri(parentTeamId);
}
///
/// Returns the for teams
/// use for getting, updating, or deleting a .
///
/// The id of the .
///
public static Uri Teams(int teamId)
{
return "teams/{0}".FormatUri(teamId);
}
///
/// Returns the for teams
/// use for updating, or deleteing a .
///
///
///
///
public static Uri TeamsByOrganizationAndSlug(string org, string teamSlug)
{
return "orgs/{0}/teams/{1}".FormatUri(org, teamSlug);
}
///
/// returns the for team member
///
/// The team id
/// The user login.
public static Uri TeamMember(int teamId, string login)
{
return "teams/{0}/memberships/{1}".FormatUri(teamId, login);
}
///
/// returns the for team members list
///
/// The team id
public static Uri TeamMembers(int teamId)
{
return "teams/{0}/members".FormatUri(teamId);
}
///
/// returns the for the repositories
///
/// The team id
public static Uri TeamRepositories(int teamId)
{
return "teams/{0}/repos".FormatUri(teamId);
}
///
/// returns the for a team repository
///
/// The team id
/// The organization id
/// The repository name
public static Uri TeamRepository(int teamId, string organization, string repoName)
{
return "teams/{0}/repos/{1}/{2}".FormatUri(teamId, organization, repoName);
}
///
/// returns the for a team repository
///
/// The organization name. The name is not case sensitive.
/// The slug of the team name.
/// The account owner of the repository. The name is not case sensitive.
/// The name of the repository. The name is not case sensitive.
public static Uri TeamPermissionsForARepository(string org, string teamSlug, string owner, string repo)
{
return "/orgs/{0}/teams/{1}/repos/{2}/{3}".FormatUri(org, teamSlug, owner, repo);
}
///
/// returns the for the teams pending invitations
///
/// The team id
///
public static Uri TeamPendingInvitations(int teamId)
{
return "teams/{0}/invitations".FormatUri(teamId);
}
///
/// returns the for teams
/// use for update or deleting a team
///
/// owner of repo
/// name of repo
///
public static Uri RepoCollaborators(string owner, string name)
{
return "repos/{0}/{1}/collaborators".FormatUri(owner, name);
}
///
/// Returns the to check user is collaborator
///
/// The owner of repo
/// The name of repo
/// The name of user
/// The to check user is collaborator
public static Uri RepoCollaborator(string owner, string repo, string user)
{
return "repos/{0}/{1}/collaborators/{2}".FormatUri(owner, repo, user);
}
///
/// Returns the to check user is collaborator
///
/// The id of the repository
/// The name of the user
/// The to check user is collaborator
public static Uri RepoCollaborator(long repositoryId, string user)
{
return "repositories/{0}/collaborators/{1}".FormatUri(repositoryId, user);
}
///
/// Returns the to review the collaborators permission
///
/// The owner of the repo
/// The name of the repo
/// The name of the user
/// The to review the collaborators permission
public static Uri RepoCollaboratorPermission(string owner, string repo, string user)
{
return "repos/{0}/{1}/collaborators/{2}/permission".FormatUri(owner, repo, user);
}
public static Uri RepoCollaboratorPermission(long repositoryId, string user)
{
return "repositories/{0}/collaborators/{1}/permission".FormatUri(repositoryId, user);
}
///
/// returns the for branches
///
/// owner of repo
/// name of repo
///
public static Uri RepoBranches(string owner, string name)
{
return "repos/{0}/{1}/branches".FormatUri(owner, name);
}
///
/// Creates the relative for searching repositories
///
///
public static Uri SearchRepositories()
{
return "search/repositories".FormatUri();
}
///
/// Creates the relative for searching users
///
///
public static Uri SearchUsers()
{
return "search/users".FormatUri();
}
///
/// Creates the relative for searching issues
///
///
public static Uri SearchIssues()
{
return "search/issues".FormatUri();
}
///
/// Creates the relative for searching code
///
///
public static Uri SearchCode()
{
return "search/code".FormatUri();
}
///
/// Creates the relative for searching labels
///
///
public static Uri SearchLabels()
{
return "search/labels".FormatUri();
}
///
/// Returns the for repository codeowners errors.
///
/// The owner of the repository
/// The name of the repository
/// the for repository topics.
public static Uri RepositoryCodeOwnersErrors(string owner, string name)
{
return "repos/{0}/{1}/codeowners/errors".FormatUri(owner, name);
}
///
/// Returns the for repository codeowners errors.
///
/// The ID of the repository
/// the for repository topics.
public static Uri RepositoryCodeOwnersErrors(long repositoryId)
{
return "repositories/{0}/codeowners/errors".FormatUri(repositoryId);
}
///
/// Returns the for repository contributors.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryContributors(string owner, string name)
{
return "repos/{0}/{1}/contributors".FormatUri(owner, name);
}
///
/// Returns the for repository topics.
///
/// The owner of the repository
/// The name of the repository
/// the for repository topics.
public static Uri RepositoryTopics(string owner, string name)
{
return "repos/{0}/{1}/topics".FormatUri(owner, name);
}
///
/// Returns the for repository topics.
///
/// The ID of the repository
/// the for repository topics.
public static Uri RepositoryTopics(long repositoryId)
{
return "repositories/{0}/topics".FormatUri(repositoryId);
}
///
/// Returns the for repository languages.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryLanguages(string owner, string name)
{
return "repos/{0}/{1}/languages".FormatUri(owner, name);
}
///
/// Returns the for repository teams.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryTeams(string owner, string name)
{
return "repos/{0}/{1}/teams".FormatUri(owner, name);
}
///
/// Returns the for repository tags.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryTags(string owner, string name)
{
return "repos/{0}/{1}/tags".FormatUri(owner, name);
}
///
/// Returns the for a repository transfer.
///
/// The current owner of the repository
/// The name of the repository
///
public static Uri RepositoryTransfer(string owner, string name)
{
return "repos/{0}/{1}/transfer".FormatUri(owner, name);
}
///
/// Returns the for a repository transfer.
///
/// The id of the repository
///
public static Uri RepositoryTransfer(long repositoryId)
{
return "repositories/{0}/transfer".FormatUri(repositoryId);
}
///
/// Returns the for repository commits.
///
/// The owner of the repository
/// The name of the repository
/// The commit reference (SHA)
///
public static Uri RepositoryCommit(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}".FormatUri(owner, name, reference);
}
///
/// Returns the for repository commits.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryCommits(string owner, string name)
{
return "repos/{0}/{1}/commits".FormatUri(owner, name);
}
///repos/{owner}/{repo}/commits/{commit_sha}/
///
/// Returns the that lists all branches where the given commit SHA is the HEAD, or latest commit for the branch.
///
/// The owner of the repository
/// The name of the repository
/// The commit reference (SHA)
///
public static Uri RepositoryCommitsBranchesWhereHead(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}/branches-where-head".FormatUri(owner, name, reference);
}
///
/// Returns the that lists all branches where the given commit SHA is the HEAD, or latest commit for the branch.
///
/// The Id of the repository
/// The commit reference (SHA)
///
public static Uri RepositoryCommitsBranchesWhereHead(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/branches-where-head".FormatUri(repositoryId, reference);
}
///
/// Returns the that lists the check suites for the specified reference.
///
/// The owner of the repository
/// The name of the repository
/// The commit reference (SHA)
///
public static Uri RepositoryCommitsPull(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}/pulls".FormatUri(owner, name, reference);
}
///
/// Returns the that lists the check suites for the specified reference.
///
/// The Id of the repository
/// The commit reference (SHA)
///
public static Uri RepositoryCommitsPull(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/pulls".FormatUri(repositoryId, reference);
}
///
/// Returns the for comparing two commits.
///
/// The owner of the repository
/// The name of the repository
/// The base commit
/// The head commit
///
public static Uri RepoCompare(string owner, string name, string @base, string head)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNullOrEmptyString(@base, nameof(@base));
Ensure.ArgumentNotNullOrEmptyString(head, nameof(head));
var encodedBase = @base.UriEncode();
var encodedHead = head.UriEncode();
return "repos/{0}/{1}/compare/{2}...{3}".FormatUri(owner, name, encodedBase, encodedHead);
}
///
/// Returns the for a repository branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoBranch(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}".FormatUri(owner, name, branchName);
}
///
/// Returns the for a repository branches protection.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoBranchProtection(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection".FormatUri(owner, name, branchName);
}
///
/// Returns the for a repository branches protection.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoBranchProtection(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection".FormatUri(repositoryId, branchName);
}
///
/// Returns the for required status checks for a protected branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoRequiredStatusChecks(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/required_status_checks".FormatUri(owner, name, branchName);
}
///
/// Returns the for required status checks for a protected branch.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoRequiredStatusChecks(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/required_status_checks".FormatUri(repositoryId, branchName);
}
///
/// Returns the for required status checks for a protected branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoRequiredStatusChecksContexts(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/required_status_checks/contexts".FormatUri(owner, name, branchName);
}
///
/// Returns the for required status checks for a protected branch.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoRequiredStatusChecksContexts(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/required_status_checks/contexts".FormatUri(repositoryId, branchName);
}
///
/// Returns the for required_pull_request_reviews for a protected branch
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
public static Uri RepoProtectedBranchReviewEnforcement(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/required_pull_request_reviews".FormatUri(owner, name, branchName);
}
///
/// Returns the for required_pull_request_reviews for a protected branch
///
/// The Id of the repository
/// The name of the branch
public static Uri RepoProtectedBranchReviewEnforcement(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/required_pull_request_reviews".FormatUri(repositoryId, branchName);
}
///
/// Returns the for admin enforcement for a protected branch
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
public static Uri RepoProtectedBranchAdminEnforcement(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/enforce_admins".FormatUri(owner, name, branchName);
}
///
/// Returns the for admin enforcement for a protected branch
///
/// The Id of the repository
/// The name of the branch
public static Uri RepoProtectedBranchAdminEnforcement(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/enforce_admins".FormatUri(repositoryId, branchName);
}
///
/// Returns the for restrictions for a protected branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoRestrictions(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/restrictions".FormatUri(owner, name, branchName);
}
///
/// Returns the for restrictions for a protected branch.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoRestrictions(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/restrictions".FormatUri(repositoryId, branchName);
}
///
/// Returns the for team restrictions for a protected branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoRestrictionsTeams(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/restrictions/teams".FormatUri(owner, name, branchName);
}
///
/// Returns the for team restrictions for a protected branch.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoRestrictionsTeams(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/restrictions/teams".FormatUri(repositoryId, branchName);
}
///
/// Returns the for user restrictions for a protected branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch
///
public static Uri RepoRestrictionsUsers(string owner, string name, string branchName)
{
return "repos/{0}/{1}/branches/{2}/protection/restrictions/users".FormatUri(owner, name, branchName);
}
///
/// Returns the for user restrictions for a protected branch.
///
/// The Id of the repository
/// The name of the branch
///
public static Uri RepoRestrictionsUsers(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}/protection/restrictions/users".FormatUri(repositoryId, branchName);
}
///
/// Returns the for a repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri Repository(string owner, string name)
{
return "repos/{0}/{1}".FormatUri(owner, name);
}
///
/// Returns the for a deploy key for a repository
///
/// The owner of the repository
/// The name of the repository
/// The id of the deploy key of the repository
///
public static Uri RepositoryDeployKey(string owner, string name, int number)
{
return "repos/{0}/{1}/keys/{2}".FormatUri(owner, name, number);
}
///
/// Returns the for deploy keys for a repository.
///
/// The owner of the repository
/// The name of the repository
///
public static Uri RepositoryDeployKeys(string owner, string name)
{
return "repos/{0}/{1}/keys".FormatUri(owner, name);
}
///
/// Returns the for checking vulnerability alerts for a repository.
///
///
///
///
public static Uri RepositoryVulnerabilityAlerts(string owner, string name)
{
return "repos/{0}/{1}/vulnerability-alerts".FormatUri(owner, name);
}
///
/// Returns the for the Deployments API for the given repository.
///
/// Owner of the repository
/// Name of the repository
/// The for the Deployments API for the given repository.
public static Uri Deployments(string owner, string name)
{
return "repos/{0}/{1}/deployments".FormatUri(owner, name);
}
///
/// Returns the for the Deployment Environments API for the given repository.
///
/// Owner of the repository
/// Name of the repository
/// The for the Deployments API for the given repository.
public static Uri DeploymentEnvironments(string owner, string name)
{
return "repos/{0}/{1}/environments".FormatUri(owner, name);
}
///
/// Returns the for the Deployment Statuses API for the given deployment.
///
/// Owner of the repository
/// Name of the repository
/// Id of the deployment
///
public static Uri DeploymentStatuses(string owner, string name, int deploymentId)
{
return "repos/{0}/{1}/deployments/{2}/statuses".FormatUri(owner, name, deploymentId);
}
///
/// Creates the relative for retrieving the
/// current users followers
///
/// The for retrieving the current users followers
public static Uri Followers()
{
return "user/followers".FormatUri();
}
///
/// Creates the relative for retrieving
/// the followers for the specified user
///
/// name of the user
/// The for retrieving the specified users followers
public static Uri Followers(string login)
{
return "users/{0}/followers".FormatUri(login);
}
///
/// Creates the relative for retrieving the users the current user follows
///
/// The for retrieving the users the current user follows
public static Uri Following()
{
return "user/following".FormatUri();
}
///
/// Creates the relative for retrieving the users the specified user follows
///
/// name of the user
/// The for retrieving the users the specified user follows
public static Uri Following(string login)
{
return "users/{0}/following".FormatUri(login);
}
///
/// Creates the relative for checking is the current user is following
/// another user
///
/// name of the user followed
/// The for checking if the current user follows the specified user.
public static Uri IsFollowing(string following)
{
return "user/following/{0}".FormatUri(following);
}
///
/// Creates the relative for checking if a user is following another user
///
/// name of the user following
/// name of the user followed
/// The for checking if the specified user follows another user
public static Uri IsFollowing(string login, string following)
{
return "users/{0}/following/{1}".FormatUri(login, following);
}
///
/// Returns the for the user for the given login
///
/// Name of the user
/// The for the user for the given login
public static Uri User(string login)
{
return "users/{0}".FormatUri(login);
}
///
/// Creates the relative for initiating the OAuth Web login Flow
///
///
public static Uri OauthAuthorize()
{
return "login/oauth/authorize".FormatUri();
}
///
/// Creates the relative for initiating the OAuth device Flow
///
///
public static Uri OauthDeviceCode()
{
return "login/device/code".FormatUri();
}
///
/// Creates the relative to request an OAuth access token.
///
///
public static Uri OauthAccessToken()
{
return "login/oauth/access_token".FormatUri();
}
///
/// Creates the relative for getting the README of the specified repository
///
/// The owner of the repository
/// The name of the repository
/// The for getting the README of the specified repository
public static Uri RepositoryReadme(string owner, string name)
{
return "repos/{0}/{1}/readme".FormatUri(owner, name);
}
///
/// Creates the relative for getting the contents of the specified repository's root
///
/// The owner of the repository
/// The name of the repository
/// The for getting the contents of the specified repository's root
public static Uri RepositoryContent(string owner, string name)
{
return "repos/{0}/{1}/contents".FormatUri(owner, name);
}
///
/// Creates the relative for getting the contents of the specified repository and path
///
/// The owner of the repository
/// The name of the repository
/// The path of the contents to get
/// The for getting the contents of the specified repository and path
public static Uri RepositoryContent(string owner, string name, string path)
{
return "repos/{0}/{1}/contents/{2}".FormatUri(owner, name, path);
}
///
/// Creates the relative for getting an archive of a given repository's contents, in a specific format
///
/// The owner of the repository
/// The name of the repository
/// The format of the archive. Can be either tarball or zipball
/// A valid Git reference.
/// The for getting an archive of a given repository's contents, in a specific format
public static Uri RepositoryArchiveLink(string owner, string name, ArchiveFormat archiveFormat, string reference)
{
return "repos/{0}/{1}/{2}/{3}".FormatUri(owner, name, archiveFormat.ToParameter(), reference);
}
///
/// Creates the relative for getting the contents of the specified repository and path
///
/// The owner of the repository
/// The name of the repository
/// The path of the contents to get
/// The name of the commit/branch/tag. Default: the repository’s default branch (usually main)
/// The for getting the contents of the specified repository and path
public static Uri RepositoryContent(string owner, string name, string path, string reference)
{
return "repos/{0}/{1}/contents/{2}?ref={3}".FormatUri(owner, name, path == "/" ? "" : path.TrimEnd('/'), reference);
}
///
/// Creates the relative for getting the page metadata for a given repository
///
/// The owner of the repository
/// The name of the repository
/// The for getting the page metadata for a given repository
public static Uri RepositoryPage(string owner, string name)
{
return "repos/{0}/{1}/pages".FormatUri(owner, name);
}
///
/// Creates the relative for getting all build metadata for a given repository
///
/// The owner of the repository
/// The name of the repository
/// The for getting all build metadata for a given repository
public static Uri RepositoryPageBuilds(string owner, string name)
{
return "repos/{0}/{1}/pages/builds".FormatUri(owner, name);
}
///
/// Creates the relative for getting the build metadata for the last build for a given repository
///
/// The owner of the repository
/// The name of the repository
/// The for getting the build metadata for the last build for a given repository
public static Uri RepositoryPageBuildsLatest(string owner, string name)
{
return "repos/{0}/{1}/pages/builds/latest".FormatUri(owner, name);
}
///
/// Returns the for the contributors for the given repository
///
/// Owner of the repository
/// Name of the repository
/// The for the contributors for the given repository
public static Uri StatsContributors(string owner, string name)
{
return "repos/{0}/{1}/stats/contributors".FormatUri(owner, name);
}
///
/// Returns the for the commit activity for the given repository
///
/// Owner of the repository
/// Name of the repository
/// The for the commit activity for the given repository
public static Uri StatsCommitActivity(string owner, string name)
{
return "repos/{0}/{1}/stats/commit_activity".FormatUri(owner, name);
}
///
/// Returns the for the code frequency for the given repository
///
/// Owner of the repository
/// Name of the repository
/// The for the code frequency for the given repository
public static Uri StatsCodeFrequency(string owner, string name)
{
return "repos/{0}/{1}/stats/code_frequency".FormatUri(owner, name);
}
///
/// Returns the for the participation for the given repository
///
/// Owner of the repository
/// Name of the repository
/// The for the participation for the given repository
public static Uri StatsParticipation(string owner, string name)
{
return "repos/{0}/{1}/stats/participation".FormatUri(owner, name);
}
///
/// Returns the for the punch card for the given repository
///
/// Owner of the repository
/// Name of the repository
/// The for the punch card for the given repository
public static Uri StatsPunchCard(string owner, string name)
{
return "repos/{0}/{1}/stats/punch_card".FormatUri(owner, name);
}
public static Uri EnterpriseAuditLog(string enterprise)
{
return "enterprises/{0}/audit-log".FormatUri(enterprise);
}
private static Uri EnterpriseAdminStats(string type)
{
return "enterprise/stats/{0}".FormatUri(type);
}
public static Uri EnterpriseAdminStatsIssues()
{
return EnterpriseAdminStats("issues");
}
public static Uri EnterpriseAdminStatsHooks()
{
return EnterpriseAdminStats("hooks");
}
public static Uri EnterpriseAdminStatsMilestones()
{
return EnterpriseAdminStats("milestones");
}
public static Uri EnterpriseAdminStatsOrgs()
{
return EnterpriseAdminStats("orgs");
}
public static Uri EnterpriseAdminStatsComments()
{
return EnterpriseAdminStats("comments");
}
public static Uri EnterpriseAdminStatsPages()
{
return EnterpriseAdminStats("pages");
}
public static Uri EnterpriseAdminStatsUsers()
{
return EnterpriseAdminStats("users");
}
public static Uri EnterpriseAdminStatsGists()
{
return EnterpriseAdminStats("gists");
}
public static Uri EnterpriseAdminStatsPulls()
{
return EnterpriseAdminStats("pulls");
}
public static Uri EnterpriseAdminStatsRepos()
{
return EnterpriseAdminStats("repos");
}
public static Uri EnterpriseAdminStatsAll()
{
return EnterpriseAdminStats("all");
}
public static Uri EnterpriseLdapTeamMapping(int teamId)
{
return "admin/ldap/teams/{0}/mapping".FormatUri(teamId);
}
public static Uri EnterpriseLdapTeamSync(int teamId)
{
return "admin/ldap/teams/{0}/sync".FormatUri(teamId);
}
public static Uri EnterpriseLdapUserMapping(string userName)
{
return "admin/ldap/users/{0}/mapping".FormatUri(userName);
}
public static Uri EnterpriseLdapUserSync(string userName)
{
return "admin/ldap/users/{0}/sync".FormatUri(userName);
}
public static Uri EnterpriseLicense()
{
return "enterprise/settings/license".FormatUri();
}
public static Uri EnterpriseMigrationById(string org, int migrationId)
{
return "orgs/{0}/migrations/{1}".FormatUri(org, migrationId);
}
public static Uri EnterpriseMigrations(string org)
{
return "orgs/{0}/migrations".FormatUri(org);
}
public static Uri EnterpriseMigrationArchive(string org, int migrationId)
{
return "orgs/{0}/migrations/{1}/archive".FormatUri(org, migrationId);
}
public static Uri EnterpriseMigrationUnlockRepository(string org, int migrationId, string repo)
{
return "orgs/{0}/migrations/{1}/repos/{2}/lock".FormatUri(org, migrationId, repo);
}
public static Uri EnterpriseManagementConsoleMaintenance(string managementConsolePassword, Uri baseAddress)
{
if (baseAddress != null
&& baseAddress.ToString().EndsWith("/api/v3/", StringComparison.OrdinalIgnoreCase))
{
// note: leading slash here means the /api/v3/ prefix inherited from baseAddress is ignored
return "/setup/api/maintenance?api_key={0}".FormatUri(managementConsolePassword);
}
return "setup/api/maintenance?api_key={0}".FormatUri(managementConsolePassword);
}
public static Uri EnterpriseOrganization()
{
return "admin/organizations".FormatUri();
}
public static Uri EnterpriseSearchIndexing()
{
return "staff/indexing_jobs".FormatUri();
}
public static Uri UserAdministration()
{
return "admin/users".FormatUri();
}
public static Uri UserAdministration(string login)
{
return "admin/users/{0}".FormatUri(login);
}
public static Uri UserAdministrationAuthorization(string login)
{
return "admin/users/{0}/authorizations".FormatUri(login);
}
public static Uri UserAdministrationPublicKeys()
{
return "admin/keys".FormatUri();
}
public static Uri UserAdministrationPublicKeys(int keyId)
{
return "admin/keys/{0}".FormatUri(keyId);
}
///
/// Creates the for pre-receive environments.
///
///
public static Uri AdminPreReceiveEnvironments()
{
return "admin/pre-receive-environments".FormatUri();
}
///
/// Creates the for pre-receive environments.
///
///
public static Uri AdminPreReceiveEnvironments(long environmentId)
{
return "admin/pre-receive-environments/{0}".FormatUri(environmentId);
}
///
/// Creates the for pre-receive environment download status.
///
///
public static Uri AdminPreReceiveEnvironmentDownload(long environmentId)
{
return "admin/pre-receive-environments/{0}/downloads".FormatUri(environmentId);
}
///
/// Creates the for pre-receive environment download status.
///
///
public static Uri AdminPreReceiveEnvironmentDownloadStatus(long environmentId)
{
return "admin/pre-receive-environments/{0}/downloads/latest".FormatUri(environmentId);
}
///
/// Creates the for pre-receive hooks.
///
///
public static Uri AdminPreReceiveHooks()
{
return "admin/pre-receive-hooks".FormatUri();
}
///
/// Creates the for pre-receive hooks.
///
///
public static Uri AdminPreReceiveHooks(long hookId)
{
return "admin/pre-receive-hooks/{0}".FormatUri(hookId);
}
///
/// Creates the relative for altering administration status of a user.
///
/// The login for the intended user.
///
public static Uri UserAdministrationSiteAdmin(string login)
{
return "users/{0}/site_admin".FormatUri(login);
}
///
/// Creates the relative for altering suspension status of a user.
///
/// The login for the intended user.
///
public static Uri UserAdministrationSuspension(string login)
{
return "users/{0}/suspended".FormatUri(login);
}
///
/// Returns the that returns the assets specified by the asset id.
///
/// The Id of the repository
/// The id of the release asset
/// The that returns the assets specified by the asset id.
public static Uri Asset(long repositoryId, int releaseAssetId)
{
return "repositories/{0}/releases/assets/{1}".FormatUri(repositoryId, releaseAssetId);
}
///
/// Returns the that returns all of the assignees to which issues may be assigned.
///
/// The Id of the repository
/// The that returns all of the assignees to which issues may be assigned.
public static Uri Assignees(long repositoryId)
{
return "repositories/{0}/assignees".FormatUri(repositoryId);
}
///
/// Returns the for a specific blob.
///
/// The Id of the repository
/// The for a specific blob.
public static Uri Blobs(long repositoryId)
{
return Blob(repositoryId, "");
}
///
/// Returns the for a specific blob.
///
/// The Id of the repository
/// The SHA of the blob
/// The for a specific blob.
public static Uri Blob(long repositoryId, string reference)
{
string blob = "repositories/{0}/git/blobs";
if (!string.IsNullOrEmpty(reference))
{
blob += "/{1}";
}
return blob.FormatUri(repositoryId, reference);
}
///
/// Returns the that returns a 204 if the login belongs to an assignee of the repository. Otherwise returns a 404.
///
/// The Id of the repository
/// The login for the user
/// The that returns a 204 if the login belongs to an assignee of the repository. Otherwise returns a 404.
public static Uri CheckAssignee(long repositoryId, string login)
{
return "repositories/{0}/assignees/{1}".FormatUri(repositoryId, login);
}
///
/// Returns the that returns a combined view of commit statuses for the specified reference.
///
/// The Id of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
/// The that returns a combined view of commit statuses for the specified reference.
public static Uri CombinedCommitStatus(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/status".FormatUri(repositoryId, reference);
}
///
/// Returns the for the specified commit.
///
/// The Id of the repository
/// The commit reference (SHA)
/// The for the specified commit.
public static Uri Commit(long repositoryId, string reference)
{
return "repositories/{0}/git/commits/{1}".FormatUri(repositoryId, reference);
}
///
/// Returns the for the specified comment.
///
/// The Id of the repository
/// The comment id
/// The for the specified comment.
public static Uri CommitComment(long repositoryId, long commentId)
{
return "repositories/{0}/comments/{1}".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the comments of a specified commit.
///
/// The Id of the repository
/// The sha of the commit
/// The for the comments of a specified commit.
public static Uri CommitComments(long repositoryId, string sha)
{
return "repositories/{0}/commits/{1}/comments".FormatUri(repositoryId, sha);
}
///
/// Returns the for the comments of a specified commit.
///
/// The Id of the repository
/// The for the comments of a specified commit.
public static Uri CommitComments(long repositoryId)
{
return "repositories/{0}/comments".FormatUri(repositoryId);
}
///
/// Returns the that lists the commit statuses for the specified reference.
///
/// The Id of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
/// The that lists the commit statuses for the specified reference.
public static Uri CommitStatuses(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/statuses".FormatUri(repositoryId, reference);
}
///
/// Returns the for creating a commit object.
///
/// The Id of the repository
/// The for creating a commit object.
public static Uri CreateCommit(long repositoryId)
{
return "repositories/{0}/git/commits".FormatUri(repositoryId);
}
///
/// Returns the to use when creating a commit status for the specified reference.
///
/// The Id of the repository
/// The reference (SHA, branch name, or tag name) to list commits for
/// The to use when creating a commit status for the specified reference.
public static Uri CreateCommitStatus(long repositoryId, string reference)
{
return "repositories/{0}/statuses/{1}".FormatUri(repositoryId, reference);
}
///
/// Returns the for creating a merge object.
///
/// The Id of the repository
/// The for creating a merge object.
public static Uri CreateMerge(long repositoryId)
{
return "repositories/{0}/merges".FormatUri(repositoryId);
}
///
/// Returns the for creating a tag object.
///
/// The Id of the repository
/// The for creating a tag object.
public static Uri CreateTag(long repositoryId)
{
return "repositories/{0}/git/tags".FormatUri(repositoryId);
}
///
/// Returns the for the Deployments API for the given repository.
///
/// The Id of the repository
/// The for the Deployments API for the given repository.
public static Uri Deployments(long repositoryId)
{
return "repositories/{0}/deployments".FormatUri(repositoryId);
}
///
/// Returns the for the Deployment Environments API for the given repository.
///
/// The Id of the repository
/// The for the Deployments API for the given repository.
public static Uri DeploymentEnvironments(long repositoryId)
{
return "repositories/{0}/environments".FormatUri(repositoryId);
}
///
/// Returns the for the Deployment Statuses API for the given deployment.
///
/// The Id of the repository
/// Id of the deployment
/// The for the Deployment Statuses API for the given deployment.
public static Uri DeploymentStatuses(long repositoryId, int deploymentId)
{
return "repositories/{0}/deployments/{1}/statuses".FormatUri(repositoryId, deploymentId);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified repository.
///
/// The Id of the repository
/// The that returns the issue/pull request event and issue info for the specified repository.
public static Uri Events(long repositoryId)
{
return "repositories/{0}/events".FormatUri(repositoryId);
}
///
/// Returns the that returns all the GPG Keys for the authenticated user.
///
/// The that returns all the GPG Keys for the authenticated user.
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpg")]
public static Uri GpgKeys()
{
return _currentUserGpgKeys;
}
///
/// Returns the that returns the GPG Key for the authenticated user for the specified Id.
///
/// The GPG Key Id.
///
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpg")]
public static Uri GpgKeys(int gpgKeyId)
{
return "user/gpg_keys/{0}".FormatUri(gpgKeyId);
}
///
/// Returns the for the specified issue.
///
/// The Id of the repository
/// The issue number
/// The for the specified issue.
public static Uri Issue(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}".FormatUri(repositoryId, number);
}
///
/// Returns the for the specified comment.
///
/// The Id of the repository
/// The comment id
/// The for the specified comment.
public static Uri IssueComment(long repositoryId, long commentId)
{
return "repositories/{0}/issues/comments/{1}".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the comments for all issues in a specific repo.
///
/// The Id of the repository
/// The for the comments for all issues in a specific repo.
public static Uri IssueComments(long repositoryId)
{
return "repositories/{0}/issues/comments".FormatUri(repositoryId);
}
///
/// Returns the for the comments of a specified issue.
///
/// The Id of the repository
/// The issue number
/// The for the comments of a specified issue.
public static Uri IssueComments(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/comments".FormatUri(repositoryId, number);
}
///
/// Returns the that returns the named label for the specified issue.
///
/// The Id of the repository
/// The issue number
/// The name of the label
/// The that returns the named label for the specified issue.
public static Uri IssueLabel(long repositoryId, int number, string labelName)
{
return "repositories/{0}/issues/{1}/labels/{2}".FormatUri(repositoryId, number, labelName);
}
///
/// Returns the that returns all of the labels for the specified issue.
///
/// The Id of the repository
/// The issue number
/// The that returns all of the labels for the specified issue.
public static Uri IssueLabels(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/labels".FormatUri(repositoryId, number);
}
///
/// Returns the for the specified issue to be locked/unlocked.
///
/// The Id of the repository
/// The issue number
/// The for the specified issue to be locked/unlocked.
public static Uri IssueLock(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/lock".FormatUri(repositoryId, number);
}
///
/// Returns the that returns all of the issues for the currently logged in user specific to the repository.
///
/// The Id of the repository
/// The that returns all of the issues for the currently logged in user specific to the repository.
public static Uri Issues(long repositoryId)
{
return "repositories/{0}/issues".FormatUri(repositoryId);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified event.
///
/// The Id of the repository
/// The event id
/// The that returns the issue/pull request event and issue info for the specified event.
public static Uri IssuesEvent(long repositoryId, long eventId)
{
return "repositories/{0}/issues/events/{1}".FormatUri(repositoryId, eventId);
}
///
/// Returns the that returns the issue/pull request event info for the specified issue.
///
/// The Id of the repository
/// The issue number
/// The that returns the issue/pull request event info for the specified issue.
public static Uri IssuesEvents(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/events".FormatUri(repositoryId, number);
}
///
/// Returns the that returns the issue/pull request event and issue info for the specified repository.
///
/// The Id of the repository
/// The that returns the issue/pull request event and issue info for the specified repository.
public static Uri IssuesEvents(long repositoryId)
{
return "repositories/{0}/issues/events".FormatUri(repositoryId);
}
///
/// Returns the that returns the specified label.
///
/// The Id of the repository
/// The name of label
/// The that returns the specified label.
public static Uri Label(long repositoryId, string labelName)
{
return "repositories/{0}/labels/{1}".FormatUri(repositoryId, labelName);
}
///
/// Returns the that returns all of the labels for the specified repository.
///
/// The Id of the repository
/// The that returns all of the labels for the specified repository.
public static Uri Labels(long repositoryId)
{
return "repositories/{0}/labels".FormatUri(repositoryId);
}
///
/// Returns the that returns the latest release for the specified repository
///
/// The Id of the repository
/// The that returns the latest release for the specified repository
public static Uri LatestRelease(long repositoryId)
{
return "repositories/{0}/releases/latest".FormatUri(repositoryId);
}
///
/// Returns the that returns the pull request merge state.
///
/// The Id of the repository
/// The pull request number
/// The that returns the pull request merge state.
public static Uri MergePullRequest(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/merge".FormatUri(repositoryId, number);
}
///
/// Returns the that returns the specified milestone.
///
/// The Id of the repository
/// The milestone number
/// The that returns the specified milestone.
public static Uri Milestone(long repositoryId, int number)
{
return "repositories/{0}/milestones/{1}".FormatUri(repositoryId, number);
}
///
/// Returns the that returns all of the labels for all issues in the specified milestone.
///
/// The Id of the repository
/// The milestone number
/// The that returns all of the labels for all issues in the specified milestone.
public static Uri MilestoneLabels(long repositoryId, int number)
{
return "repositories/{0}/milestones/{1}/labels".FormatUri(repositoryId, number);
}
///
/// Returns the that returns all of the milestones for the specified repository.
///
/// The Id of the repository
/// The that returns all of the milestones for the specified repository.
public static Uri Milestones(long repositoryId)
{
return "repositories/{0}/milestones".FormatUri(repositoryId);
}
///
/// Returns the that returns all of the notifications for the currently logged in user specific to the repository.
///
/// The Id of the repository
/// The that returns all of the notifications for the currently logged in user specific to the repository.
public static Uri Notifications(long repositoryId)
{
return "repositories/{0}/notifications".FormatUri(repositoryId);
}
///
/// Returns the that returns the specified pull request.
///
/// The Id of the repository
/// The pull request number
/// The that returns the specified pull request.
public static Uri PullRequest(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}".FormatUri(repositoryId, number);
}
///
/// Returns the that returns the commits on a pull request.
///
/// The Id of the repository
/// The pull request number
/// The that returns the commits on a pull request.
public static Uri PullRequestCommits(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/commits".FormatUri(repositoryId, number);
}
///
/// Returns the that returns the files on a pull request.
///
/// The Id of the repository
/// The pull request number
/// The that returns the files on a pull request.
public static Uri PullRequestFiles(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/files".FormatUri(repositoryId, number);
}
///
/// Returns the for the specified pull request review comment.
///
/// The Id of the repository
/// The comment id
/// The that
public static Uri PullRequestReviewComment(long repositoryId, long commentId)
{
return "repositories/{0}/pulls/comments/{1}".FormatUri(repositoryId, commentId);
}
///
/// Returns the for the comments of a specified pull request review.
///
/// The Id of the repository
/// The pull request number
/// The that
public static Uri PullRequestReviewComments(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/comments".FormatUri(repositoryId, number);
}
///
/// Returns the for the reviews of a specified pull request
///
/// The Id of the repository
/// The pull request number
/// The that
public static Uri PullRequestReviews(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/reviews".FormatUri(repositoryId, number);
}
///
/// Returns the for the pull request review comments on a specified repository.
///
/// The Id of the repository
/// The that
public static Uri PullRequestReviewCommentsRepository(long repositoryId)
{
return "repositories/{0}/pulls/comments".FormatUri(repositoryId);
}
///
/// Returns the that lists the pull requests for a repository.
///
/// The Id of the repository
/// The that lists the pull requests for a repository.
public static Uri PullRequests(long repositoryId)
{
return "repositories/{0}/pulls".FormatUri(repositoryId);
}
///
/// Returns the for the specified reference.
///
/// The Id of the repository
/// The for the specified reference.
public static Uri Reference(long repositoryId)
{
return "repositories/{0}/git/refs".FormatUri(repositoryId);
}
///
/// Returns the for the specified reference.
///
/// The Id of the repository
/// The reference name
/// The for the specified reference.
public static Uri Reference(long repositoryId, string referenceName)
{
return "repositories/{0}/git/refs/{1}".FormatUri(repositoryId, referenceName);
}
///
/// Returns the that returns all the assets for the specified release for the specified repository.
///
/// The Id of the repository
/// The id of the release
/// The that returns all the assets for the specified release for the specified repository.
public static Uri ReleaseAssets(long repositoryId, int releaseId)
{
return "repositories/{0}/releases/{1}/assets".FormatUri(repositoryId, releaseId);
}
///
/// Returns the that returns all of the releases for the specified repository.
///
/// The Id of the repository
/// The that returns all of the releases for the specified repository.
public static Uri Releases(long repositoryId)
{
return "repositories/{0}/releases".FormatUri(repositoryId);
}
///
/// Returns the that generates release notes for the specified repository.
///
/// The Id of the repository
/// The that generates release notes for the specified repository.
public static Uri ReleasesGenerateNotes(long repositoryId)
{
return "repositories/{0}/releases/generate-notes".FormatUri(repositoryId);
}
///
/// Returns the that returns a single release for the specified repository
///
/// The Id of the repository
/// The id of the release
/// The that returns a single release for the specified repository
public static Uri Releases(long repositoryId, int releaseId)
{
return "repositories/{0}/releases/{1}".FormatUri(repositoryId, releaseId);
}
///
/// Returns the that returns a single release for the specified repository
///
/// The Id of the repository
/// The tag of the release
/// The that returns a single release for the specified repository
public static Uri Releases(long repositoryId, string tag)
{
return "repositories/{0}/releases/tags/{1}".FormatUri(repositoryId, tag);
}
///
/// Returns the for a repository branch.
///
/// The Id of the repository
/// The name of the branch
/// The for a repository branch.
public static Uri RepoBranch(long repositoryId, string branchName)
{
return "repositories/{0}/branches/{1}".FormatUri(repositoryId, branchName);
}
///
/// Returns the that returns all of the branches for the specified repository.
///
/// The Id of the repository
/// The that returns all of the branches for the specified repository.
public static Uri RepoBranches(long repositoryId)
{
return "repositories/{0}/branches".FormatUri(repositoryId);
}
///
/// Returns the that returns all of the collaborators for the specified repository.
///
/// The Id of the repository
/// The that returns all of the collaborators for the specified repository.
public static Uri RepoCollaborators(long repositoryId)
{
return "repositories/{0}/collaborators".FormatUri(repositoryId);
}
///
/// Returns the for comparing two commits.
///
/// The Id of the repository
/// The base commit
/// The head commit
/// The for comparing two commits.
public static Uri RepoCompare(long repositoryId, string @base, string head)
{
Ensure.ArgumentNotNullOrEmptyString(@base, nameof(@base));
Ensure.ArgumentNotNullOrEmptyString(head, nameof(head));
var encodedBase = @base.UriEncode();
var encodedHead = head.UriEncode();
return "repositories/{0}/compare/{1}...{2}".FormatUri(repositoryId, encodedBase, encodedHead);
}
///
/// Returns the for a repository.
///
/// The Id of the repository
/// The for a repository.
public static Uri Repository(long repositoryId)
{
return "repositories/{0}".FormatUri(repositoryId);
}
///
/// Returns the for getting an archive of a given repository's contents, in a specific format
///
/// The Id of the repository
/// The format of the archive. Can be either tarball or zipball
/// A valid Git reference.
/// The for getting an archive of a given repository's contents, in a specific format
public static Uri RepositoryArchiveLink(long repositoryId, ArchiveFormat archiveFormat, string reference)
{
return "repositories/{0}/{1}/{2}".FormatUri(repositoryId, archiveFormat.ToParameter(), reference);
}
///
/// Returns the for repository commits.
///
/// The Id of the repository
/// The commit reference (SHA)
/// The for repository commits.
public static Uri RepositoryCommit(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}".FormatUri(repositoryId, reference);
}
///
/// Returns the for repository commits.
///
/// The Id of the repository
/// The for repository commits.
public static Uri RepositoryCommits(long repositoryId)
{
return "repositories/{0}/commits".FormatUri(repositoryId);
}
///
/// Returns the for getting the contents of the specified repository's root
///
/// The Id of the repository
/// The for getting the contents of the specified repository's root
public static Uri RepositoryContent(long repositoryId)
{
return "repositories/{0}/contents".FormatUri(repositoryId);
}
///
/// Returns the for getting the contents of the specified repository and path
///
/// The Id of the repository
/// The path of the contents to get
/// The for getting the contents of the specified repository and path
public static Uri RepositoryContent(long repositoryId, string path)
{
return "repositories/{0}/contents/{1}".FormatUri(repositoryId, path);
}
///
/// Returns the for getting the contents of the specified repository and path
///
/// The Id of the repository
/// The path of the contents to get
/// The name of the commit/branch/tag. Default: the repository’s default branch (usually main)
/// The for getting the contents of the specified repository and path
public static Uri RepositoryContent(long repositoryId, string path, string reference)
{
return "repositories/{0}/contents/{1}?ref={2}".FormatUri(repositoryId, path.TrimEnd('/'), reference);
}
///
/// Returns the for repository contributors.
///
/// The Id of the repository
/// The for repository contributors.
public static Uri RepositoryContributors(long repositoryId)
{
return "repositories/{0}/contributors".FormatUri(repositoryId);
}
///
/// Returns the for a deploy key for a repository
///
/// The Id of the repository
/// The id of the deploy key of the repository
/// The for a deploy key for a repository
public static Uri RepositoryDeployKey(long repositoryId, int number)
{
return "repositories/{0}/keys/{1}".FormatUri(repositoryId, number);
}
///
/// Returns the for deploy keys for a repository.
///
/// The Id of the repository
/// The for deploy keys for a repository.
public static Uri RepositoryDeployKeys(long repositoryId)
{
return "repositories/{0}/keys".FormatUri(repositoryId);
}
///
/// Returns the that lists the repository forks for the specified reference.
///
/// The Id of the repository
/// The that lists the repository forks for the specified reference.
public static Uri RepositoryForks(long repositoryId)
{
return "repositories/{0}/forks".FormatUri(repositoryId);
}
///
/// Returns the that gets the repository hook for the specified reference.
///
/// The Id of the repository
/// The identifier of the repository hook
/// The that gets the repository hook for the specified reference.
public static Uri RepositoryHookById(long repositoryId, int hookId)
{
return "repositories/{0}/hooks/{1}".FormatUri(repositoryId, hookId);
}
///
/// Returns the that can ping a specified repository hook
///
/// The Id of the repository
/// The identifier of the repository hook
/// The that can ping a specified repository hook
public static Uri RepositoryHookPing(long repositoryId, int hookId)
{
return "repositories/{0}/hooks/{1}/pings".FormatUri(repositoryId, hookId);
}
///
/// Returns the that lists the repository hooks for the specified reference.
///
/// The Id of the repository
/// The that lists the repository hooks for the specified reference.
public static Uri RepositoryHooks(long repositoryId)
{
return "repositories/{0}/hooks".FormatUri(repositoryId);
}
///
/// Returns the that can tests a specified repository hook
///
/// The Id of the repository
/// The identifier of the repository hook
/// The that can tests a specified repository hook
public static Uri RepositoryHookTest(long repositoryId, int hookId)
{
return "repositories/{0}/hooks/{1}/tests".FormatUri(repositoryId, hookId);
}
///
/// Returns the for repository languages.
///
/// The Id of the repository
/// The for repository languages.
public static Uri RepositoryLanguages(long repositoryId)
{
return "repositories/{0}/languages".FormatUri(repositoryId);
}
///
/// Returns the for getting the page metadata for a given repository
///
/// The Id of the repository
/// The for getting the page metadata for a given repository
public static Uri RepositoryPage(long repositoryId)
{
return "repositories/{0}/pages".FormatUri(repositoryId);
}
///
/// Returns the for getting all build metadata for a given repository
///
/// The Id of the repository
/// The for getting all build metadata for a given repository
public static Uri RepositoryPageBuilds(long repositoryId)
{
return "repositories/{0}/pages/builds".FormatUri(repositoryId);
}
///
/// Returns the for getting the build metadata for the last build for a given repository
///
/// The Id of the repository
/// The for getting the build metadata for the last build for a given repository
public static Uri RepositoryPageBuildsLatest(long repositoryId)
{
return "repositories/{0}/pages/builds/latest".FormatUri(repositoryId);
}
///
/// Returns the for getting the README of the specified repository
///
/// The Id of the repository
/// The for getting the README of the specified repository
public static Uri RepositoryReadme(long repositoryId)
{
return "repositories/{0}/readme".FormatUri(repositoryId);
}
///
/// Returns the for repository tags.
///
/// The Id of the repository
/// The for repository tags.
public static Uri RepositoryTags(long repositoryId)
{
return "repositories/{0}/tags".FormatUri(repositoryId);
}
///
/// Returns the for repository teams.
///
/// The Id of the repository
/// The for repository teams.
public static Uri RepositoryTeams(long repositoryId)
{
return "repositories/{0}/teams".FormatUri(repositoryId);
}
///
/// Returns the that lists the starred repositories for the authenticated user.
///
/// The Id of the repository
/// The that lists the starred repositories for the authenticated user.
public static Uri Stargazers(long repositoryId)
{
return "repositories/{0}/stargazers".FormatUri(repositoryId);
}
///
/// Returns the for the code frequency for the given repository
///
/// The Id of the repository
/// The for the code frequency for the given repository
public static Uri StatsCodeFrequency(long repositoryId)
{
return "repositories/{0}/stats/code_frequency".FormatUri(repositoryId);
}
///
/// Returns the for the commit activity for the given repository
///
/// The Id of the repository
/// The for the commit activity for the given repository
public static Uri StatsCommitActivity(long repositoryId)
{
return "repositories/{0}/stats/commit_activity".FormatUri(repositoryId);
}
///
/// Returns the for the contributors for the given repository
///
/// The Id of the repository
/// The for the contributors for the given repository
public static Uri StatsContributors(long repositoryId)
{
return "repositories/{0}/stats/contributors".FormatUri(repositoryId);
}
///
/// Returns the for the participation for the given repository
///
/// The Id of the repository
/// The for the participation for the given repository
public static Uri StatsParticipation(long repositoryId)
{
return "repositories/{0}/stats/participation".FormatUri(repositoryId);
}
///
/// Returns the for the punch card for the given repository
///
/// The Id of the repository
/// The for the punch card for the given repository
public static Uri StatsPunchCard(long repositoryId)
{
return "repositories/{0}/stats/punch_card".FormatUri(repositoryId);
}
///
/// Returns the for the specified tag.
///
/// The Id of the repository
/// The tag reference (SHA)
/// The for the specified tag.
public static Uri Tag(long repositoryId, string reference)
{
return "repositories/{0}/git/tags/{1}".FormatUri(repositoryId, reference);
}
///
/// Returns the for the specified tree.
///
/// The Id of the repository
/// The for the specified tree.
public static Uri Tree(long repositoryId)
{
return "repositories/{0}/git/trees".FormatUri(repositoryId);
}
///
/// Returns the for the specified tree.
///
/// The Id of the repository
/// The tree reference (SHA)
/// The for the specified tree.
public static Uri Tree(long repositoryId, string reference)
{
return "repositories/{0}/git/trees/{1}".FormatUri(repositoryId, reference);
}
///
/// Returns the for the specified tree.
///
/// The Id of the repository
/// The tree reference (SHA)
/// The for the specified tree.
public static Uri TreeRecursive(long repositoryId, string reference)
{
return "repositories/{0}/git/trees/{1}?recursive=1".FormatUri(repositoryId, reference.TrimEnd('/'));
}
///
/// Returns the that shows whether the repo is starred by the current user.
///
/// The Id of the repository
/// The that shows whether the repo is starred by the current user.
public static Uri Watched(long repositoryId)
{
return "repositories/{0}/subscription".FormatUri(repositoryId);
}
///
/// Returns the that lists the watched repositories for the authenticated user.
///
/// The Id of the repository
/// The that lists the watched repositories for the authenticated user.
public static Uri Watchers(long repositoryId)
{
return "repositories/{0}/subscribers".FormatUri(repositoryId);
}
///
/// Returns the for deleting a reaction.
///
/// The reaction number
/// The that lists the watched repositories for the authenticated user.
public static Uri Reactions(int number)
{
return "reactions/{0}".FormatUri(number);
}
///
/// Returns the for repository invitations.
///
/// The id of the repository
/// The for repository invitations.
public static Uri RepositoryInvitations(long repositoryId)
{
return "repositories/{0}/invitations".FormatUri(repositoryId);
}
///
/// Returns the for a single repository invitation.
///
/// The id of the repository
/// The id of the invitation
/// The for repository invitations.
public static Uri RepositoryInvitations(long repositoryId, int invitationId)
{
return "repositories/{0}/invitations/{1}".FormatUri(repositoryId, invitationId);
}
///
/// Returns the for invitations for the current user.
///
/// The for invitations for the current user.
public static Uri UserInvitations()
{
return "user/repository_invitations".FormatUri();
}
///
/// Returns the for a single invitation of the current user.
///
/// The id of the invitation
/// The for invitations for the current user.
public static Uri UserInvitations(int invitationId)
{
return "user/repository_invitations/{0}".FormatUri(invitationId);
}
///
/// Returns the for repository traffic referrers.
///
/// The owner of repo
/// The name of repo
/// The for repository traffic referrers.
public static Uri RepositoryTrafficReferrers(string owner, string repo)
{
return "repos/{0}/{1}/traffic/popular/referrers".FormatUri(owner, repo);
}
///
/// Returns the for repository traffic referrers.
///
/// The id of the repository
/// The for repository traffic referrers.
public static Uri RepositoryTrafficReferrers(long repositoryId)
{
return "repositories/{0}/traffic/popular/referrers".FormatUri(repositoryId);
}
///
/// Returns the for repository traffic paths.
///
/// The owner of repo
/// The name of repo
/// The for repository traffic paths.
public static Uri RepositoryTrafficPaths(string owner, string repo)
{
return "repos/{0}/{1}/traffic/popular/paths".FormatUri(owner, repo);
}
///
/// Returns the for repository traffic paths.
///
/// The id of the repository
/// The for repository traffic paths.
public static Uri RepositoryTrafficPaths(long repositoryId)
{
return "repositories/{0}/traffic/popular/paths".FormatUri(repositoryId);
}
///
/// Returns the for repository traffic views.
///
/// The owner of repo
/// The name of repo
/// The for repository traffic views.
public static Uri RepositoryTrafficViews(string owner, string repo)
{
return "repos/{0}/{1}/traffic/views".FormatUri(owner, repo);
}
///
/// Returns the for repository traffic views.
///
/// The id of the repository
/// The for repository traffic views.
public static Uri RepositoryTrafficViews(long repositoryId)
{
return "repositories/{0}/traffic/views".FormatUri(repositoryId);
}
///
/// Returns the for repository traffic clones.
///
/// The owner of repo
/// The name of repo
/// The for repository traffic clones.
public static Uri RepositoryTrafficClones(string owner, string repo)
{
return "repos/{0}/{1}/traffic/clones".FormatUri(owner, repo);
}
///
/// Returns the for repository traffic clones.
///
/// The id of the repository
/// The for repository traffic clones.
public static Uri RepositoryTrafficClones(long repositoryId)
{
return "repositories/{0}/traffic/clones".FormatUri(repositoryId);
}
///
/// Returns the for pull request review requests.
///
/// The owner of repo
/// The name of repo
/// The pull request number
/// The for pull request review requests.
public static Uri PullRequestReviewRequests(string owner, string repo, int number)
{
return "repos/{0}/{1}/pulls/{2}/requested_reviewers".FormatUri(owner, repo, number);
}
///
/// Returns the for pull request review requests.
///
/// The id of the repository
/// The pull request number
/// The for pull request review requests.
public static Uri PullRequestReviewRequests(long repositoryId, int number)
{
return "repositories/{0}/pulls/{1}/requested_reviewers".FormatUri(repositoryId, number);
}
///
/// Returns the for the specified project projects.
///
/// The owner of the repository
/// The name of the repository
/// The for projects.
public static Uri RepositoryProjects(string owner, string repo)
{
return "repos/{0}/{1}/projects".FormatUri(owner, repo);
}
///
/// Returns the for the specified project projects.
///
/// The id of the repository
/// The for projects.
public static Uri RepositoryProjects(long repositoryId)
{
return "repositories/{0}/projects".FormatUri(repositoryId);
}
///
/// Returns the for the specified organization projects.
///
/// The name of the organization
/// The for projects.
public static Uri OrganizationProjects(string organization)
{
return "orgs/{0}/projects".FormatUri(organization);
}
///
/// Returns the for a project.
///
/// The id of the project
/// The for repository projects.
public static Uri Project(int projectId)
{
return "projects/{0}".FormatUri(projectId);
}
///
/// Returns the for project columns.
///
/// The id of the columns
/// The for project columns.
public static Uri ProjectColumn(int columnId)
{
return "projects/columns/{0}".FormatUri(columnId);
}
///
/// Returns the for a specific project column.
///
/// The id of the project
/// The for a specific project column.
public static Uri ProjectColumns(int projectId)
{
return "projects/{0}/columns".FormatUri(projectId);
}
///
/// Returns the to move a project column.
///
/// The id of the column to move
/// The to move a project column.
public static Uri ProjectColumnMove(int columnId)
{
return "projects/columns/{0}/moves".FormatUri(columnId);
}
///
/// Returns the for project cards.
///
/// The id of the card
/// The for project cards.
public static Uri ProjectCard(int cardId)
{
return "projects/columns/cards/{0}".FormatUri(cardId);
}
///
/// Returns the for project cards.
///
/// The id of the column
/// The for project cards.
public static Uri ProjectCards(int columnId)
{
return "projects/columns/{0}/cards".FormatUri(columnId);
}
///
/// Returns the to move a project card.
///
/// The id of the card to move
/// The to move a project card.
public static Uri ProjectCardMove(int cardId)
{
return "projects/columns/cards/{0}/moves".FormatUri(cardId);
}
///
/// Returns the for repository's license requests.
///
/// The owner of repo
/// The name of repo
/// The for repository's license requests.
public static Uri RepositoryLicense(string owner, string repo)
{
return "repos/{0}/{1}/license".FormatUri(owner, repo);
}
///
/// Returns the for repository's license requests.
///
/// The id of the repository
/// The for repository's license requests.
public static Uri RepositoryLicense(long repositoryId)
{
return "repositories/{0}/license".FormatUri(repositoryId);
}
///
/// Returns the that returns the specified check run.
///
/// The Id of the repository
/// The check run Id
/// The that returns the specified check run.
public static Uri CheckRun(long repositoryId, long checkRunId)
{
return "repositories/{0}/check-runs/{1}".FormatUri(repositoryId, checkRunId);
}
///
/// Returns the that returns the specified check run.
///
/// The owner of repo
/// The name of repo
/// The check run Id
/// The that returns the specified check run.
public static Uri CheckRun(string owner, string repo, long checkRunId)
{
return "repos/{0}/{1}/check-runs/{2}".FormatUri(owner, repo, checkRunId);
}
///
/// Returns the that handles the check runs for the repository.
///
/// The Id of the repository
/// The that handles the check runs for the repository.
public static Uri CheckRuns(long repositoryId)
{
return "repositories/{0}/check-runs".FormatUri(repositoryId);
}
///
/// Returns the that handles the check runs for the repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the check runs for the repository.
public static Uri CheckRuns(string owner, string repo)
{
return "repos/{0}/{1}/check-runs".FormatUri(owner, repo);
}
///
/// Returns the that lists the check runs for the specified reference.
///
/// The Id of the repository
/// The git reference
/// The that returns the check runs for the specified reference.
public static Uri CheckRunsForReference(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/check-runs".FormatUri(repositoryId, reference);
}
///
/// Returns the that lists the check runs for the specified reference.
///
/// The owner of repo
/// The name of repo
/// The git reference
/// The that returns the check runs for the specified reference.
public static Uri CheckRunsForReference(string owner, string repo, string reference)
{
return "repos/{0}/{1}/commits/{2}/check-runs".FormatUri(owner, repo, reference);
}
///
/// Returns the that lists the check runs for the specified reference.
///
/// The Id of the repository
/// The Id of the check suite
/// The that returns the check runs for the specified reference.
public static Uri CheckRunsForCheckSuite(long repositoryId, long checkSuiteId)
{
return "repositories/{0}/check-suites/{1}/check-runs".FormatUri(repositoryId, checkSuiteId);
}
///
/// Returns the that lists the check runs for the specified reference.
///
/// The owner of repo
/// The name of repo
/// The Id of the check suite
/// The that returns the check runs for the specified reference.
public static Uri CheckRunsForCheckSuite(string owner, string repo, long checkSuiteId)
{
return "repos/{0}/{1}/check-suites/{2}/check-runs".FormatUri(owner, repo, checkSuiteId);
}
///
/// Returns the that lists the annotations for the specified check run.
///
/// The Id of the repository
/// The Id of the check run
/// The that returns the annotations for the specified check run.
public static Uri CheckRunAnnotations(long repositoryId, long checkRunId)
{
return "repositories/{0}/check-runs/{1}/annotations".FormatUri(repositoryId, checkRunId);
}
///
/// Returns the that lists the annotations for the specified check run.
///
/// The owner of repo
/// The name of repo
/// The Id of the check run
/// The that returns the annotations for the specified check run.
public static Uri CheckRunAnnotations(string owner, string repo, long checkRunId)
{
return "repos/{0}/{1}/check-runs/{2}/annotations".FormatUri(owner, repo, checkRunId);
}
///
/// Returns the that returns the specified check suite.
///
/// The Id of the repository
/// The check run Id
/// The that returns the specified check suite.
public static Uri CheckSuite(long repositoryId, long checkRunId)
{
return "repositories/{0}/check-suites/{1}".FormatUri(repositoryId, checkRunId);
}
///
/// Returns the that returns the specified check suite.
///
/// The owner of repo
/// The name of repo
/// The check run Id
/// The that returns the specified check suite.
public static Uri CheckSuite(string owner, string repo, long checkRunId)
{
return "repos/{0}/{1}/check-suites/{2}".FormatUri(owner, repo, checkRunId);
}
///
/// Returns the that lists the check suites for the specified reference.
///
/// The Id of the repository
/// The git reference
/// The that returns the check suites for the specified reference.
public static Uri CheckSuitesForReference(long repositoryId, string reference)
{
return "repositories/{0}/commits/{1}/check-suites".FormatUri(repositoryId, reference);
}
///
/// Returns the that lists the check suites for the specified reference.
///
/// The owner of repo
/// The name of repo
/// The git reference
/// The that returns the check suites for the specified reference.
public static Uri CheckSuitesForReference(string owner, string repo, string reference)
{
return "repos/{0}/{1}/commits/{2}/check-suites".FormatUri(owner, repo, reference);
}
///
/// Returns the that handles the check suites for the repository.
///
/// The Id of the repository
/// The that handles the check suites for the repository.
public static Uri CheckSuites(long repositoryId)
{
return "repositories/{0}/check-suites".FormatUri(repositoryId);
}
///
/// Returns the that handles the check suites for the repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the check suites for the repository.
public static Uri CheckSuites(string owner, string repo)
{
return "repos/{0}/{1}/check-suites".FormatUri(owner, repo);
}
///
/// Returns the that handles the check suite requests for the repository.
///
/// The Id of the repository
/// The Id of the check suite
/// The that handles the check suite requests for the repository.
public static Uri CheckSuiteRerequest(long repositoryId, long checkSuiteId)
{
return "repositories/{0}/check-suites/{1}/rerequest".FormatUri(repositoryId, checkSuiteId);
}
///
/// Returns the that handles the check suite requests for the repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the check suite
/// The that handles the check suite requests for the repository.
public static Uri CheckSuiteRerequest(string owner, string repo, long checkSuiteId)
{
return "repos/{0}/{1}/check-suites/{2}/rerequest".FormatUri(owner, repo, checkSuiteId);
}
///
/// Returns the that handles the check suite preferences for the repository.
///
/// The Id of the repository
/// The that handles the check suite preferences for the repository.
public static Uri CheckSuitePreferences(long repositoryId)
{
return "repositories/{0}/check-suites/preferences".FormatUri(repositoryId);
}
///
/// Returns the that handles the check suite preferences for the repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the check suite preferences for the repository.
public static Uri CheckSuitePreferences(string owner, string repo)
{
return "repos/{0}/{1}/check-suites/preferences".FormatUri(owner, repo);
}
///
/// Returns the that handles the repository secrets for the repository
///
/// The owner of the repo
/// The name of the repo
/// The name of the secret
/// The that handles the repository secrets for the repository
public static Uri RepositorySecret(string owner, string repo, string secret)
{
return "repos/{0}/{1}/actions/secrets/{2}".FormatUri(owner, repo, secret);
}
///
/// Returns the that handles the repository secrets for the repository
///
/// The owner of the repo
/// The name of the repo
/// The that handles the repository secrets for the repository
public static Uri RepositorySecrets(string owner, string repo)
{
return "repos/{0}/{1}/actions/secrets".FormatUri(owner, repo);
}
///
/// Returns the that handles the repository secrets for the repository
///
/// The owner of the repo
/// The name of the repo
/// The that handles the repository secrets for the repository
public static Uri RepositorySecretsPublicKey(string owner, string repo)
{
return "repos/{0}/{1}/actions/secrets/public-key".FormatUri(owner, repo);
}
///
/// Returns the that handles the repository variables for the repository
///
/// The owner of the repo
/// The name of the repo
/// The name of the variable
/// The that handles the repository variables for the repository
public static Uri RepositoryVariable(string owner, string repo, string variable)
{
return "repos/{0}/{1}/actions/variables/{2}".FormatUri(owner, repo, variable);
}
///
/// Returns the that handles the repository variables for the repository
///
/// The owner of the repo
/// The name of the repo
/// The that handles the repository variables for the repository
public static Uri RepositoryVariables(string owner, string repo)
{
return "repos/{0}/{1}/actions/variables".FormatUri(owner, repo);
}
///
/// Returns the that handles the organization variables for the repository
///
/// The owner of the repo
/// The name of the repo
/// The that handles the organization variables for the repository
public static Uri RepositoryOrganizationVariables(string owner, string repo)
{
return "repos/{0}/{1}/actions/organization-variables".FormatUri(owner, repo);
}
///
/// Returns the that returns all emojis in
/// response to a GET request.
///
/// The for emojis.
public static Uri Emojis()
{
return "emojis".FormatUri();
}
///
/// Returns the that returns rendered markdown in
/// response to a POST request.
///
/// The to render markdown.
public static Uri RawMarkdown()
{
return "markdown/raw".FormatUri();
}
///
/// Returns the that returns rendered markdown in
/// response to a POST request.
///
/// The to render markdown.
public static Uri Markdown()
{
return "markdown".FormatUri();
}
///
/// Returns the that returns all git ignore templates in
/// response to a GET request.
///
/// The to git ignore templates.
public static Uri GitIgnoreTemplates()
{
return "gitignore/templates".FormatUri();
}
///
/// Returns the that returns specified git ignore templates in
/// response to a GET request.
///
/// The name of the template to retrieve
/// The to git ignore template.
public static Uri GitIgnoreTemplates(string templateName)
{
return "gitignore/templates/{0}".FormatUri(templateName);
}
///
/// Returns the that returns all licenses in
/// response to a GET request.
///
/// The to licenses.
public static Uri Licenses()
{
return "licenses".FormatUri();
}
///
/// Returns the that returns specified license in
/// response to a GET request.
///
/// The key of the license to retrieve
/// The to license.
public static Uri Licenses(string key)
{
return "licenses/{0}".FormatUri(key);
}
///
/// Returns the that returns rate limit in
/// response to a GET request.
///
/// The to rate limit.
public static Uri RateLimit()
{
return "rate_limit".FormatUri();
}
///
/// Returns the that returns meta in
/// response to a GET request.
///
/// The to meta.
public static Uri Meta()
{
return "meta".FormatUri();
}
///
/// Returns the that returns all organization credentials in
/// response to a GET request.
///
/// The organization name.
/// The to meta.
public static Uri AllOrganizationCredentials(string org)
{
return "orgs/{0}/credential-authorizations".FormatUri(org);
}
///
/// Returns the that returns all organization credentials for a given login in
/// response to a GET request.
///
/// The organization name.
/// Limits the list of credentials authorizations for an organization to a specific login
/// The to meta.
public static Uri AllOrganizationCredentials(string org, string login)
{
return "orgs/{0}/credential-authorizations?login={1}".FormatUri(org, login);
}
///
/// Returns the for the Packages request
///
/// The Packages endpoint.
public static Uri PackagesOrg(string org)
{
return "orgs/{0}/packages".FormatUri(org);
}
///
/// Returns the for the Package request
///
/// The Package endpoint.
public static Uri PackageOrg(string org, PackageType packageType, string packageName)
{
return "orgs/{0}/packages/{1}/{2}".FormatUri(org, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Restore request
///
/// The Package Restore endpoint.
public static Uri PackageRestoreOrg(string org, PackageType packageType, string packageName)
{
return "orgs/{0}/packages/{1}/{2}/restore".FormatUri(org, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Versions request
///
/// The Package endpoint.
public static Uri PackageVersionsOrg(string org, PackageType packageType, string packageName)
{
return "orgs/{0}/packages/{1}/{2}/versions".FormatUri(org, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionOrg(string org, PackageType packageType, string packageName, int packageVersionId)
{
return "orgs/{0}/packages/{1}/{2}/versions/{3}".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionRestoreOrg(string org, PackageType packageType, string packageName, int packageVersionId)
{
return "orgs/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(org, packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the for the Packages request
///
/// The Packages endpoint.
public static Uri PackagesActiveUser()
{
return "user/packages".FormatUri();
}
///
/// Returns the for the Package request
///
/// The Package endpoint.
public static Uri PackageActiveUser(PackageType packageType, string packageName)
{
return "user/packages/{0}/{1}".FormatUri(packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Restore request
///
/// The Package Restore endpoint.
public static Uri PackageRestoreActiveUser(PackageType packageType, string packageName)
{
return "user/packages/{0}/{1}/restore".FormatUri(packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Versions request
///
/// The Package endpoint.
public static Uri PackageVersionsActiveUser(PackageType packageType, string packageName)
{
return "user/packages/{0}/{1}/versions".FormatUri(packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionActiveUser(PackageType packageType, string packageName, int packageVersionId)
{
return "user/packages/{0}/{1}/versions/{2}".FormatUri(packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionRestoreActiveUser(PackageType packageType, string packageName, int packageVersionId)
{
return "user/packages/{0}/{1}/versions/{2}/restore".FormatUri(packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the for the Packages request
///
/// The Packages endpoint.
public static Uri PackagesUser(string username)
{
return "users/{0}/packages".FormatUri(username);
}
///
/// Returns the for the Package request
///
/// The Package endpoint.
public static Uri PackageUser(string username, PackageType packageType, string packageName)
{
return "users/{0}/packages/{1}/{2}".FormatUri(username, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Restore request
///
/// The Package Restore endpoint.
public static Uri PackageRestoreUser(string username, PackageType packageType, string packageName)
{
return "users/{0}/packages/{1}/{2}/restore".FormatUri(username, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Versions request
///
/// The Package endpoint.
public static Uri PackageVersionsUser(string username, PackageType packageType, string packageName)
{
return "users/{0}/packages/{1}/{2}/versions".FormatUri(username, packageType.ToParameter(), packageName);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionUser(string username, PackageType packageType, string packageName, int packageVersionId)
{
return "users/{0}/packages/{1}/{2}/versions/{3}".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the for the Package Version request
///
/// The Package endpoint.
public static Uri PackageVersionRestoreUser(string username, PackageType packageType, string packageName, int packageVersionId)
{
return "users/{0}/packages/{1}/{2}/versions/{3}/restore".FormatUri(username, packageType.ToParameter(), packageName, packageVersionId);
}
///
/// Returns the that disables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsDispatchWorkflow(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that disables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsDispatchWorkflow(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}/dispatches".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that disables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsDisableWorkflow(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that disables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsDisableWorkflow(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}/disable".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that enables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsEnableWorkflow(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that enables an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsEnableWorkflow(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}/enable".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that gets an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflow(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that gets an Actions workflow for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflow(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that gets an Actions workflow'usage for a repository.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflowUsage(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that gets an Actions workflow's usage for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflowUsage(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}/timing".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that handles the Actions workflows for the repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the Actions workflows for the repository.
public static Uri ActionsListWorkflows(string owner, string repo)
{
return "repos/{0}/{1}/actions/workflows".FormatUri(owner, repo);
}
///
/// Returns the that re-runs an Actions workflow job for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow job.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsRerunWorkflowJob(string owner, string repo, long jobId)
{
return "repos/{0}/{1}/actions/jobs/{2}/rerun".FormatUri(owner, repo, jobId);
}
///
/// Returns the that re-runs an Actions workflow job for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow job.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflowJob(string owner, string repo, long jobId)
{
return "repos/{0}/{1}/actions/jobs/{2}".FormatUri(owner, repo, jobId);
}
///
/// Returns the that gets the logs an Actions workflow job for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow job.
/// The that gets an Actions workflow job for a repository.
public static Uri ActionsGetWorkflowJobLogs(string owner, string repo, long jobId)
{
return "repos/{0}/{1}/actions/jobs/{2}/logs".FormatUri(owner, repo, jobId);
}
///
/// Returns the that handles the Actions jobs for a workflow run.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The that handles the Actions workflows runs for a workflow.
public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/jobs".FormatUri(owner, repo, runId);
}
///
/// Returns the that handles the Actions jobs for a workflow run.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The attempt number of the workflow job.
/// The that handles the Actions workflows runs for a workflow.
public static Uri ActionsListWorkflowJobs(string owner, string repo, long runId, int attemptNumber)
{
return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}/jobs".FormatUri(owner, repo, runId, attemptNumber);
}
///
/// Returns the that gets Actions workflow runs for a repository.
///
/// The owner of repo
/// The name of repo
/// The that gets Actions workflow runs for a repository.
public static Uri ActionsWorkflowRuns(string owner, string repo)
{
return "repos/{0}/{1}/actions/runs".FormatUri(owner, repo);
}
///
/// Returns the that gets an Actions workflow run for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The that gets an Actions workflow run for a repository.
public static Uri ActionsWorkflowRun(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets an Actions workflow run attempt for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The attempt number of the workflow run.
/// The that gets an Actions workflow run for a repository.
public static Uri ActionsWorkflowRunAttempt(string owner, string repo, long runId, long attemptNumber)
{
return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}".FormatUri(owner, repo, runId, attemptNumber);
}
///
/// Returns the that approves an Actions workflow run for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The that approves an Actions workflow run for a repository.
public static Uri ActionsApproveWorkflowRun(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/approve".FormatUri(owner, repo, runId);
}
///
/// Returns the that cancels an Actions workflow run for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The that cancels an Actions workflow run for a repository.
public static Uri ActionsCancelWorkflowRun(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/cancel".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets the logs an Actions workflow run attempt for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The that gets an Actions workflow run for a repository.
public static Uri ActionsGetWorkflowRunLogs(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/logs".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets the logs an Actions workflow run attempt for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow run.
/// The attempt number of the workflow run.
/// The that gets an Actions workflow run for a repository.
public static Uri ActionsGetWorkflowRunAttemptLogs(string owner, string repo, long runId, long attemptNumber)
{
return "repos/{0}/{1}/actions/runs/{2}/attempts/{3}/logs".FormatUri(owner, repo, runId, attemptNumber);
}
///
/// Returns the that re-runs an Actions workflow run for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow job.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsRerunWorkflowRun(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/rerun".FormatUri(owner, repo, runId);
}
///
/// Returns the that re-runs failed jobs of an Actions workflow run for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow job.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsRerunWorkflowRunFailedJobs(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/rerun-failed-jobs".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets an Actions workflow's usage for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets an Actions workflow for a repository.
public static Uri ActionsGetWorkflowRunUsage(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/timing".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets Actions workflow run approvals for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets Actions workflow run approvals for a repository.
public static Uri ActionsWorkflowRunApprovals(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/approvals".FormatUri(owner, repo, runId);
}
///
/// Returns the that gets Actions workflow run pending deployments for a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that gets Actions workflow run pending deployments for a repository.
public static Uri ActionsWorkflowRunPendingDeployments(string owner, string repo, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/pending_deployments".FormatUri(owner, repo, runId);
}
///
/// Returns the that handles the Actions workflow runs for a workflow.
///
/// The owner of repo
/// The name of repo
/// The Id of the workflow.
/// The that handles the Actions workflows runs for a workflow.
public static Uri ActionsListWorkflowRuns(string owner, string repo, long workflowId)
{
return "repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowId);
}
///
/// Returns the that handles the Actions workflow runs for a workflow.
///
/// The owner of repo
/// The name of repo
/// The workflow file name.
/// The that handles the Actions workflows runs for a workflow.
public static Uri ActionsListWorkflowRuns(string owner, string repo, string workflowFileName)
{
return "repos/{0}/{1}/actions/workflows/{2}/runs".FormatUri(owner, repo, workflowFileName.UriEncode());
}
///
/// Returns the that handles the Actions self-hosted runners for an enterprise.
///
/// The name of the enterprise.
/// The that handles the Actions self-hosted runners for an enterprise.
public static Uri ActionsListSelfHostedRunnersForEnterprise(string enterprise)
{
return "enterprises/{0}/actions/runners".FormatUri(enterprise);
}
///
/// Returns the that handles the Actions self-hosted runners for an organization.
///
/// The name of the organization.
/// The that handles the Actions self-hosted runners for an organization.
public static Uri ActionsListSelfHostedRunnersForOrganization(string org)
{
return "orgs/{0}/actions/runners".FormatUri(org);
}
///
/// Returns the that handles the Actions self-hosted runners for a repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the Actions self-hosted runners for a repository.
public static Uri ActionsListSelfHostedRunnersForRepository(string owner, string repo)
{
return "repos/{0}/{1}/actions/runners".FormatUri(owner, repo);
}
///
/// Returns the that handles the Actions self-hosted runner for a runner group in an enterprise.
///
/// The name of the enterprise.
/// The Id of the runner group.
/// The that handles the Actions self-hosted runner for a runner group in an enterprise.
public static Uri ActionsListSelfHostedRunnersForEnterpriseRunnerGroup(string enterprise, long runnerGroupId)
{
return "enterprises/{0}/actions/runner-groups/{1}/runners".FormatUri(enterprise, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner for a runner group in an organization.
///
/// The name of the organization.
/// The Id of the runner group.
/// The that handles the Actions self-hosted runner for a runner group in an organization.
public static Uri ActionsListSelfHostedRunnersForOrganizationRunnerGroup(string org, long runnerGroupId)
{
return "orgs/{0}/actions/runner-groups/{1}/runners".FormatUri(org, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner for a runner group in a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the runner group.
/// The that handles the Actions self-hosted runner for a runner group in a repository.
public static Uri ActionsListSelfHostedRunnersForRepositoryRunnerGroup(string owner, string repo, long runnerGroupId)
{
return "repos/{0}/{1}/actions/runner-groups/{2}/runners".FormatUri(owner, repo, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner applications for an enterprise.
///
/// The name of the enterprise.
/// The that handles the Actions self-hosted runner applications for an enterprise.
public static Uri ActionsListRunnerApplicationsForEnterprise(string enterprise)
{
return "enterprises/{0}/actions/runners/downloads".FormatUri(enterprise);
}
///
/// Returns the that handles the Actions self-hosted runner applications for an organization.
///
/// The name of the organization.
/// The that handles the Actions self-hosted runner applications for an organization.
public static Uri ActionsListRunnerApplicationsForOrganization(string org)
{
return "orgs/{0}/actions/runners/downloads".FormatUri(org);
}
///
/// Returns the that handles the Actions self-hosted runner applications for a repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the Actions self-hosted runner applications for a repository.
public static Uri ActionsListRunnerApplicationsForRepository(string owner, string repo)
{
return "repos/{0}/{1}/actions/runners/downloads".FormatUri(owner, repo);
}
///
/// Returns the that handles the Actions self-hosted runner delete from an enterprise.
///
/// The name of the enterprise.
/// The Id of the runner.
/// The that handles the Actions self-hosted runner delete from an enterprise.
public static Uri ActionsDeleteEnterpriseRunner(string enterprise, long runnerId)
{
return "enterprises/{0}/actions/runners/{1}".FormatUri(enterprise, runnerId);
}
///
/// Returns the that handles the Actions self-hosted runner delete from an organization.
///
/// The name of the organization.
/// The Id of the runner.
/// The that handles the Actions self-hosted runner delete from an organization.
public static Uri ActionsDeleteOrganizationRunner(string org, long runnerId)
{
return "orgs/{0}/actions/runners/{1}".FormatUri(org, runnerId);
}
///
/// Returns the that handles the Actions self-hosted runner delete from a repository.
///
/// The owner of repo
/// The name of repo
/// The Id of the runner.
/// The that handles the Actions self-hosted runner delete from a repository.
public static Uri ActionsDeleteRepositoryRunner(string owner, string repo, long runnerId)
{
return "repos/{0}/{1}/actions/runners/{2}".FormatUri(owner, repo, runnerId);
}
///
/// Returns the that handles the Actions self-hosted runner registration token for an enterprise.
///
/// The name of the enterprise.
/// The that handles the Actions self-hosted runner registration token for an enterprise.
public static Uri ActionsCreateEnterpriseRegistrationToken(string enterprise)
{
return "enterprises/{0}/actions/runners/registration-token".FormatUri(enterprise);
}
///
/// Returns the that handles the Actions self-hosted runner registration token for an organization.
///
/// The name of the organization.
/// The that handles the Actions self-hosted runner registration token for an organization.
public static Uri ActionsCreateOrganizationRegistrationToken(string org)
{
return "orgs/{0}/actions/runners/registration-token".FormatUri(org);
}
///
/// Returns the that handles the Actions self-hosted runner registration token for a repository.
///
/// The owner of repo
/// The name of repo
/// The that handles the Actions self-hosted runner registration token for a repository.
public static Uri ActionsCreateRepositoryRegistrationToken(string owner, string repo)
{
return "repos/{0}/{1}/actions/runners/registration-token".FormatUri(owner, repo);
}
///
/// Returns the that handles the Actions self-hosted runner groups for an enterprise.
///
/// The name of the enterprise.
/// Unique identifier of the self-hosted runner group.
/// The that handles the Actions self-hosted runner groups for an enterprise.
public static Uri ActionsGetEnterpriseRunnerGroup(string enterprise, long runnerGroupId)
{
return "enterprises/{0}/actions/runner-groups/{1}".FormatUri(enterprise, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner groups for an organization.
///
/// The name of the organization.
/// Unique identifier of the self-hosted runner group.
/// The that handles the Actions self-hosted runner groups for an organization.
public static Uri ActionsGetOrganizationRunnerGroup(string org, long runnerGroupId)
{
return "orgs/{0}/actions/runner-groups/{1}".FormatUri(org, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner groups for an enterprise.
///
/// The name of the enterprise.
/// The that handles the Actions self-hosted runner groups for an enterprise.
public static Uri ActionsListEnterpriseRunnerGroups(string enterprise)
{
return "enterprises/{0}/actions/runner-groups".FormatUri(enterprise);
}
///
/// Returns the that handles the Actions self-hosted runner groups for an organization.
///
/// The name of the organization.
/// The that handles the Actions self-hosted runner groups for an organization.
public static Uri ActionsListOrganizationRunnerGroups(string org)
{
return "orgs/{0}/actions/runner-groups".FormatUri(org);
}
///
/// Returns the that handles the Actions self-hosted runner group organizations that belong to an enterprise.
///
/// The name of the enterprise.
/// The Id of the runner group.
/// The that handles the Actions self-hosted runner group organizations that belong to an enterprise.
public static Uri ActionsListEnterpriseRunnerGroupOrganizations(string enterprise, long runnerGroupId)
{
return "enterprises/{0}/actions/runner-groups/{1}/organizations".FormatUri(enterprise, runnerGroupId);
}
///
/// Returns the that handles the Actions self-hosted runner group repositories that belong to an organization.
///
/// The name of the organization.
/// The Id of the runner group.
/// The that handles the Actions self-hosted runner group repositories that belong to an organization.
public static Uri ActionsListOrganizationRunnerGroupRepositories(string org, long runnerGroupId)
{
return "orgs/{0}/actions/runner-groups/{1}/repositories".FormatUri(org, runnerGroupId);
}
///
/// Returns the that handles adding or removing of copilot licenses for an organisation
///
/// The name of the organization
/// A Uri Instance
public static Uri CopilotBillingLicense(string org)
{
return $"orgs/{org}/copilot/billing/selected_users".FormatUri(org);
}
///
/// Returns the that handles reading copilot billing settings for an organization
///
/// The name of the organization
/// A Uri Instance
public static Uri CopilotBillingSettings(string org)
{
return $"orgs/{org}/copilot/billing".FormatUri(org);
}
///
/// Returns the that allows for searching across all licenses for an organisation
///
///
///
public static Uri CopilotAllocatedLicenses(string org)
{
return $"orgs/{org}/copilot/billing/seats".FormatUri(org);
}
public static Uri Codespaces()
{
return _currentUserAllCodespaces;
}
public static Uri CodespacesForRepository(string owner, string repo)
{
return "repos/{0}/{1}/codespaces".FormatUri(owner, repo);
}
public static Uri Codespace(string codespaceName)
{
return "user/codespaces/{0}".FormatUri(codespaceName);
}
public static Uri CodespaceStart(string codespaceName)
{
return "user/codespaces/{0}/start".FormatUri(codespaceName);
}
public static Uri CodespaceStop(string codespaceName)
{
return "user/codespaces/{0}/stop".FormatUri(codespaceName);
}
///
/// Returns the that lists the artifacts for a repository.
///
/// The owner of the repository
/// The name of the repository
/// A Uri Instance
public static Uri ListArtifacts(string owner, string repository)
{
return "repos/{0}/{1}/actions/artifacts".FormatUri(owner, repository);
}
///
/// Returns the for the specified artifact.
///
/// The owner of the repository
/// The name of the repository
/// The id of the artifact
/// A Uri Instance
public static Uri Artifact(string owner, string repository, long artifactId)
{
return "repos/{0}/{1}/actions/artifacts/{2}".FormatUri(owner, repository, artifactId);
}
///
/// Returns the to download the specified artifact.
///
/// The owner of the repository
/// The name of the repository
/// The id of the artifact
/// The archive format e.g. zip
/// A Uri Instance
public static Uri DownloadArtifact(string owner, string repository, long artifactId, string archiveFormat)
{
return "repos/{0}/{1}/actions/artifacts/{2}/{3}".FormatUri(owner, repository, artifactId, archiveFormat);
}
///
/// Returns the to list the artifacts for a workflow.
///
/// The owner of the repository
/// The name of the repository
/// The id of the workflow run
/// A Uri Instance
public static Uri ListWorkflowArtifacts(string owner, string repository, long runId)
{
return "repos/{0}/{1}/actions/runs/{2}/artifacts".FormatUri(owner, repository, runId);
}
///
/// Returns the to rename a repository branch.
///
/// The owner of the repository
/// The name of the repository
/// The name of the branch to rename
/// A Uri Instance
public static Uri RepositoryBranchRename(string owner, string repository, string branch)
{
return "repos/{0}/{1}/branches/{2}/rename".FormatUri(owner, repository, branch);
}
///
/// Returns the to get or set an organization OIDC subject claim.
///
/// The organization name
/// A Uri Instance
public static Uri ActionsOrganizationOidcSubjectClaim(string organization)
{
return "orgs/{0}/actions/oidc/customization/sub".FormatUri(organization);
}
///
/// Returns the to get or set a repository OIDC subject claim.
///
/// The account owner of the repository
/// The name of the repository
/// A Uri Instance
public static Uri ActionsRepositoryOidcSubjectClaim(string owner, string repository)
{
return "repos/{0}/{1}/actions/oidc/customization/sub".FormatUri(owner, repository);
}
///
/// Returns the to create an autolink
///
/// The account owner of the repository
/// The name of the repository
/// A Uri Instance
public static Uri AutolinksCreate(string owner, string repo)
{
return "repos/{0}/{1}/autolinks".FormatUri(owner, repo);
}
///
/// Returns the to delete an autolink
///
/// The account owner of the repository
/// The name of the repository
/// The unique identifier of the autolink
/// A Uri Instance
public static Uri AutolinksDelete(string owner, string repo, int autolinkId)
{
return "repos/{0}/{1}/autolinks/{2}".FormatUri(owner, repo, autolinkId);
}
///
/// Returns the to get an autolink
///
/// The account owner of the repository
/// The name of the repository
/// The unique identifier of the autolink
/// A Uri Instance
public static Uri AutolinksGet(string owner, string repo, int autolinkId)
{
return "repos/{0}/{1}/autolinks/{2}".FormatUri(owner, repo, autolinkId);
}
///
/// Returns the to get a list of autolinks configured for the given repository
///
/// The account owner of the repository
/// The name of the repository
/// A Uri Instance
public static Uri AutolinksGetAll(string owner, string repo)
{
return "repos/{0}/{1}/autolinks".FormatUri(owner, repo);
}
}
}