From e9409e0cb5759566c9f13779b8f9431c8230df8f Mon Sep 17 00:00:00 2001 From: Steve Desmond Date: Sun, 19 Jan 2020 17:54:46 -0500 Subject: [PATCH] Update IssueEvent ID field from int to long (#2060) --- .../Clients/IObservableIssuesEventsClient.cs | 8 ++++---- .../Clients/ObservableIssuesEventsClient.cs | 12 ++++++------ .../Clients/IssuesEventsClientTests.cs | 4 ++-- Octokit/Clients/IIssuesEventsClient.cs | 8 ++++---- Octokit/Clients/IssuesEventsClient.cs | 12 ++++++------ Octokit/Helpers/ApiUrls.cs | 4 ++-- Octokit/Models/Response/IssueEvent.cs | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableIssuesEventsClient.cs b/Octokit.Reactive/Clients/IObservableIssuesEventsClient.cs index 44c714e3..fd59ec33 100644 --- a/Octokit.Reactive/Clients/IObservableIssuesEventsClient.cs +++ b/Octokit.Reactive/Clients/IObservableIssuesEventsClient.cs @@ -103,10 +103,10 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// The event id + /// The event id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - IObservable Get(string owner, string name, int number); + IObservable Get(string owner, string name, long eventId); /// /// Gets a single event @@ -115,9 +115,9 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/events/#get-a-single-event /// /// The Id of the repository - /// The event id + /// The event id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - IObservable Get(long repositoryId, int number); + IObservable Get(long repositoryId, long eventId); } } diff --git a/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs b/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs index c435c15b..8cf89849 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs @@ -157,13 +157,13 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// The event id - public IObservable Get(string owner, string name, int number) + /// The event id + public IObservable Get(string owner, string name, long eventId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return _client.Get(owner, name, number).ToObservable(); + return _client.Get(owner, name, eventId).ToObservable(); } /// @@ -173,10 +173,10 @@ namespace Octokit.Reactive /// http://developer.github.com/v3/issues/events/#get-a-single-event /// /// The Id of the repository - /// The event id - public IObservable Get(long repositoryId, int number) + /// The event id + public IObservable Get(long repositoryId, long eventId) { - return _client.Get(repositoryId, number).ToObservable(); + return _client.Get(repositoryId, eventId).ToObservable(); } } } \ No newline at end of file diff --git a/Octokit.Tests.Integration/Clients/IssuesEventsClientTests.cs b/Octokit.Tests.Integration/Clients/IssuesEventsClientTests.cs index 7d6b229a..9daa2834 100644 --- a/Octokit.Tests.Integration/Clients/IssuesEventsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/IssuesEventsClientTests.cs @@ -402,7 +402,7 @@ public class IssuesEventsClientTests : IDisposable var closed = await _issuesClient.Update(_context.RepositoryOwner, _context.RepositoryName, issue.Number, new IssueUpdate { State = ItemState.Closed }); Assert.NotNull(closed); var issueEvents = await _issuesEventsClient.GetAllForRepository(_context.RepositoryOwner, _context.RepositoryName); - int issueEventId = issueEvents[0].Id; + var issueEventId = issueEvents[0].Id; var issueEventLookupById = await _issuesEventsClient.Get(_context.RepositoryOwner, _context.RepositoryName, issueEventId); @@ -418,7 +418,7 @@ public class IssuesEventsClientTests : IDisposable var closed = await _issuesClient.Update(_context.RepositoryOwner, _context.RepositoryName, issue.Number, new IssueUpdate { State = ItemState.Closed }); Assert.NotNull(closed); var issueEvents = await _issuesEventsClient.GetAllForRepository(_context.Repository.Id); - int issueEventId = issueEvents[0].Id; + var issueEventId = issueEvents[0].Id; var issueEventLookupById = await _issuesEventsClient.Get(_context.Repository.Id, issueEventId); diff --git a/Octokit/Clients/IIssuesEventsClient.cs b/Octokit/Clients/IIssuesEventsClient.cs index 62905aea..f153c907 100644 --- a/Octokit/Clients/IIssuesEventsClient.cs +++ b/Octokit/Clients/IIssuesEventsClient.cs @@ -104,10 +104,10 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// The event id + /// The event id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - Task Get(string owner, string name, int number); + Task Get(string owner, string name, long eventId); /// /// Gets a single event @@ -116,9 +116,9 @@ namespace Octokit /// http://developer.github.com/v3/issues/events/#get-a-single-event /// /// The Id of the repository - /// The event id + /// The event id [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] - Task Get(long repositoryId, int number); + Task Get(long repositoryId, long eventId); } } diff --git a/Octokit/Clients/IssuesEventsClient.cs b/Octokit/Clients/IssuesEventsClient.cs index d27f92e3..6f9f9b18 100644 --- a/Octokit/Clients/IssuesEventsClient.cs +++ b/Octokit/Clients/IssuesEventsClient.cs @@ -149,13 +149,13 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// The event id - public Task Get(string owner, string name, int number) + /// The event id + public Task Get(string owner, string name, long eventId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.IssuesEvent(owner, name, number)); + return ApiConnection.Get(ApiUrls.IssuesEvent(owner, name, eventId)); } /// @@ -165,10 +165,10 @@ namespace Octokit /// http://developer.github.com/v3/issues/events/#get-a-single-event /// /// The Id of the repository - /// The event id - public Task Get(long repositoryId, int number) + /// The event id + public Task Get(long repositoryId, long eventId) { - return ApiConnection.Get(ApiUrls.IssuesEvent(repositoryId, number)); + return ApiConnection.Get(ApiUrls.IssuesEvent(repositoryId, eventId)); } } } \ No newline at end of file diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index 7c82bb05..48cf5db7 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -838,7 +838,7 @@ namespace Octokit /// The name of the repository /// The event id /// - public static Uri IssuesEvent(string owner, string name, int id) + public static Uri IssuesEvent(string owner, string name, long id) { return "repos/{0}/{1}/issues/events/{2}".FormatUri(owner, name, id); } @@ -2971,7 +2971,7 @@ namespace Octokit /// The Id of the repository /// The event id /// The that returns the issue/pull request event and issue info for the specified event. - public static Uri IssuesEvent(long repositoryId, int id) + public static Uri IssuesEvent(long repositoryId, long id) { return "repositories/{0}/issues/events/{1}".FormatUri(repositoryId, id); } diff --git a/Octokit/Models/Response/IssueEvent.cs b/Octokit/Models/Response/IssueEvent.cs index e26d50c0..bd186b0a 100644 --- a/Octokit/Models/Response/IssueEvent.cs +++ b/Octokit/Models/Response/IssueEvent.cs @@ -9,7 +9,7 @@ namespace Octokit { public IssueEvent() { } - public IssueEvent(int id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl) + public IssueEvent(long id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl) { Id = id; NodeId = nodeId; @@ -27,7 +27,7 @@ namespace Octokit /// /// The id of the issue/pull request event. /// - public int Id { get; protected set; } + public long Id { get; protected set; } /// /// GraphQL Node Id