mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
missing files
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class RepositoryForksClient : ApiClient, IRepositoryForksClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new GitHub Repos Fork API client.
|
||||
/// </summary>
|
||||
/// <param name="apiConnection">An API connection.</param>
|
||||
public RepositoryForksClient(IApiConnection apiConnection) : base(apiConnection)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of forks defined for a repository
|
||||
/// </summary>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/forks/#list-forks">API documentation</a> for more information.</remarks>
|
||||
/// <returns></returns>
|
||||
public Task<IReadOnlyList<Repository>> Get(string owner, string repositoryName)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
|
||||
return ApiConnection.GetAll<Repository>(ApiUrls.RepositoryForks(owner, repositoryName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a fork for a repository. Specify organization in the fork parameter to create for an organization.
|
||||
/// </summary>
|
||||
/// <remarks>See <a href="http://developer.github.com/v3/repos/forks/#create-a-fork">API documentation</a> for more information.</remarks>
|
||||
/// <returns></returns>
|
||||
public Task<Repository> Create(string owner, string repositoryName, NewRepositoryFork fork)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
Ensure.ArgumentNotNull(fork, "fork");
|
||||
|
||||
return ApiConnection.Post<Repository>(ApiUrls.RepositoryForks(owner, repositoryName), fork);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user