using System; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; #if NET_45 using System.Collections.Generic; #endif namespace Octokit { /// /// A client for GitHub's Repositories API. /// /// /// See the Repositories API documentation for more details. /// public interface IRepositoriesClient { /// /// Client for managing pull requests. /// /// /// See the Pull Requests API documentation for more details /// IPullRequestsClient PullRequest { get; } /// /// Client for managing commit comments in a repository. /// /// /// See the Repository Comments API documentation for more information. /// [Obsolete("Comment information is now available under the Comment property. This will be removed in a future update.")] IRepositoryCommentsClient RepositoryComments { get; } /// /// Client for managing commit comments in a repository. /// /// /// See the Repository Comments API documentation for more information. /// IRepositoryCommentsClient Comment { get; } /// /// Client for managing deploy keys in a repository. /// /// /// See the Repository Deploy Keys API documentation for more information. /// IRepositoryDeployKeysClient DeployKeys { get; } /// /// Client for managing the contents of a repository. /// /// /// See the Repository Contents API documentation for more information. /// IRepositoryContentsClient Content { get; } /// /// Creates a new repository for the current user. /// /// /// See the API documentation for more information. /// /// A instance describing the new repository to create /// Thrown when a general API error occurs. /// A instance for the created repository. Task Create(NewRepository newRepository); /// /// Creates a new repository in the specified organization. /// /// /// See the API documentation for more information. /// /// Login of the organization in which to create the repository /// A instance describing the new repository to create /// Thrown when a general API error occurs. /// A instance for the created repository Task Create(string organizationLogin, NewRepository newRepository); /// /// Deletes the specified repository. /// /// /// See the API documentation for more information. /// Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. /// /// The owner of the repository /// The name of the repository /// Thrown when a general API error occurs. Task Delete(string owner, string name); /// /// Deletes the specified repository. /// /// /// See the API documentation for more information. /// Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. /// /// The ID of the repository /// Thrown when a general API error occurs. Task Delete(int repositoryId); /// /// Gets the specified repository. /// /// /// See the API documentation for more information. /// /// The owner of the repository /// The name of the repository /// Thrown when a general API error occurs. /// A [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] Task Get(string owner, string name); /// /// Gets the specified repository. /// /// /// See the API documentation for more information. /// /// The ID of the repository /// Thrown when a general API error occurs. /// A [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] Task Get(int repositoryId); /// /// Gets all public repositories. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Makes a network request")] Task> GetAllPublic(); /// /// Gets all public repositories since the integer ID of the last Repository that you've seen. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// Search parameters of the last repository seen /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . Task> GetAllPublic(PublicRepositoryRequest request); /// /// Gets all repositories owned by the current user. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Makes a network request")] Task> GetAllForCurrent(); /// /// Gets all repositories owned by the current user. /// /// /// See the API documentation for more information. /// /// Options for changing the API response /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . Task> GetAllForCurrent(ApiOptions options); /// /// Gets all repositories owned by the current user. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// Search parameters to filter results on /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . Task> GetAllForCurrent(RepositoryRequest request); /// /// Gets all repositories owned by the current user. /// /// /// See the API documentation for more information. /// /// Search parameters to filter results on /// Options for changing the API response /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . Task> GetAllForCurrent(RepositoryRequest request, ApiOptions options); /// /// Gets all repositories owned by the specified user. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// The account name to search for /// Thrown when a general API error occurs. /// A of . Task> GetAllForUser(string login); /// /// Gets all repositories owned by the specified user. /// /// /// See the API documentation for more information. /// /// The account name to search for /// Options for changing the API response /// Thrown when a general API error occurs. /// A of . Task> GetAllForUser(string login, ApiOptions options); /// /// Gets all repositories owned by the specified organization. /// /// /// See the API documentation for more information. /// The default page size on GitHub.com is 30. /// /// The organization name to search for /// Thrown when a general API error occurs. /// A of . Task> GetAllForOrg(string organization); /// /// Gets all repositories owned by the specified organization. /// /// /// See the API documentation for more information. /// /// The organization name to search for /// Options for changing the API response /// Thrown when a general API error occurs. /// A of . Task> GetAllForOrg(string organization, ApiOptions options); /// /// A client for GitHub's Commit Status API. /// /// /// See the Commit Status API documentation for more /// details. Also check out the blog post /// that announced this feature. /// [Obsolete("Use Status instead")] ICommitStatusClient CommitStatus { get; } /// /// A client for GitHub's Commit Status API. /// /// /// See the Commit Status API documentation for more /// details. Also check out the blog post /// that announced this feature. /// ICommitStatusClient Status { get; } /// /// A client for GitHub's Repository Hooks API. /// /// See Hooks API documentation for more information. IRepositoryHooksClient Hooks { get; } /// /// A client for GitHub's Repository Forks API. /// /// See Forks API documentation for more information. IRepositoryForksClient Forks { get; } /// /// A client for GitHub's Repo Collaborators. /// /// /// See the Collaborators API documentation for more details /// [Obsolete("Collaborator information is now available under the Collaborator property. This will be removed in a future update.")] IRepoCollaboratorsClient RepoCollaborators { get; } /// /// A client for GitHub's Repo Collaborators. /// /// /// See the Collaborators API documentation for more details /// IRepoCollaboratorsClient Collaborator { get; } /// /// Client for GitHub's Repository Deployments API /// /// /// See the Collaborators API documentation for more details /// IDeploymentsClient Deployment { get; } /// /// Client for GitHub's Repository Statistics API /// /// /// See the Statistics API documentation for more details /// IStatisticsClient Statistics { get; } /// /// Client for GitHub's Repository Commits API /// /// /// See the Commits API documentation for more details /// [Obsolete("Commit information is now available under the Commit property. This will be removed in a future update.")] IRepositoryCommitsClient Commits { get; } /// /// Client for GitHub's Repository Commits API /// /// /// See the Commits API documentation for more details /// IRepositoryCommitsClient Commit { get; } /// /// Access GitHub's Releases API. /// /// /// Refer to the API documentation for more information: https://developer.github.com/v3/repos/releases/ /// IReleasesClient Release { get; } /// /// Client for GitHub's Repository Merging API /// /// /// See the Merging API documentation for more details /// IMergingClient Merging { get; } /// /// Gets all the branches for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Thrown when a general API error occurs. /// All es of the repository Task> GetAllBranches(string owner, string name); /// /// Gets all the branches for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Thrown when a general API error occurs. /// All es of the repository Task> GetAllBranches(int repositoryId); /// /// Gets all the branches for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Options for changing the API response /// Thrown when a general API error occurs. /// All es of the repository Task> GetAllBranches(string owner, string name, ApiOptions options); /// /// Gets all the branches for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Options for changing the API response /// Thrown when a general API error occurs. /// All es of the repository Task> GetAllBranches(int repositoryId, ApiOptions options); /// /// Gets all contributors for the specified repository. Does not include anonymous contributors. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// All contributors of the repository. Task> GetAllContributors(string owner, string name); /// /// Gets all contributors for the specified repository. Does not include anonymous contributors. /// /// /// See the API documentation for more details /// /// The ID of the repository /// All contributors of the repository. Task> GetAllContributors(int repositoryId); /// /// Gets all contributors for the specified repository. Does not include anonymous contributors. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Options for changing the API response /// All contributors of the repository. Task> GetAllContributors(string owner, string name, ApiOptions options); /// /// Gets all contributors for the specified repository. Does not include anonymous contributors. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Options for changing the API response /// All contributors of the repository. Task> GetAllContributors(int repositoryId, ApiOptions options); /// /// Gets all contributors for the specified repository. With the option to include anonymous contributors. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// True if anonymous contributors should be included in result; Otherwise false /// All contributors of the repository. Task> GetAllContributors(string owner, string name, bool includeAnonymous); /// /// Gets all contributors for the specified repository. With the option to include anonymous contributors. /// /// /// See the API documentation for more details /// /// The ID of the repository /// True if anonymous contributors should be included in result; Otherwise false /// All contributors of the repository. Task> GetAllContributors(int repositoryId, bool includeAnonymous); /// /// Gets all contributors for the specified repository. With the option to include anonymous contributors. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// True if anonymous contributors should be included in result; Otherwise false /// Options for changing the API response /// All contributors of the repository. Task> GetAllContributors(string owner, string name, bool includeAnonymous, ApiOptions options); /// /// Gets all contributors for the specified repository. With the option to include anonymous contributors. /// /// /// See the API documentation for more details /// /// The ID of the repository /// True if anonymous contributors should be included in result; Otherwise false /// Options for changing the API response /// All contributors of the repository. Task> GetAllContributors(int repositoryId, bool includeAnonymous, ApiOptions options); /// /// Gets all languages for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// All languages used in the repository and the number of bytes of each language. Task> GetAllLanguages(string owner, string name); /// /// Gets all languages for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// All languages used in the repository and the number of bytes of each language. Task> GetAllLanguages(int repositoryId); /// /// Gets all teams for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// All s associated with the repository Task> GetAllTeams(string owner, string name); /// /// Gets all teams for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// All s associated with the repository Task> GetAllTeams(int repositoryId); /// /// Gets all teams for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Options for changing the API response /// All s associated with the repository Task> GetAllTeams(string owner, string name, ApiOptions options); /// /// Gets all teams for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Options for changing the API response /// All s associated with the repository Task> GetAllTeams(int repositoryId, ApiOptions options); /// /// Gets all tags for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// All of the repositories tags. Task> GetAllTags(string owner, string name); /// /// Gets all tags for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// All of the repositories tags. Task> GetAllTags(int repositoryId); /// /// Gets all tags for the specified repository. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Options for changing the API response /// All of the repositories tags. Task> GetAllTags(string owner, string name, ApiOptions options); /// /// Gets all tags for the specified repository. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Options for changing the API response /// All of the repositories tags. Task> GetAllTags(int repositoryId, ApiOptions options); /// /// Gets the specified branch. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// The name of the branch /// The specified Task GetBranch(string owner, string name, string branchName); /// /// Gets the specified branch. /// /// /// See the API documentation for more details /// /// The ID of the repository /// The name of the branch /// The specified Task GetBranch(int repositoryId, string branchName); /// /// Updates the specified repository with the values given in /// /// The owner of the repository /// The name of the repository /// New values to update the repository with /// The updated Task Edit(string owner, string name, RepositoryUpdate update); /// /// Updates the specified repository with the values given in /// /// The ID of the repository /// New values to update the repository with /// The updated Task Edit(int repositoryId, RepositoryUpdate update); /// /// Edit the specified branch with the values given in /// /// The owner of the repository /// The name of the repository /// The name of the branch /// New values to update the branch with /// The updated Task EditBranch(string owner, string name, string branch, BranchUpdate update); /// /// Edit the specified branch with the values given in /// /// The ID of the repository /// The name of the branch /// New values to update the branch with /// The updated Task EditBranch(int repositoryId, string branch, BranchUpdate update); /// /// A client for GitHub's Repository Pages API. /// /// /// See the Repository Pages API documentation for more information. /// IRepositoryPagesClient Page { get; } } }