From bee5b1533db1833dc03e773300bc3f98c8fdff99 Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Fri, 26 Aug 2022 06:33:34 +0100 Subject: [PATCH 1/4] Adding credential-authorization get endpoints --- .../Clients/OrganizationsClientTests.cs | 97 +++++++++++++++++++ Octokit/Clients/IOrganizationsClient.cs | 8 ++ Octokit/Clients/OrganizationsClient.cs | 68 +++++++++++++ Octokit/Helpers/ApiUrls.cs | 10 ++ .../Models/Response/OrganizationCredential.cs | 71 ++++++++++++++ 5 files changed, 254 insertions(+) create mode 100644 Octokit/Models/Response/OrganizationCredential.cs diff --git a/Octokit.Tests/Clients/OrganizationsClientTests.cs b/Octokit.Tests/Clients/OrganizationsClientTests.cs index 2dbf0a2a73..2e2df91586 100644 --- a/Octokit.Tests/Clients/OrganizationsClientTests.cs +++ b/Octokit.Tests/Clients/OrganizationsClientTests.cs @@ -192,5 +192,102 @@ public async Task EnsuresNonNullArguments() await Assert.ThrowsAsync(() => client.Update("", new OrganizationUpdate())); } } + + public class TheGetAllAuthorizationsMethod + { + [Fact] + public async Task RequestTheCorrectUrl() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await client.GetAllAuthorizations("fake"); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/credential-authorizations")); + } + + [Fact] + public async Task RequestTheCorrectUrlWithOptions() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await client.GetAllAuthorizations("fake", new ApiOptions() { PageCount = 1, PageSize = 1, StartPage = 1}); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/credential-authorizations"), Args.ApiOptions); + } + + [Fact] + public async Task RequestTheCorrectUrlWithLogin() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await client.GetAllAuthorizations("fake", "login"); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/credential-authorizations?login=login")); + } + + [Fact] + public async Task RequestTheCorrectUrlWithLoginAndUrl() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await client.GetAllAuthorizations("fake", "login", new ApiOptions() { PageCount = 1, PageSize = 1, StartPage = 1 }); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/credential-authorizations?login=login"), Args.ApiOptions); + } + + [Fact] + public async Task EnsuresNonNullArguments() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations(null)); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("")); + } + + [Fact] + public async Task EnsuresNonNullArgumentsWithOptions() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations(null, new ApiOptions())); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("", new ApiOptions())); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", (ApiOptions)null)); + } + + [Fact] + public async Task EnsuresNonNullArgumentsWithLogin() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations(null, "asd")); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("", "asd")); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", (string)null)); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", "")); + } + + [Fact] + public async Task EnsuresNonNullArgumentsWithLoginAndOptions() + { + var connection = Substitute.For(); + var client = new OrganizationsClient(connection); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations(null, "asd", new ApiOptions())); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("", "asd", new ApiOptions())); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", (string)null, new ApiOptions())); + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", "", new ApiOptions())); + + await Assert.ThrowsAsync(() => client.GetAllAuthorizations("asd", "asd", null)); + } + } } } diff --git a/Octokit/Clients/IOrganizationsClient.cs b/Octokit/Clients/IOrganizationsClient.cs index 63f7c5758c..152536609d 100644 --- a/Octokit/Clients/IOrganizationsClient.cs +++ b/Octokit/Clients/IOrganizationsClient.cs @@ -113,5 +113,13 @@ public interface IOrganizationsClient /// Thrown if the client is not authenticated. /// A Task Update(string org, OrganizationUpdate updateRequest); + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + Task> GetAllAuthorizations(string org); + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + Task> GetAllAuthorizations(string org, ApiOptions options); + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + Task> GetAllAuthorizations(string org, string login); + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + Task> GetAllAuthorizations(string org, string login, ApiOptions options); } } diff --git a/Octokit/Clients/OrganizationsClient.cs b/Octokit/Clients/OrganizationsClient.cs index 42a89cd13b..fb07b3a90e 100644 --- a/Octokit/Clients/OrganizationsClient.cs +++ b/Octokit/Clients/OrganizationsClient.cs @@ -167,5 +167,73 @@ public Task Update(string org, OrganizationUpdate updateRequest) return ApiConnection.Patch(updateUri, updateRequest); } + + /// + /// Returns all s. + /// + /// The organization name. + /// A list of s. + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + public Task> GetAllAuthorizations(string org) + { + Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); + + var url = ApiUrls.AllOrganizationCredentials(org); + + return ApiConnection.GetAll(url); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Options for changing the API response + /// A list of s. + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + public Task> GetAllAuthorizations(string org, ApiOptions options) + { + Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); + Ensure.ArgumentNotNull(options, nameof(options)); + + var url = ApiUrls.AllOrganizationCredentials(org); + + return ApiConnection.GetAll(url, options); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// A list of s. + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + public Task> GetAllAuthorizations(string org, string login) + { + Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); + + var url = ApiUrls.AllOrganizationCredentials(org, login); + + return ApiConnection.GetAll(url); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// Options for changing the API response + /// A list of s. + [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + public Task> GetAllAuthorizations(string org, string login, ApiOptions options) + { + Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); + Ensure.ArgumentNotNull(options, nameof(options)); + + var url = ApiUrls.AllOrganizationCredentials(org, login); + + return ApiConnection.GetAll(url, options); + } } } diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index de890c6247..5124a2add5 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -4457,5 +4457,15 @@ public static Uri Meta() { return "meta".FormatUri(); } + + public static Uri AllOrganizationCredentials(string org) + { + return "orgs/{0}/credential-authorizations".FormatUri(org); + } + + public static Uri AllOrganizationCredentials(string org, string login) + { + return "orgs/{0}/credential-authorizations?login={1}".FormatUri(org, login); + } } } diff --git a/Octokit/Models/Response/OrganizationCredential.cs b/Octokit/Models/Response/OrganizationCredential.cs new file mode 100644 index 0000000000..868f571de2 --- /dev/null +++ b/Octokit/Models/Response/OrganizationCredential.cs @@ -0,0 +1,71 @@ +using Octokit.Internal; +using System; +using System.Diagnostics; + +namespace Octokit +{ + [DebuggerDisplay("{DebuggerDisplay,nq}")] + public class OrganizationCredential + { + public OrganizationCredential() { } + + /// + /// User login that owns the underlying credential. + /// + public string Login { get; private set; } + + /// + /// Unique identifier for the credential. + /// + public long CredentialId { get; private set; } + + /// + /// Human-readable description of the credential type. + /// + public string CredentialType { get; private set; } + + /// + /// Last eight characters of the credential. Only included in responses with credential_type of personal access token. + /// + public string TokenLastEight { get; private set; } + + /// + /// Date when the credential was authorized for use. + /// + public DateTime CredentialAuthorizedAt { get; private set; } + + /// + /// List of oauth scopes the token has been granted. + /// + public string[] Scopes { get; private set; } + + /// + /// Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. + /// + public string Fingerprint { get; private set; } + + /// + /// Date when the credential was last accessed. May be null if it was never accessed + /// + public DateTime? CredentialAccessedAt { get; private set; } + + public long? AuthorizedCredentialId { get; private set; } + + /// + /// The title given to the ssh key. This will only be present when the credential is an ssh key. + /// + public string AuthorizedCredentialTitle { get; private set; } + + /// + /// The note given to the token. This will only be present when the credential is a token. + /// + public string AuthorizedCredentialNote { get; private set; } + + /// + /// The expiry for the token. This will only be present when the credential is a token. + /// + public DateTime? AuthorizedCredentialExpiresAt { get; private set; } + + internal string DebuggerDisplay => new SimpleJsonSerializer().Serialize(this); + } +} \ No newline at end of file From 620f14d93237d113b951ee274f35e13f3d728cda Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Sun, 28 Aug 2022 17:55:59 +0100 Subject: [PATCH 2/4] Fixing reactive client issues --- .../Clients/IObservableOrganizationsClient.cs | 32 ++++++++ .../Clients/ObservableOrganizationsClient.cs | 63 +++++++++++++++ .../ObservableOrganizationsClientTests.cs | 76 +++++++++++++++++++ Octokit/Clients/IOrganizationsClient.cs | 32 +++++++- .../Models/Response/OrganizationCredential.cs | 30 ++++++++ 5 files changed, 229 insertions(+), 4 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs b/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs index 793b17846e..8e7596c7c5 100644 --- a/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs +++ b/Octokit.Reactive/Clients/IObservableOrganizationsClient.cs @@ -88,5 +88,37 @@ public interface IObservableOrganizationsClient /// Thrown if the client is not authenticated. /// A IObservable Update(string org, OrganizationUpdate updateRequest); + + /// + /// Returns all s. + /// + /// The organization name. + /// A list of s. + IObservable GetAllAuthorizations(string org); + + /// + /// Returns all s. + /// + /// The organization name. + /// Options for changing the API response + /// A list of s. + IObservable GetAllAuthorizations(string org, ApiOptions options); + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// A list of s. + IObservable GetAllAuthorizations(string org, string login); + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// Options for changing the API response + /// A list of s. + IObservable GetAllAuthorizations(string org, string login, ApiOptions options); } } diff --git a/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs b/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs index ec816645e8..348dc49e83 100644 --- a/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableOrganizationsClient.cs @@ -144,5 +144,68 @@ public IObservable Update(string org, OrganizationUpdate updateReq return _client.Update(org, updateRequest).ToObservable(); } + /// + /// Returns all s. + /// + /// The organization name. + /// A list of s. + public IObservable GetAllAuthorizations(string org) + { + Ensure.ArgumentNotNull(org, nameof(org)); + + var url = ApiUrls.AllOrganizationCredentials(org); + + return _connection.GetAndFlattenAllPages(url); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Options for changing the API response + /// A list of s. + public IObservable GetAllAuthorizations(string org, ApiOptions options) + { + Ensure.ArgumentNotNull(org, nameof(org)); + Ensure.ArgumentNotNull(options, nameof(options)); + + var url = ApiUrls.AllOrganizationCredentials(org); + + return _connection.GetAndFlattenAllPages(url, options); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// A list of s. + public IObservable GetAllAuthorizations(string org, string login) + { + Ensure.ArgumentNotNull(org, nameof(org)); + Ensure.ArgumentNotNull(login, nameof(login)); + + var url = ApiUrls.AllOrganizationCredentials(org, login); + + return _connection.GetAndFlattenAllPages(url); + } + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// Options for changing the API response + /// A list of s. + public IObservable GetAllAuthorizations(string org, string login, ApiOptions options) + { + Ensure.ArgumentNotNull(org, nameof(org)); + Ensure.ArgumentNotNull(login, nameof(login)); + Ensure.ArgumentNotNull(options, nameof(options)); + + var url = ApiUrls.AllOrganizationCredentials(org, login); + + return _connection.GetAndFlattenAllPages(url, options); + } } } diff --git a/Octokit.Tests/Reactive/ObservableOrganizationsClientTests.cs b/Octokit.Tests/Reactive/ObservableOrganizationsClientTests.cs index 21eda991c2..7c7160e018 100644 --- a/Octokit.Tests/Reactive/ObservableOrganizationsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableOrganizationsClientTests.cs @@ -153,5 +153,81 @@ public void EnsuresNonNullArguments() Assert.Throws(() => client.Update("", new OrganizationUpdate())); } } + + public class TheGetAllAuthorizationsMethod + { + [Fact] + public void RequestsTheCorrectUrl() + { + var gitHubClient = Substitute.For(); + var client = new ObservableOrganizationsClient(gitHubClient); + + client.GetAllAuthorizations("org"); + + gitHubClient.Received().Organization.GetAllAuthorizations("org"); + } + + [Fact] + public void RequestsTheCorrectUrlWithApiOptions() + { + var gitHubClient = Substitute.For(); + var client = new ObservableOrganizationsClient(gitHubClient); + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + client.GetAllAuthorizations("org", options); + + gitHubClient.Received().Organization.GetAllAuthorizations("org", options); + } + + [Fact] + public void RequestsTheCorrectUrlWithLogin() + { + var gitHubClient = Substitute.For(); + var client = new ObservableOrganizationsClient(gitHubClient); + + client.GetAllAuthorizations("org", "login"); + + gitHubClient.Received().Organization.GetAllAuthorizations("org", "login"); + } + + [Fact] + public void RequestsTheCorrectUrlWithApiOptionsWithLogin() + { + var gitHubClient = Substitute.For(); + var client = new ObservableOrganizationsClient(gitHubClient); + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + client.GetAllAuthorizations("org", "login", options); + + gitHubClient.Received().Organization.GetAllAuthorizations("org", "login", options); + } + + [Fact] + public void EnsuresNonNullArguments() + { + var gitHubClient = Substitute.For(); + var client = new ObservableOrganizationsClient(gitHubClient); + + Assert.Throws(() => client.GetAllAuthorizations(null)); + Assert.Throws(() => client.GetAllAuthorizations(null, ApiOptions.None)); + Assert.Throws(() => client.GetAllAuthorizations("username", (string)null)); + Assert.Throws(() => client.GetAllAuthorizations("username", null, ApiOptions.None)); + + Assert.Throws(() => client.GetAllAuthorizations("asd", (ApiOptions)null)); + Assert.Throws(() => client.GetAllAuthorizations("asd", "asd", null)); + } + } } } \ No newline at end of file diff --git a/Octokit/Clients/IOrganizationsClient.cs b/Octokit/Clients/IOrganizationsClient.cs index 152536609d..5f3f2fc6fb 100644 --- a/Octokit/Clients/IOrganizationsClient.cs +++ b/Octokit/Clients/IOrganizationsClient.cs @@ -113,13 +113,37 @@ public interface IOrganizationsClient /// Thrown if the client is not authenticated. /// A Task Update(string org, OrganizationUpdate updateRequest); - [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + + /// + /// Returns all s. + /// + /// The organization name. + /// A list of s. Task> GetAllAuthorizations(string org); - [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + + /// + /// Returns all s. + /// + /// The organization name. + /// Options for changing the API response + /// A list of s. Task> GetAllAuthorizations(string org, ApiOptions options); - [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// A list of s. Task> GetAllAuthorizations(string org, string login); - [ManualRoute("GET", "/orgs/{org}/credential-authorizations")] + + /// + /// Returns all s. + /// + /// The organization name. + /// Limits the list of credentials authorizations for an organization to a specific login + /// Options for changing the API response + /// A list of s. Task> GetAllAuthorizations(string org, string login, ApiOptions options); } } diff --git a/Octokit/Models/Response/OrganizationCredential.cs b/Octokit/Models/Response/OrganizationCredential.cs index 868f571de2..235d9dbb64 100644 --- a/Octokit/Models/Response/OrganizationCredential.cs +++ b/Octokit/Models/Response/OrganizationCredential.cs @@ -9,6 +9,36 @@ public class OrganizationCredential { public OrganizationCredential() { } + public OrganizationCredential( + string login, + long credentialId, + string credentialType, + string tokenLastEight, + DateTime credentialAuthorizedAt, + string[] scopes, + string fingerprint, + DateTime? credentialAccessedAt, + long? authorizedCredentialId, + string authorizedCredentialTitle, + string authorizedCredentialNote, + DateTime? authorizedCredentialExpiresAt) + { + Login = login; + CredentialId = credentialId; + CredentialType = credentialType; + TokenLastEight = tokenLastEight; + CredentialAuthorizedAt = credentialAuthorizedAt; + Scopes = scopes; + Fingerprint = fingerprint; + CredentialAccessedAt = credentialAccessedAt; + AuthorizedCredentialId = authorizedCredentialId; + AuthorizedCredentialTitle = authorizedCredentialTitle; + AuthorizedCredentialNote = authorizedCredentialNote; + AuthorizedCredentialExpiresAt = authorizedCredentialExpiresAt; + } + + + /// /// User login that owns the underlying credential. /// From c0924cce3de50a91fc3d717d84ab50dccd300c90 Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Thu, 8 Sep 2022 06:26:23 +0100 Subject: [PATCH 3/4] Updating async pagination classes --- .../Extensions.cs | 986 +++++++++--------- 1 file changed, 497 insertions(+), 489 deletions(-) diff --git a/Octokit.AsyncPaginationExtension/Extensions.cs b/Octokit.AsyncPaginationExtension/Extensions.cs index a9009f3b76..c541ac0bd8 100644 --- a/Octokit.AsyncPaginationExtension/Extensions.cs +++ b/Octokit.AsyncPaginationExtension/Extensions.cs @@ -14,57 +14,33 @@ public static class Extensions { private const int DEFAULT_PAGE_SIZE = 30; - /// - public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this ITeamsClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForCurrentAsync(this ITeamsClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllChildTeamsAsync(this ITeamsClient t, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllChildTeams(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllMembersAsync(this ITeamsClient t, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllMembers(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllMembersAsync(this ITeamsClient t, int id, TeamMembersRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllMembers(id, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForRepositoryAsync(this IAssigneesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllRepositoriesAsync(this ITeamsClient t, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllRepositories(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForRepositoryAsync(this IAssigneesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllPendingInvitationsAsync(this ITeamsClient t, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllPendingInvitations(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IAuthorizationsClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAnnotationsAsync(this ICheckRunsClient t, string owner, string name, long checkRunId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllAnnotations(owner, name, checkRunId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAnnotationsAsync(this ICheckRunsClient t, long repositoryId, long checkRunId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllAnnotations(repositoryId, checkRunId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, string owner, string name, RepositoryCollaboratorListRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this ICommitCommentReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepoCollaboratorsClient t, long repositoryId, RepositoryCollaboratorListRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this ICommitCommentReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this ICommitStatusClient t, string owner, string name, string reference, int pageSize = DEFAULT_PAGE_SIZE) @@ -74,145 +50,89 @@ public static IPaginatedList GetAllAsync(this ICommitStatusClient public static IPaginatedList GetAllAsync(this ICommitStatusClient t, long repositoryId, string reference, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, reference, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewCommentReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewCommentReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, string owner, string name, MilestoneRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IMilestonesClient t, long repositoryId, MilestoneRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IIssueCommentReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IIssueCommentReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IAuthorizationsClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForCurrentAsync(this IRepositoriesClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForCurrentAsync(this IRepositoriesClient t, RepositoryRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForCurrent(request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForUserAsync(this IRepositoriesClient t, string login, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForUser(login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForOrgAsync(this IRepositoriesClient t, string organization, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrg(organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllContributorsAsync(this IRepositoriesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllContributors(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllContributorsAsync(this IRepositoriesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllContributors(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IDeploymentsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllContributorsAsync(this IRepositoriesClient t, string owner, string name, bool includeAnonymous, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllContributors(owner, name, includeAnonymous, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IDeploymentsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllContributorsAsync(this IRepositoriesClient t, long repositoryId, bool includeAnonymous, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllContributors(repositoryId, includeAnonymous, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IDeploymentStatusClient t, string owner, string name, int deploymentId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, deploymentId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllTeamsAsync(this IRepositoriesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllTeams(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IDeploymentStatusClient t, long repositoryId, int deploymentId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, deploymentId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllTeamsAsync(this IRepositoriesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllTeams(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IEventsClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllTagsAsync(this IRepositoriesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllTags(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForRepositoryAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllTagsAsync(this IRepositoriesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllTags(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForRepositoryAsync(this IEventsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IReferencesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllIssuesForRepositoryAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllIssuesForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IReferencesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllIssuesForRepositoryAsync(this IEventsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllIssuesForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllForSubNamespaceAsync(this IReferencesClient t, string owner, string name, string subNamespace, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForSubNamespace(owner, name, subNamespace, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForRepositoryNetworkAsync(this IEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepositoryNetwork(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllForSubNamespaceAsync(this IReferencesClient t, long repositoryId, string subNamespace, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForSubNamespace(repositoryId, subNamespace, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForOrganizationAsync(this IEventsClient t, string organization, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrganization(organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IOrganizationHooksClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllUserReceivedAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllUserReceived(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllUserReceivedPublicAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllUserReceivedPublic(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersFilter filter, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, filter, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllUserPerformedAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllUserPerformed(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersRole role, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, role, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllUserPerformedPublicAsync(this IEventsClient t, string user, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllUserPerformedPublic(user, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IOrganizationMembersClient t, string org, OrganizationMembersFilter filter, OrganizationMembersRole role, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, filter, role, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForAnOrganizationAsync(this IEventsClient t, string user, string organization, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForAnOrganization(user, organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllPublicAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllPublic(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForCurrentAsync(this IFollowersClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllPendingInvitationsAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllPendingInvitations(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IFollowersClient t, string login, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllFailedInvitationsAsync(this IOrganizationMembersClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllFailedInvitations(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllFollowingForCurrentAsync(this IFollowersClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAllFollowingForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepositoryBranchesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllFollowingAsync(this IFollowersClient t, string login, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllFollowing(login, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllAsync(this IRepositoryBranchesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllForGistAsync(this IGistCommentsClient t, string gistId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForGist(gistId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllAsync(this IGistsClient t, int pageSize = DEFAULT_PAGE_SIZE) @@ -254,121 +174,17 @@ public static IPaginatedList GetAllCommitsAsync(this IGistsClient t public static IPaginatedList GetAllForksAsync(this IGistsClient t, string id, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForks(id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllForCurrentAsync(this IRepositoryInvitationsClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllInstallationsForCurrentAsync(this IGitHubAppsClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAllInstallationsForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllForRepositoryAsync(this IRepositoryInvitationsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IReleasesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IReleasesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAssetsAsync(this IReleasesClient t, string owner, string name, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllAssets(owner, name, id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAssetsAsync(this IReleasesClient t, long repositoryId, int id, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllAssets(repositoryId, id, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllCommentsAsync(this IPullRequestReviewsClient t, string owner, string name, int number, long reviewId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllComments(owner, name, number, reviewId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllCommentsAsync(this IPullRequestReviewsClient t, long repositoryId, int number, long reviewId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllComments(repositoryId, number, reviewId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IOrganizationOutsideCollaboratorsClient t, string org, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IOrganizationOutsideCollaboratorsClient t, string org, OrganizationMembersFilter filter, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(org, filter, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IDeploymentsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IDeploymentsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForCurrentAsync(this INotificationsClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForCurrentAsync(this INotificationsClient t, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForCurrent(request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, string owner, string name, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this INotificationsClient t, long repositoryId, NotificationsRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IUserEmailsClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAll, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewCommentsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IPullRequestReviewCommentsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IPullRequestReviewCommentsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IPullRequestReviewCommentsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IPullRequestReviewCommentsClient t, string owner, string name, PullRequestReviewCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllForRepositoryAsync(this IPullRequestReviewCommentsClient t, long repositoryId, PullRequestReviewCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - - /// - public static IPaginatedList GetAllAsync(this IUserKeysClient t, string userName, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(options => t.GetAll(userName, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IIssueCommentReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); - /// - public static IPaginatedList GetAllForCurrentAsync(this IUserKeysClient t, int pageSize = DEFAULT_PAGE_SIZE) - => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IIssueCommentReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); /// public static IPaginatedList GetAllForRepositoryAsync(this IIssueCommentsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) @@ -402,6 +218,70 @@ public static IPaginatedList GetAllForIssueAsync(this IIssueCommen public static IPaginatedList GetAllForIssueAsync(this IIssueCommentsClient t, long repositoryId, int number, IssueCommentRequest request, int pageSize = DEFAULT_PAGE_SIZE) => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(repositoryId, number, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// + public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllAsync(this IIssueReactionsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAll(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForCurrentAsync(this IIssuesClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAllForCurrent, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForCurrentAsync(this IIssuesClient t, IssueRequest request, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForCurrent(request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForOwnedAndMemberRepositoriesAsync(this IIssuesClient t, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(t.GetAllForOwnedAndMemberRepositories, pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForOwnedAndMemberRepositoriesAsync(this IIssuesClient t, IssueRequest request, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForOwnedAndMemberRepositories(request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForOrganizationAsync(this IIssuesClient t, string organization, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrganization(organization, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForOrganizationAsync(this IIssuesClient t, string organization, IssueRequest request, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForOrganization(organization, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesClient t, string owner, string name, RepositoryIssueRequest request, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesClient t, long repositoryId, RepositoryIssueRequest request, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, request, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForIssueAsync(this IIssuesEventsClient t, string owner, string name, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(owner, name, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForIssueAsync(this IIssuesEventsClient t, long repositoryId, int number, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForIssue(repositoryId, number, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesEventsClient t, string owner, string name, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(owner, name, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + + /// + public static IPaginatedList GetAllForRepositoryAsync(this IIssuesEventsClient t, long repositoryId, int pageSize = DEFAULT_PAGE_SIZE) + => pageSize > 0 ? new PaginatedList(options => t.GetAllForRepository(repositoryId, options), pageSize) : throw new ArgumentOutOfRangeException(nameof(pageSize), pageSize, "The page size must be positive."); + /// public static IPaginatedList