using System; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using System.Collections.Generic; 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 branches in a repository. /// /// /// See the Branches API documentation for more details /// [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] IRepositoryBranchesClient Branch { 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(long repositoryId); /// /// Transfers the ownership of the specified repository. /// /// /// See the API documentation for more information. /// /// The current owner of the repository /// The name of the repository /// Repository transfer information /// A Task Transfer(string owner, string name, RepositoryTransfer repositoryTransfer); /// /// Transfers the ownership of the specified repository. /// /// /// See the API documentation for more information. /// /// The id of the repository /// Repository transfer information /// A Task Transfer(long repositoryId, RepositoryTransfer repositoryTransfer); /// /// 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(long 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")] [ExcludeFromPaginationApiOptionsConventionTest("This API call uses the PublicRepositoryRequest.Since parameter for pagination")] 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 . [ExcludeFromPaginationApiOptionsConventionTest("This API call uses the PublicRepositoryRequest.Since parameter for pagination")] 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. /// 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 /// IRepoCollaboratorsClient Collaborator { get; } /// /// Client for GitHub's Repository Deployments API /// /// /// See the Deployments API documentation for more details /// IDeploymentsClient Deployment { get; } /// /// Client for GitHub's Repository Statistics API. /// Note that the GitHub API uses caching on these endpoints, /// see a word about caching for more details. /// /// /// 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 /// 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 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(long 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(long 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(long 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(long 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. [ExcludeFromPaginationApiOptionsConventionTest("Pagination not supported by GitHub API (tested 29/08/2017)")] 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. [ExcludeFromPaginationApiOptionsConventionTest("Pagination not supported by GitHub API (tested 29/08/2017)")] Task> GetAllLanguages(long 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(long 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(long 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(long 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(long repositoryId, ApiOptions options); /// /// Get the contents of a repository's license /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Returns the contents of the repository's license file, if one is detected. Task GetLicenseContents(string owner, string name); /// /// Get the contents of a repository's license /// /// /// See the API documentation for more details /// /// The Id of the repository /// Returns the contents of the repository's license file, if one is detected. Task GetLicenseContents(long repositoryId); /// /// 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(long repositoryId, RepositoryUpdate update); /// /// A client for GitHub's Repository Pages API. /// /// /// See the Repository Pages API documentation for more information. /// IRepositoryPagesClient Page { get; } /// /// A client for GitHub's Repository Invitations API. /// /// /// See the Repository Invitations API documentation for more information. /// IRepositoryInvitationsClient Invitation { get; } /// /// Access GitHub's Repository Traffic API /// /// /// Refer to the API documentation for more information: https://developer.github.com/v3/repos/traffic/ /// IRepositoryTrafficClient Traffic { get; } /// /// Access GitHub's Repository Projects API /// /// /// Refer to the API documentation for more information: https://developer.github.com/v3/repos/projects/ /// IProjectsClient Project { get; } /// /// Gets all topics for the specified owner and repository name. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// Options for changing the API response /// All topics associated with the repository. Task GetAllTopics(string owner, string name, ApiOptions options); /// /// Gets all topics for the specified owner and repository name. /// /// /// See the API documentation for more details /// /// The owner of the repository /// The name of the repository /// All topics associated with the repository. Task GetAllTopics(string owner, string name); /// /// Gets all topics for the specified repository ID. /// /// /// See the API documentation for more details /// /// The ID of the repository /// Options for changing the API response /// All topics associated with the repository. Task GetAllTopics(long repositoryId, ApiOptions options); /// /// Gets all topics for the specified repository ID. /// /// /// See the API documentation for more details /// /// The ID of the repository /// All topics associated with the repository. Task GetAllTopics(long repositoryId); /// /// Replaces all topics for the specified repository. /// /// /// See the API documentation for more details /// /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. /// /// The ID of the repository /// The list of topics to associate with the repository /// All topics now associated with the repository. Task ReplaceAllTopics(long repositoryId, RepositoryTopics topics); /// /// Replaces all topics for the specified repository. /// /// /// See the API documentation for more details /// /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. /// /// The owner of the repository /// The name of the repository /// The list of topics to associate with the repository /// All topics now associated with the repository. Task ReplaceAllTopics(string owner, string name, RepositoryTopics topics); } }