Skip to content

Commit

Permalink
Issue ID should be a long
Browse files Browse the repository at this point in the history
According to the documentation at https://docs.github.com/en/rest/issues/issues.

Fixes #2351 for issue ids.
  • Loading branch information
kzu committed Aug 27, 2024
1 parent 799d464 commit 7c0ce25
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 238 deletions.
48 changes: 24 additions & 24 deletions Octokit.AsyncPaginationExtension/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ public static IPaginatedList<IssueComment> GetAllForRepositoryAsync(this IIssueC
public static IPaginatedList<IssueComment> GetAllForRepositoryAsync(this IIssueCommentsClient t, long repositoryId, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueComment>(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(string, string, int, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(string, string, long, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueComment>(options => t.GetAllForIssue(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(long, int, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(long, long, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueComment>(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(string, string, int, IssueCommentRequest, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, int issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(string, string, long, IssueCommentRequest, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, string owner, string name, long issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueComment>(options => t.GetAllForIssue(owner, name, issueNumber, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(long, int, IssueCommentRequest, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, int issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueCommentsClient.GetAllForIssue(long, long, IssueCommentRequest, ApiOptions)"/>
public static IPaginatedList<IssueComment> GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, long issueNumber, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueComment>(options => t.GetAllForIssue(repositoryId, issueNumber, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IRepositoryPagesClient.GetAll(string, string, ApiOptions)"/>
Expand Down Expand Up @@ -107,24 +107,24 @@ public static IPaginatedList<Notification> GetAllForRepositoryAsync(this INotifi
public static IPaginatedList<Notification> GetAllForRepositoryAsync(this INotificationsClient t, long repositoryId, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Notification>(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueTimelineClient.GetAllForIssue(string, string, int, ApiOptions)"/>
public static IPaginatedList<TimelineEventInfo> GetAllForIssueAsync(this IIssueTimelineClient t, string owner, string repo, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueTimelineClient.GetAllForIssue(string, string, long, ApiOptions)"/>
public static IPaginatedList<TimelineEventInfo> GetAllForIssueAsync(this IIssueTimelineClient t, string owner, string repo, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<TimelineEventInfo>(options => t.GetAllForIssue(owner, repo, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueTimelineClient.GetAllForIssue(long, int, ApiOptions)"/>
public static IPaginatedList<TimelineEventInfo> GetAllForIssueAsync(this IIssueTimelineClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueTimelineClient.GetAllForIssue(long, long, ApiOptions)"/>
public static IPaginatedList<TimelineEventInfo> GetAllForIssueAsync(this IIssueTimelineClient t, long repositoryId, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<TimelineEventInfo>(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IMiscellaneousClient.GetAllLicenses(ApiOptions)"/>
public static IPaginatedList<LicenseMetadata> GetAllLicensesAsync(this IMiscellaneousClient t, int pageSize = DEFAULT_PAGE_SIZE)

Check warning on line 119 in Octokit.AsyncPaginationExtension/Extensions.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'IMiscellaneousClient' is obsolete: 'Use individual clients available on the GitHubClient for these methods'

Check warning on line 119 in Octokit.AsyncPaginationExtension/Extensions.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IMiscellaneousClient' is obsolete: 'Use individual clients available on the GitHubClient for these methods'

Check warning on line 119 in Octokit.AsyncPaginationExtension/Extensions.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

'IMiscellaneousClient' is obsolete: 'Use individual clients available on the GitHubClient for these methods'
=> pageSize > 0 ? new PaginatedList<LicenseMetadata>(t.GetAllLicenses, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueReactionsClient.GetAll(string, string, int, ApiOptions)"/>
public static IPaginatedList<Reaction> GetAllAsync(this IIssueReactionsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueReactionsClient.GetAll(string, string, long, ApiOptions)"/>
public static IPaginatedList<Reaction> GetAllAsync(this IIssueReactionsClient t, string owner, string name, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Reaction>(options => t.GetAll(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssueReactionsClient.GetAll(long, int, ApiOptions)"/>
public static IPaginatedList<Reaction> GetAllAsync(this IIssueReactionsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssueReactionsClient.GetAll(long, long, ApiOptions)"/>
public static IPaginatedList<Reaction> GetAllAsync(this IIssueReactionsClient t, long repositoryId, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Reaction>(options => t.GetAll(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IRepositoryDeployKeysClient.GetAll(string, string, ApiOptions)"/>
Expand Down Expand Up @@ -403,12 +403,12 @@ public static IPaginatedList<CheckRunAnnotation> GetAllAnnotationsAsync(this ICh
public static IPaginatedList<CheckRunAnnotation> GetAllAnnotationsAsync(this ICheckRunsClient t, long repositoryId, long checkRunId, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<CheckRunAnnotation>(options => t.GetAllAnnotations(repositoryId, checkRunId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesLabelsClient.GetAllForIssue(string, string, int, ApiOptions)"/>
public static IPaginatedList<Label> GetAllForIssueAsync(this IIssuesLabelsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssuesLabelsClient.GetAllForIssue(string, string, long, ApiOptions)"/>
public static IPaginatedList<Label> GetAllForIssueAsync(this IIssuesLabelsClient t, string owner, string name, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Label>(options => t.GetAllForIssue(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesLabelsClient.GetAllForIssue(long, int, ApiOptions)"/>
public static IPaginatedList<Label> GetAllForIssueAsync(this IIssuesLabelsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssuesLabelsClient.GetAllForIssue(long, long, ApiOptions)"/>
public static IPaginatedList<Label> GetAllForIssueAsync(this IIssuesLabelsClient t, long repositoryId, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Label>(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesLabelsClient.GetAllForRepository(string, string, ApiOptions)"/>
Expand Down Expand Up @@ -559,12 +559,12 @@ public static IPaginatedList<Reaction> GetAllAsync(this IPullRequestReviewCommen
public static IPaginatedList<Reaction> GetAllAsync(this IPullRequestReviewCommentReactionsClient t, long repositoryId, long commentId, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<Reaction>(options => t.GetAll(repositoryId, commentId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesEventsClient.GetAllForIssue(string, string, int, ApiOptions)"/>
public static IPaginatedList<IssueEvent> GetAllForIssueAsync(this IIssuesEventsClient t, string owner, string name, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssuesEventsClient.GetAllForIssue(string, string, long, ApiOptions)"/>
public static IPaginatedList<IssueEvent> GetAllForIssueAsync(this IIssuesEventsClient t, string owner, string name, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueEvent>(options => t.GetAllForIssue(owner, name, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesEventsClient.GetAllForIssue(long, int, ApiOptions)"/>
public static IPaginatedList<IssueEvent> GetAllForIssueAsync(this IIssuesEventsClient t, long repositoryId, int issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
/// <inheritdoc cref="IIssuesEventsClient.GetAllForIssue(long, long, ApiOptions)"/>
public static IPaginatedList<IssueEvent> GetAllForIssueAsync(this IIssuesEventsClient t, long repositoryId, long issueNumber, int pageSize = DEFAULT_PAGE_SIZE)
=> pageSize > 0 ? new PaginatedList<IssueEvent>(options => t.GetAllForIssue(repositoryId, issueNumber, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive.");

/// <inheritdoc cref="IIssuesEventsClient.GetAllForRepository(string, string, ApiOptions)"/>
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Reactive/Clients/IObservableAssigneesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface IObservableAssigneesClient
/// <param name="issueNumber">The issue number</param>
/// <param name="assignees">List of names of assignees to add</param>
/// <returns></returns>
IObservable<Issue> AddAssignees(string owner, string name, int issueNumber, AssigneesUpdate assignees);
IObservable<Issue> AddAssignees(string owner, string name, long issueNumber, AssigneesUpdate assignees);

/// <summary>
/// Remove assignees from a specified Issue.
Expand All @@ -64,7 +64,7 @@ public interface IObservableAssigneesClient
/// <param name="issueNumber">The issue number</param>
/// <param name="assignees">List of assignees to remove </param>
/// <returns></returns>
IObservable<Issue> RemoveAssignees(string owner, string name, int issueNumber, AssigneesUpdate assignees);
IObservable<Issue> RemoveAssignees(string owner, string name, long issueNumber, AssigneesUpdate assignees);

/// <summary>
/// Checks to see if a user is an assignee for a repository.
Expand Down
20 changes: 10 additions & 10 deletions Octokit.Reactive/Clients/IObservableIssueCommentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public interface IObservableIssueCommentsClient
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="issueNumber">The issue number</param>
IObservable<IssueComment> GetAllForIssue(string owner, string name, int issueNumber);
IObservable<IssueComment> GetAllForIssue(string owner, string name, long issueNumber);

/// <summary>
/// Gets Issue Comments for a specified Issue.
/// </summary>
/// <remarks>http://developer.github.com/v3/issues/comments/#list-comments-on-an-issue</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="issueNumber">The issue number</param>
IObservable<IssueComment> GetAllForIssue(long repositoryId, int issueNumber);
IObservable<IssueComment> GetAllForIssue(long repositoryId, long issueNumber);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -126,7 +126,7 @@ public interface IObservableIssueCommentsClient
/// <param name="name">The name of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="options">Options for changing the API response</param>
IObservable<IssueComment> GetAllForIssue(string owner, string name, int issueNumber, ApiOptions options);
IObservable<IssueComment> GetAllForIssue(string owner, string name, long issueNumber, ApiOptions options);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -135,7 +135,7 @@ public interface IObservableIssueCommentsClient
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="options">Options for changing the API response</param>
IObservable<IssueComment> GetAllForIssue(long repositoryId, int issueNumber, ApiOptions options);
IObservable<IssueComment> GetAllForIssue(long repositoryId, long issueNumber, ApiOptions options);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -145,7 +145,7 @@ public interface IObservableIssueCommentsClient
/// <param name="name">The name of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
IObservable<IssueComment> GetAllForIssue(string owner, string name, int issueNumber, IssueCommentRequest request);
IObservable<IssueComment> GetAllForIssue(string owner, string name, long issueNumber, IssueCommentRequest request);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -154,7 +154,7 @@ public interface IObservableIssueCommentsClient
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
IObservable<IssueComment> GetAllForIssue(long repositoryId, int issueNumber, IssueCommentRequest request);
IObservable<IssueComment> GetAllForIssue(long repositoryId, long issueNumber, IssueCommentRequest request);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -165,7 +165,7 @@ public interface IObservableIssueCommentsClient
/// <param name="issueNumber">The issue number</param>
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
IObservable<IssueComment> GetAllForIssue(string owner, string name, int issueNumber, IssueCommentRequest request, ApiOptions options);
IObservable<IssueComment> GetAllForIssue(string owner, string name, long issueNumber, IssueCommentRequest request, ApiOptions options);

/// <summary>
/// Gets Issue Comments for a specified Issue.
Expand All @@ -175,7 +175,7 @@ public interface IObservableIssueCommentsClient
/// <param name="issueNumber">The issue number</param>
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
/// <param name="options">Options for changing the API response</param>
IObservable<IssueComment> GetAllForIssue(long repositoryId, int issueNumber, IssueCommentRequest request, ApiOptions options);
IObservable<IssueComment> GetAllForIssue(long repositoryId, long issueNumber, IssueCommentRequest request, ApiOptions options);

/// <summary>
/// Creates a new Issue Comment for a specified Issue.
Expand All @@ -185,7 +185,7 @@ public interface IObservableIssueCommentsClient
/// <param name="name">The name of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="newComment">The text of the new comment</param>
IObservable<IssueComment> Create(string owner, string name, int issueNumber, string newComment);
IObservable<IssueComment> Create(string owner, string name, long issueNumber, string newComment);

/// <summary>
/// Creates a new Issue Comment for a specified Issue.
Expand All @@ -194,7 +194,7 @@ public interface IObservableIssueCommentsClient
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="issueNumber">The issue number</param>
/// <param name="newComment">The text of the new comment</param>
IObservable<IssueComment> Create(long repositoryId, int issueNumber, string newComment);
IObservable<IssueComment> Create(long repositoryId, long issueNumber, string newComment);

/// <summary>
/// Updates a specified Issue Comment.
Expand Down
Loading

0 comments on commit 7c0ce25

Please sign in to comment.