Skip to content

Commit

Permalink
updates generated paging and observable classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfloyd committed Jun 25, 2024
1 parent 9eb9d89 commit 48b3c7f
Show file tree
Hide file tree
Showing 8 changed files with 783 additions and 678 deletions.
1,367 changes: 736 additions & 631 deletions Octokit.AsyncPaginationExtension/Extensions.cs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IObservableDeploymentStatusClient
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId);
IObservable<DeploymentStatus> GetAll(string owner, string name, long deploymentId);

/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
Expand All @@ -32,7 +32,7 @@ public interface IObservableDeploymentStatusClient
/// </remarks>
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId);
IObservable<DeploymentStatus> GetAll(long repositoryId, long deploymentId);

/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
Expand All @@ -45,7 +45,7 @@ public interface IObservableDeploymentStatusClient
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId, ApiOptions options);
IObservable<DeploymentStatus> GetAll(string owner, string name, long deploymentId, ApiOptions options);

/// <summary>
/// Gets all the statuses for the given deployment. Any user with pull access to a repository can
Expand All @@ -57,7 +57,7 @@ public interface IObservableDeploymentStatusClient
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId, ApiOptions options);
IObservable<DeploymentStatus> GetAll(long repositoryId, long deploymentId, ApiOptions options);

/// <summary>
/// Creates a new status for the given deployment. Users with push access can create deployment
Expand All @@ -70,7 +70,7 @@ public interface IObservableDeploymentStatusClient
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="newDeploymentStatus">The new deployment status to create.</param>
IObservable<DeploymentStatus> Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus);
IObservable<DeploymentStatus> Create(string owner, string name, long deploymentId, NewDeploymentStatus newDeploymentStatus);

/// <summary>
/// Creates a new status for the given deployment. Users with push access can create deployment
Expand All @@ -82,6 +82,6 @@ public interface IObservableDeploymentStatusClient
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="newDeploymentStatus">The new deployment status to create.</param>
IObservable<DeploymentStatus> Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus);
IObservable<DeploymentStatus> Create(long repositoryId, long deploymentId, NewDeploymentStatus newDeploymentStatus);
}
}
10 changes: 5 additions & 5 deletions Octokit.Reactive/Clients/IObservableMigrationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IObservableMigrationsClient
/// https://developer.github.com/v3/migration/migrations/#start-a-migration
/// </remarks>
/// <param name="org">The organization for which to start a migration.</param>
/// <param name="migration">Specifies parameters for the migration in a
/// <param name="migration">Specifies parameters for the migration in a
/// <see cref="StartMigrationRequest"/> object.</param>
/// <returns>The started migration.</returns>
IObservable<Migration> Start(
Expand Down Expand Up @@ -64,7 +64,7 @@ IObservable<Migration> GetAll(
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<Migration> Get(
string org,
int id);
long id);

/// <summary>
/// Get the migration archive.
Expand All @@ -77,7 +77,7 @@ IObservable<Migration> Get(
/// <returns>The binary contents of the archive as a byte array.</returns>
IObservable<byte[]> GetArchive(
string org,
int id);
long id);

/// <summary>
/// Deletes a previous migration archive.
Expand All @@ -90,7 +90,7 @@ IObservable<byte[]> GetArchive(
/// <returns></returns>
IObservable<Unit> DeleteArchive(
string org,
int id);
long id);

/// <summary>
/// Unlocks a repository that was locked for migration.
Expand All @@ -104,7 +104,7 @@ IObservable<Unit> DeleteArchive(
/// <returns></returns>
IObservable<Unit> UnlockRepository(
string org,
int id,
long id,
string repo);
}
}
32 changes: 16 additions & 16 deletions Octokit.Reactive/Clients/IObservableRepositoryInvitationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ public interface IObservableRepositoryInvitationsClient
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Accept(int invitationId);
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Accept(long invitationId);

/// <summary>
/// Decline a repository invitation.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Decline(int invitationId);
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Decline(long invitationId);

/// <summary>
/// Deletes a repository invitation.
Expand All @@ -31,15 +31,15 @@ public interface IObservableRepositoryInvitationsClient
/// See the <a href="https://developer.github.com/v3/repos/invitations/#delete-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository.</param>
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Delete(long repositoryId, int invitationId);
/// <param name="invitationId">The id of the invitation.</param>
IObservable<bool> Delete(long repositoryId, long invitationId);

/// <summary>
/// Gets all invitations for the current user.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations">API documentation</a> for more information.
/// </remarks>
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
IObservable<RepositoryInvitation> GetAllForCurrent();

Expand All @@ -49,7 +49,7 @@ public interface IObservableRepositoryInvitationsClient
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations">API documentation</a> for more information.
/// </remarks>
/// <param name="options">Options for changing the API response</param>
/// <param name="options">Options for changing the API response</param>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
IObservable<RepositoryInvitation> GetAllForCurrent(ApiOptions options);

Expand All @@ -58,18 +58,18 @@ public interface IObservableRepositoryInvitationsClient
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
IObservable<RepositoryInvitation> GetAllForRepository(long repositoryId);

/// <summary>
/// Gets all the invitations on a repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository">API documentation</a> for more information.
/// </remarks>
/// </remarks>
/// <param name="repositoryId">The id of the repository</param>
/// /// <param name="options">Options for changing the API response</param>
/// /// <param name="options">Options for changing the API response</param>
IObservable<RepositoryInvitation> GetAllForRepository(long repositoryId, ApiOptions options);

/// <summary>
Expand All @@ -79,9 +79,9 @@ public interface IObservableRepositoryInvitationsClient
/// See the <a href="https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The id of the repository.</param>
/// <param name="invitationId">The id of the invitation.</param>
/// <param name="invitationId">The id of the invitation.</param>
/// <param name="permissions">The permission to set.</param>
/// <returns><see cref="RepositoryInvitation"/></returns>
IObservable<RepositoryInvitation> Edit(long repositoryId, int invitationId, InvitationUpdate permissions);
IObservable<RepositoryInvitation> Edit(long repositoryId, long invitationId, InvitationUpdate permissions);
}
}
12 changes: 6 additions & 6 deletions Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ObservableDeploymentStatusClient(IGitHubClient client)
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
public IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId)
public IObservable<DeploymentStatus> GetAll(string owner, string name, long deploymentId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -51,7 +51,7 @@ public IObservable<DeploymentStatus> GetAll(string owner, string name, int deplo
/// </remarks>
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
public IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId)
public IObservable<DeploymentStatus> GetAll(long repositoryId, long deploymentId)
{
return GetAll(repositoryId, deploymentId, ApiOptions.None);
}
Expand All @@ -67,7 +67,7 @@ public IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId)
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId, ApiOptions options)
public IObservable<DeploymentStatus> GetAll(string owner, string name, long deploymentId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -87,7 +87,7 @@ public IObservable<DeploymentStatus> GetAll(string owner, string name, int deplo
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId, ApiOptions options)
public IObservable<DeploymentStatus> GetAll(long repositoryId, long deploymentId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));

Expand All @@ -106,7 +106,7 @@ public IObservable<DeploymentStatus> GetAll(long repositoryId, int deploymentId,
/// <param name="name">The name of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="newDeploymentStatus">The new deployment status to create.</param>
public IObservable<DeploymentStatus> Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus)
public IObservable<DeploymentStatus> Create(string owner, string name, long deploymentId, NewDeploymentStatus newDeploymentStatus)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Expand All @@ -125,7 +125,7 @@ public IObservable<DeploymentStatus> Create(string owner, string name, int deplo
/// <param name="repositoryId">The Id of the repository.</param>
/// <param name="deploymentId">The id of the deployment.</param>
/// <param name="newDeploymentStatus">The new deployment status to create.</param>
public IObservable<DeploymentStatus> Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus)
public IObservable<DeploymentStatus> Create(long repositoryId, long deploymentId, NewDeploymentStatus newDeploymentStatus)
{
Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus));

Expand Down
8 changes: 4 additions & 4 deletions Octokit.Reactive/Clients/ObservableMigrationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public IObservable<Migration> GetAll(string org, ApiOptions options)
/// <param name="org">The organization which is migrating.</param>
/// <param name="id">Migrations Id of the organization.</param>
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
public IObservable<Migration> Get(string org, int id)
public IObservable<Migration> Get(string org, long id)
{
return _client.Get(org, id).ToObservable();
}
Expand All @@ -88,7 +88,7 @@ public IObservable<Migration> Get(string org, int id)
/// <param name="org">The organization of which the migration was.</param>
/// <param name="id">The Id of the migration.</param>
/// <returns>The binary contents of the archive as a byte array.</returns>
public IObservable<byte[]> GetArchive(string org, int id)
public IObservable<byte[]> GetArchive(string org, long id)
{
return _client.GetArchive(org, id).ToObservable();
}
Expand All @@ -102,7 +102,7 @@ public IObservable<byte[]> GetArchive(string org, int id)
/// <param name="org">The organization of which the migration was.</param>
/// <param name="id">The Id of the migration.</param>
/// <returns></returns>
public IObservable<Unit> DeleteArchive(string org, int id)
public IObservable<Unit> DeleteArchive(string org, long id)
{
return _client.DeleteArchive(org, id).ToObservable();
}
Expand All @@ -117,7 +117,7 @@ public IObservable<Unit> DeleteArchive(string org, int id)
/// <param name="id">The Id of the migration.</param>
/// <param name="repo">The repo to unlock.</param>
/// <returns></returns>
public IObservable<Unit> UnlockRepository(string org, int id, string repo)
public IObservable<Unit> UnlockRepository(string org, long id, string repo)
{
return _client.UnlockRepository(org, id, repo).ToObservable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ObservableRepositoryInvitationsClient(IGitHubClient client)
/// See the <a href="https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
public IObservable<bool> Accept(int invitationId)
public IObservable<bool> Accept(long invitationId)
{
return _client.Accept(invitationId).ToObservable();
}
Expand All @@ -38,7 +38,7 @@ public IObservable<bool> Accept(int invitationId)
/// See the <a href="https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation">API documentation</a> for more information.
/// </remarks>
/// <param name="invitationId">The id of the invitation.</param>
public IObservable<bool> Decline(int invitationId)
public IObservable<bool> Decline(long invitationId)
{
return _client.Decline(invitationId).ToObservable();
}
Expand All @@ -51,7 +51,7 @@ public IObservable<bool> Decline(int invitationId)
/// </remarks>
/// <param name="repositoryId">The id of the repository.</param>
/// <param name="invitationId">The id of the invitation.</param>
public IObservable<bool> Delete(long repositoryId, int invitationId)
public IObservable<bool> Delete(long repositoryId, long invitationId)
{
return _client.Delete(repositoryId, invitationId).ToObservable();
}
Expand All @@ -65,7 +65,7 @@ public IObservable<bool> Delete(long repositoryId, int invitationId)
/// <param name="repositoryId">The id of the repository.</param>
/// <param name="invitationId">The id of the invitatio.n</param>
/// <param name="permissions">The permission to set.</param>
public IObservable<RepositoryInvitation> Edit(long repositoryId, int invitationId, InvitationUpdate permissions)
public IObservable<RepositoryInvitation> Edit(long repositoryId, long invitationId, InvitationUpdate permissions)
{
Ensure.ArgumentNotNull(permissions, nameof(permissions));

Expand Down
Loading

0 comments on commit 48b3c7f

Please sign in to comment.