mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 22:55:12 +00:00
add observable counterparts
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Reactive;
|
||||||
using System.Reactive.Threading.Tasks;
|
using System.Reactive.Threading.Tasks;
|
||||||
|
|
||||||
namespace Octokit.Reactive.Clients
|
namespace Octokit.Reactive.Clients
|
||||||
@@ -44,6 +45,21 @@ namespace Octokit.Reactive.Clients
|
|||||||
return _client.Create(organizationLogin, newRepository).ToObservable();
|
return _client.Create(organizationLogin, newRepository).ToObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a repository for the specified owner and name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <remarks>Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.</remarks>
|
||||||
|
/// <returns>An <see cref="IObservable{Unit}"/> for the operation</returns>
|
||||||
|
public IObservable<Unit> Delete(string owner, string name)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return _client.Delete(owner, name).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,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Reactive;
|
||||||
|
|
||||||
namespace Octokit.Reactive
|
namespace Octokit.Reactive
|
||||||
{
|
{
|
||||||
@@ -20,6 +21,15 @@ 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(string organizationLogin, NewRepository newRepository);
|
IObservable<Repository> Create(string organizationLogin, NewRepository newRepository);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a repository for the specified owner and name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <remarks>Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.</remarks>
|
||||||
|
/// <returns>An <see cref="IObservable{Unit}"/> for the operation</returns>
|
||||||
|
IObservable<Unit> Delete(string owner, string name);
|
||||||
|
|
||||||
/// <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>
|
||||||
|
|||||||
Reference in New Issue
Block a user