mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 06:05:12 +00:00
add observable counter-parts
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reactive.Threading.Tasks;
|
using System.Reactive.Threading.Tasks;
|
||||||
|
|
||||||
namespace Octokit.Reactive.Clients
|
namespace Octokit.Reactive.Clients
|
||||||
@@ -29,6 +28,22 @@ namespace Octokit.Reactive.Clients
|
|||||||
return _client.Create(newRepository).ToObservable();
|
return _client.Create(newRepository).ToObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new repository in the specified organization.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="organizationLogin">The login of the organization in which to create the repostiory</param>
|
||||||
|
/// <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(string organizationLogin, NewRepository newRepository)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNull(organizationLogin, "organizationLogin");
|
||||||
|
Ensure.ArgumentNotNull(newRepository, "newRepository");
|
||||||
|
if (string.IsNullOrEmpty(newRepository.Name))
|
||||||
|
throw new ArgumentException("The new repository's name must not be null.");
|
||||||
|
|
||||||
|
return _client.Create(organizationLogin, newRepository).ToObservable();
|
||||||
|
}
|
||||||
|
|
||||||
public IObservable<Repository> Get(string owner, string name)
|
public IObservable<Repository> Get(string owner, string name)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Octokit.Reactive
|
namespace Octokit.Reactive
|
||||||
@@ -12,6 +11,14 @@ namespace Octokit.Reactive
|
|||||||
/// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param>
|
/// <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>
|
/// <returns>An <see cref="IObservable{Repository}"/> instance for the created repository</returns>
|
||||||
IObservable<Repository> Create(NewRepository newRepository);
|
IObservable<Repository> Create(NewRepository newRepository);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new repository in the specified organization.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="organizationLogin">The login of the organization in which to create the repostiory</param>
|
||||||
|
/// <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(string organizationLogin, NewRepository newRepository);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the <see cref="Repository"/> for the specified owner and name.
|
/// Retrieves the <see cref="Repository"/> for the specified owner and name.
|
||||||
|
|||||||
Reference in New Issue
Block a user