mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-19 13:45:12 +00:00
add reactive counter-part
This commit is contained in:
@@ -15,6 +15,20 @@ namespace Octokit.Reactive.Clients
|
||||
_client = client;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new repository for the current user.
|
||||
/// </summary>
|
||||
/// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param>
|
||||
/// <returns>An <see cref="IObservable{Repository}"/> instance for the created repository</returns>
|
||||
public IObservable<Repository> Create(NewRepository newRepository)
|
||||
{
|
||||
Ensure.ArgumentNotNull(newRepository, "newRepository");
|
||||
if (string.IsNullOrEmpty(newRepository.Name))
|
||||
throw new ArgumentException("The new repository's name must not be null.");
|
||||
|
||||
return _client.Create(newRepository).ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<Repository> Get(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
|
||||
@@ -6,6 +6,13 @@ namespace Octokit.Reactive
|
||||
{
|
||||
public interface IObservableRepositoriesClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new repository for the current user.
|
||||
/// </summary>
|
||||
/// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param>
|
||||
/// <returns>An <see cref="IObservable{Repository}"/> instance for the created repository</returns>
|
||||
IObservable<Repository> Create(NewRepository newRepository);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the <see cref="Repository"/> for the specified owner and name.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user