Files
octokit.net/Octokit.Reactive/Clients/ObservableSshKeysClient.cs
Haacked 38264fcde5 Replace long with int
Turns out that we store these values as int(11) in MySql.
The 11 is irrelevant and pertains to display. int is a 4 byte
(aka 32 bit) integer. So this maps to a .NET Int32 (aka int).

While changing keeping it long might be future proofing, it also
requires changes to GHfW and I figure let's jump that hurdle
when we get there.
2013-09-24 14:12:50 -07:00

56 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Reactive;
using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive.Clients
{
public class ObservableSshKeysClient : IObservableSshKeysClient
{
readonly ISshKeysClient client;
public ObservableSshKeysClient(ISshKeysClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
}
public IObservable<SshKey> Get(int id)
{
return client.Get(id).ToObservable();
}
public IObservable<IReadOnlyCollection<SshKey>> GetAll(string user)
{
Ensure.ArgumentNotNullOrEmptyString(user, "user");
return client.GetAll(user).ToObservable();
}
public IObservable<IReadOnlyCollection<SshKey>> GetAllForCurrent()
{
return client.GetAllForCurrent().ToObservable();
}
public IObservable<SshKey> Create(SshKeyUpdate key)
{
Ensure.ArgumentNotNull(key, "key");
return client.Create(key).ToObservable();
}
public IObservable<SshKey> Update(int id, SshKeyUpdate key)
{
Ensure.ArgumentNotNull(key, "key");
return client.Update(id, key).ToObservable();
}
public IObservable<Unit> Delete(int id)
{
return client.Delete(id).ToObservable();
}
}
}