add observable counter-parts

This commit is contained in:
half-ogre
2013-10-09 11:00:14 -07:00
parent 9be1445e0a
commit c20b91ccfc
2 changed files with 24 additions and 2 deletions

View File

@@ -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");

View File

@@ -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
@@ -13,6 +12,14 @@ namespace Octokit.Reactive
/// <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.
/// </summary> /// </summary>