From 38264fcde5dfa0a7890e51e82c8933a73ba5153b Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 24 Sep 2013 14:12:50 -0700 Subject: [PATCH] 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. --- .../Clients/ObservableAuthorizationsClient.cs | 6 +++--- Octokit.Reactive/Clients/ObservableSshKeysClient.cs | 6 +++--- Octokit.Reactive/IObservableAuthorizationsClient.cs | 6 +++--- Octokit.Reactive/IObservableSshKeysClient.cs | 6 +++--- Octokit/Clients/AuthorizationsClient.cs | 6 +++--- Octokit/Clients/SshKeysClient.cs | 6 +++--- Octokit/GitHubModels.cs | 10 +++++----- Octokit/IAuthorizationsClient.cs | 6 +++--- Octokit/ISshKeysClient.cs | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs index df061785..b22e0b5e 100644 --- a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs @@ -21,12 +21,12 @@ namespace Octokit.Reactive.Clients return client.GetAll().ToObservable(); } - public IObservable Get(long id) + public IObservable Get(int id) { return client.Get(id).ToObservable(); } - public IObservable Update(long id, AuthorizationUpdate authorization) + public IObservable Update(int id, AuthorizationUpdate authorization) { Ensure.ArgumentNotNull(authorization, "authorization"); @@ -40,7 +40,7 @@ namespace Octokit.Reactive.Clients return client.Create(authorization).ToObservable(); } - public IObservable Delete(long id) + public IObservable Delete(int id) { return client.Delete(id).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableSshKeysClient.cs b/Octokit.Reactive/Clients/ObservableSshKeysClient.cs index 9127daaf..e5f0528d 100644 --- a/Octokit.Reactive/Clients/ObservableSshKeysClient.cs +++ b/Octokit.Reactive/Clients/ObservableSshKeysClient.cs @@ -16,7 +16,7 @@ namespace Octokit.Reactive.Clients this.client = client; } - public IObservable Get(long id) + public IObservable Get(int id) { return client.Get(id).ToObservable(); } @@ -40,14 +40,14 @@ namespace Octokit.Reactive.Clients return client.Create(key).ToObservable(); } - public IObservable Update(long id, SshKeyUpdate key) + public IObservable Update(int id, SshKeyUpdate key) { Ensure.ArgumentNotNull(key, "key"); return client.Update(id, key).ToObservable(); } - public IObservable Delete(long id) + public IObservable Delete(int id) { return client.Delete(id).ToObservable(); } diff --git a/Octokit.Reactive/IObservableAuthorizationsClient.cs b/Octokit.Reactive/IObservableAuthorizationsClient.cs index b41f1d82..157ce2c7 100644 --- a/Octokit.Reactive/IObservableAuthorizationsClient.cs +++ b/Octokit.Reactive/IObservableAuthorizationsClient.cs @@ -12,9 +12,9 @@ namespace Octokit.Reactive IObservable> GetAll(); [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "It's fiiiine. It's fine. Trust us.")] - IObservable Get(long id); - IObservable Update(long id, AuthorizationUpdate authorization); + IObservable Get(int id); + IObservable Update(int id, AuthorizationUpdate authorization); IObservable Create(AuthorizationUpdate authorization); - IObservable Delete(long id); + IObservable Delete(int id); } } diff --git a/Octokit.Reactive/IObservableSshKeysClient.cs b/Octokit.Reactive/IObservableSshKeysClient.cs index 9e01244c..dd8dab14 100644 --- a/Octokit.Reactive/IObservableSshKeysClient.cs +++ b/Octokit.Reactive/IObservableSshKeysClient.cs @@ -13,7 +13,7 @@ namespace Octokit.Reactive /// The ID of the SSH key. /// A [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] - IObservable Get(long id); + IObservable Get(int id); /// /// Retrieves the for the specified id. @@ -46,7 +46,7 @@ namespace Octokit.Reactive /// /// Thrown if the client is not authenticated. /// A - IObservable Update(long id, SshKeyUpdate key); + IObservable Update(int id, SshKeyUpdate key); /// /// Update the specified . @@ -54,6 +54,6 @@ namespace Octokit.Reactive /// The id of the SSH key /// Thrown if the client is not authenticated. /// A - IObservable Delete(long id); + IObservable Delete(int id); } } diff --git a/Octokit/Clients/AuthorizationsClient.cs b/Octokit/Clients/AuthorizationsClient.cs index 9e4bfc17..1dbfded9 100644 --- a/Octokit/Clients/AuthorizationsClient.cs +++ b/Octokit/Clients/AuthorizationsClient.cs @@ -27,7 +27,7 @@ namespace Octokit.Clients /// /// The id of the . /// An - public async Task Get(long id) + public async Task Get(int id) { var endpoint = "/authorizations/{0}".FormatUri(id); return await Client.Get(endpoint); @@ -39,7 +39,7 @@ namespace Octokit.Clients /// The id of the . /// /// - public async Task Update(long id, AuthorizationUpdate authorization) + public async Task Update(int id, AuthorizationUpdate authorization) { Ensure.ArgumentNotNull(authorization, "authorization"); @@ -64,7 +64,7 @@ namespace Octokit.Clients /// /// The systemwide id of the authorization /// - public async Task Delete(long id) + public async Task Delete(int id) { var endpoint = "/authorizations/{0}".FormatUri(id); await Client.Delete(endpoint); diff --git a/Octokit/Clients/SshKeysClient.cs b/Octokit/Clients/SshKeysClient.cs index db9a28a7..195f07df 100644 --- a/Octokit/Clients/SshKeysClient.cs +++ b/Octokit/Clients/SshKeysClient.cs @@ -11,7 +11,7 @@ namespace Octokit.Clients { } - public async Task Get(long id) + public async Task 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 Update(long id, SshKeyUpdate key) + public async Task 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); diff --git a/Octokit/GitHubModels.cs b/Octokit/GitHubModels.cs index c2668488..e2215868 100644 --- a/Octokit/GitHubModels.cs +++ b/Octokit/GitHubModels.cs @@ -208,7 +208,7 @@ namespace Octokit /// /// The system-wide unique Id for this user. /// - public long Id { get; set; } + public int Id { get; set; } /// /// The geographic location of this user. @@ -282,7 +282,7 @@ namespace Octokit /// /// The system-wide unique Id for this user. /// - public long Id { get; set; } + public int Id { get; set; } /// /// This org's login. @@ -342,7 +342,7 @@ namespace Octokit /// /// The system-wide unique Id for this user. /// - public long Id { get; set; } + public int Id { get; set; } /// /// The SSH Key @@ -414,7 +414,7 @@ namespace Octokit /// /// The amount of disk space allowed with this plan. /// - 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; } diff --git a/Octokit/IAuthorizationsClient.cs b/Octokit/IAuthorizationsClient.cs index 479dfce3..f4371da2 100644 --- a/Octokit/IAuthorizationsClient.cs +++ b/Octokit/IAuthorizationsClient.cs @@ -11,9 +11,9 @@ namespace Octokit Task> GetAll(); [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "It's fiiiine. It's fine. Trust us.")] - Task Get(long id); - Task Update(long id, AuthorizationUpdate authorization); + Task Get(int id); + Task Update(int id, AuthorizationUpdate authorization); Task Create(AuthorizationUpdate authorization); - Task Delete(long id); + Task Delete(int id); } } diff --git a/Octokit/ISshKeysClient.cs b/Octokit/ISshKeysClient.cs index 567e29f4..c94aa2f3 100644 --- a/Octokit/ISshKeysClient.cs +++ b/Octokit/ISshKeysClient.cs @@ -12,7 +12,7 @@ namespace Octokit /// The ID of the SSH key. /// A [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] - Task Get(long id); + Task Get(int id); /// /// Retrieves the for the specified id. @@ -45,7 +45,7 @@ namespace Octokit /// /// Thrown if the client is not authenticated. /// A - Task Update(long id, SshKeyUpdate key); + Task Update(int id, SshKeyUpdate key); /// /// Update the specified . @@ -53,6 +53,6 @@ namespace Octokit /// The id of the SSH key /// Thrown if the client is not authenticated. /// A - Task Delete(long id); + Task Delete(int id); } }