mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 14:15:12 +00:00
default implementation. Still needs delete method which is skipped because it's a HTTP DELETE. There's currently nothing in the ApiConnection to handle this scenario and it's a rather unorthodox thing to support. delete.
32 lines
878 B
C#
32 lines
878 B
C#
using Octokit.Reactive.Internal;
|
|
using System;
|
|
using System.Reactive.Linq;
|
|
using System.Reactive.Threading.Tasks;
|
|
|
|
namespace Octokit.Reactive
|
|
{
|
|
public class ObservableUserEmailsClient : IObservableUserEmailsClient
|
|
{
|
|
readonly IUserEmailsClient _client;
|
|
readonly IConnection _connection;
|
|
|
|
public ObservableUserEmailsClient(IGitHubClient client)
|
|
{
|
|
Ensure.ArgumentNotNull(client, "client");
|
|
|
|
_client = client.User.Email;
|
|
_connection = client.Connection;
|
|
}
|
|
|
|
public IObservable<EmailAddress> GetAll()
|
|
{
|
|
return _connection.GetAndFlattenAllPages<EmailAddress>(ApiUrls.Emails());
|
|
}
|
|
|
|
public IObservable<string> Add(params string[] emailAddresses)
|
|
{
|
|
return _client.Add(emailAddresses).ToObservable().SelectMany(a => a);
|
|
}
|
|
}
|
|
}
|