mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 14:45:11 +00:00
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.
56 lines
1.4 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|