mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 14:15:12 +00:00
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.
This commit is contained in:
@@ -21,12 +21,12 @@ namespace Octokit.Reactive.Clients
|
||||
return client.GetAll().ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<Authorization> Get(long id)
|
||||
public IObservable<Authorization> Get(int id)
|
||||
{
|
||||
return client.Get(id).ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<Authorization> Update(long id, AuthorizationUpdate authorization)
|
||||
public IObservable<Authorization> Update(int id, AuthorizationUpdate authorization)
|
||||
{
|
||||
Ensure.ArgumentNotNull(authorization, "authorization");
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Octokit.Reactive.Clients
|
||||
return client.Create(authorization).ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<Unit> Delete(long id)
|
||||
public IObservable<Unit> Delete(int id)
|
||||
{
|
||||
return client.Delete(id).ToObservable();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Octokit.Reactive.Clients
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public IObservable<SshKey> Get(long id)
|
||||
public IObservable<SshKey> Get(int id)
|
||||
{
|
||||
return client.Get(id).ToObservable();
|
||||
}
|
||||
@@ -40,14 +40,14 @@ namespace Octokit.Reactive.Clients
|
||||
return client.Create(key).ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<SshKey> Update(long id, SshKeyUpdate key)
|
||||
public IObservable<SshKey> Update(int id, SshKeyUpdate key)
|
||||
{
|
||||
Ensure.ArgumentNotNull(key, "key");
|
||||
|
||||
return client.Update(id, key).ToObservable();
|
||||
}
|
||||
|
||||
public IObservable<Unit> Delete(long id)
|
||||
public IObservable<Unit> Delete(int id)
|
||||
{
|
||||
return client.Delete(id).ToObservable();
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Octokit.Reactive
|
||||
IObservable<IReadOnlyCollection<Authorization>> GetAll();
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
|
||||
Justification = "It's fiiiine. It's fine. Trust us.")]
|
||||
IObservable<Authorization> Get(long id);
|
||||
IObservable<Authorization> Update(long id, AuthorizationUpdate authorization);
|
||||
IObservable<Authorization> Get(int id);
|
||||
IObservable<Authorization> Update(int id, AuthorizationUpdate authorization);
|
||||
IObservable<Authorization> Create(AuthorizationUpdate authorization);
|
||||
IObservable<Unit> Delete(long id);
|
||||
IObservable<Unit> Delete(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="id">The ID of the SSH key.</param>
|
||||
/// <returns>A <see cref="SshKey"/></returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
IObservable<SshKey> Get(long id);
|
||||
IObservable<SshKey> Get(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the <see cref="SshKey"/> for the specified id.
|
||||
@@ -46,7 +46,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="key"></param>
|
||||
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
|
||||
/// <returns>A <see cref="User"/></returns>
|
||||
IObservable<SshKey> Update(long id, SshKeyUpdate key);
|
||||
IObservable<SshKey> Update(int id, SshKeyUpdate key);
|
||||
|
||||
/// <summary>
|
||||
/// Update the specified <see cref="UserUpdate"/>.
|
||||
@@ -54,6 +54,6 @@ namespace Octokit.Reactive
|
||||
/// <param name="id">The id of the SSH key</param>
|
||||
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
|
||||
/// <returns>A <see cref="User"/></returns>
|
||||
IObservable<Unit> Delete(long id);
|
||||
IObservable<Unit> Delete(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Octokit.Clients
|
||||
/// </summary>
|
||||
/// <param name="id">The id of the <see cref="Authorization"/>.</param>
|
||||
/// <returns>An <see cref="Authorization"/></returns>
|
||||
public async Task<Authorization> Get(long id)
|
||||
public async Task<Authorization> Get(int id)
|
||||
{
|
||||
var endpoint = "/authorizations/{0}".FormatUri(id);
|
||||
return await Client.Get(endpoint);
|
||||
@@ -39,7 +39,7 @@ namespace Octokit.Clients
|
||||
/// <param name="id">The id of the <see cref="Authorization"/>.</param>
|
||||
/// <param name="authorization"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Authorization> Update(long id, AuthorizationUpdate authorization)
|
||||
public async Task<Authorization> Update(int id, AuthorizationUpdate authorization)
|
||||
{
|
||||
Ensure.ArgumentNotNull(authorization, "authorization");
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Octokit.Clients
|
||||
/// </summary>
|
||||
/// <param name="id">The systemwide id of the authorization</param>
|
||||
/// <returns></returns>
|
||||
public async Task Delete(long id)
|
||||
public async Task Delete(int id)
|
||||
{
|
||||
var endpoint = "/authorizations/{0}".FormatUri(id);
|
||||
await Client.Delete(endpoint);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Octokit.Clients
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<SshKey> Get(long id)
|
||||
public async Task<SshKey> Get(int id)
|
||||
{
|
||||
var endpoint = "/user/keys/{0}".FormatUri(id);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Octokit.Clients
|
||||
return await Client.Create(endpoint, key);
|
||||
}
|
||||
|
||||
public async Task<SshKey> Update(long id, SshKeyUpdate key)
|
||||
public async Task<SshKey> Update(int id, SshKeyUpdate key)
|
||||
{
|
||||
Ensure.ArgumentNotNull(key, "key");
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Octokit.Clients
|
||||
return await Client.Update(endpoint, key);
|
||||
}
|
||||
|
||||
public async Task Delete(long id)
|
||||
public async Task Delete(int id)
|
||||
{
|
||||
var endpoint = "/user/keys/{0}".FormatUri(id);
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// The system-wide unique Id for this user.
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The geographic location of this user.
|
||||
@@ -282,7 +282,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// The system-wide unique Id for this user.
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This org's login.
|
||||
@@ -342,7 +342,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// The system-wide unique Id for this user.
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The SSH Key
|
||||
@@ -414,7 +414,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// The amount of disk space allowed with this plan.
|
||||
/// </summary>
|
||||
public long Space { get; set; }
|
||||
public int Space { get; set; }
|
||||
}
|
||||
|
||||
public class Repository
|
||||
@@ -426,7 +426,7 @@ namespace Octokit
|
||||
public string SshUrl { get; set; }
|
||||
public string SvnUrl { get; set; }
|
||||
public string MirrorUrl { get; set; }
|
||||
public long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
public User Owner { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string FullName { get; set; }
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace Octokit
|
||||
Task<IReadOnlyCollection<Authorization>> GetAll();
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
|
||||
Justification = "It's fiiiine. It's fine. Trust us.")]
|
||||
Task<Authorization> Get(long id);
|
||||
Task<Authorization> Update(long id, AuthorizationUpdate authorization);
|
||||
Task<Authorization> Get(int id);
|
||||
Task<Authorization> Update(int id, AuthorizationUpdate authorization);
|
||||
Task<Authorization> Create(AuthorizationUpdate authorization);
|
||||
Task Delete(long id);
|
||||
Task Delete(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Octokit
|
||||
/// <param name="id">The ID of the SSH key.</param>
|
||||
/// <returns>A <see cref="SshKey"/></returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
Task<SshKey> Get(long id);
|
||||
Task<SshKey> Get(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the <see cref="SshKey"/> for the specified id.
|
||||
@@ -45,7 +45,7 @@ namespace Octokit
|
||||
/// <param name="key"></param>
|
||||
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
|
||||
/// <returns>A <see cref="User"/></returns>
|
||||
Task<SshKey> Update(long id, SshKeyUpdate key);
|
||||
Task<SshKey> Update(int id, SshKeyUpdate key);
|
||||
|
||||
/// <summary>
|
||||
/// Update the specified <see cref="UserUpdate"/>.
|
||||
@@ -53,6 +53,6 @@ namespace Octokit
|
||||
/// <param name="id">The id of the SSH key</param>
|
||||
/// <exception cref="AuthenticationException">Thrown if the client is not authenticated.</exception>
|
||||
/// <returns>A <see cref="User"/></returns>
|
||||
Task Delete(long id);
|
||||
Task Delete(int id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user