Files
octokit.net/Octokit.Reactive/Clients/ObservableAuthorizationsClient.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

49 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Reactive;
using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive.Clients
{
public class ObservableAuthorizationsClient : IObservableAuthorizationsClient
{
readonly IAuthorizationsClient client;
public ObservableAuthorizationsClient(IAuthorizationsClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
}
public IObservable<IReadOnlyCollection<Authorization>> GetAll()
{
return client.GetAll().ToObservable();
}
public IObservable<Authorization> Get(int id)
{
return client.Get(id).ToObservable();
}
public IObservable<Authorization> Update(int id, AuthorizationUpdate authorization)
{
Ensure.ArgumentNotNull(authorization, "authorization");
return client.Update(id, authorization).ToObservable();
}
public IObservable<Authorization> Create(AuthorizationUpdate authorization)
{
Ensure.ArgumentNotNull(authorization, "authorization");
return client.Create(authorization).ToObservable();
}
public IObservable<Unit> Delete(int id)
{
return client.Delete(id).ToObservable();
}
}
}