Skip to content

Commit 6565a07

Browse files
authored
[BREAKING CHANGES]: int to long Ids for PreReceiveHook, Deployment Environments, Repository, Org Team, Repo Invitations, Public Key, Project Cards, Organization Invitation, Migrations, GpgKey, Deployment, Authorizations, Accounts / Profiles, Codespace / Workspaces (#2941)
* Fixes ids for Releases, Collaborators, and Contributors * updates the interface for releases * update the obverable release client * updates ids from int to long based on GH database schema * converts a test condition to use the proper type * updates generated paging and observable classes
1 parent 16cea25 commit 6565a07

File tree

84 files changed

+1293
-1188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1293
-1188
lines changed

Octokit.AsyncPaginationExtension/Extensions.cs

+736-631
Large diffs are not rendered by default.

Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseLdapClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public interface IObservableEnterpriseLdapClient
4343
/// <param name="teamId">The teamId to update LDAP mapping</param>
4444
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
4545
/// <returns>The <see cref="Team"/> object.</returns>
46-
IObservable<Team> UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping);
46+
IObservable<Team> UpdateTeamMapping(long teamId, NewLdapMapping newLdapMapping);
4747

4848
/// <summary>
4949
/// Queue an LDAP Sync job for a team on a GitHub Enterprise appliance (must be Site Admin user).
@@ -53,6 +53,6 @@ public interface IObservableEnterpriseLdapClient
5353
/// </remarks>
5454
/// <param name="teamId">The teamId to update LDAP mapping</param>
5555
/// <returns>The <see cref="LdapSyncResponse"/> of the queue request.</returns>
56-
IObservable<LdapSyncResponse> QueueSyncTeamMapping(int teamId);
56+
IObservable<LdapSyncResponse> QueueSyncTeamMapping(long teamId);
5757
}
5858
}

Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public IObservable<LdapSyncResponse> QueueSyncUserMapping(string userName)
5858
/// <param name="teamId">The teamId to update LDAP mapping</param>
5959
/// <param name="newLdapMapping">The <see cref="NewLdapMapping"/></param>
6060
/// <returns>The <see cref="Team"/> object.</returns>
61-
public IObservable<Team> UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping)
61+
public IObservable<Team> UpdateTeamMapping(long teamId, NewLdapMapping newLdapMapping)
6262
{
6363
return _client.UpdateTeamMapping(teamId, newLdapMapping).ToObservable();
6464
}
@@ -71,7 +71,7 @@ public IObservable<Team> UpdateTeamMapping(int teamId, NewLdapMapping newLdapMap
7171
/// </remarks>
7272
/// <param name="teamId">The teamId to update LDAP mapping</param>
7373
/// <returns>The <see cref="LdapSyncResponse"/> of the queue request.</returns>
74-
public IObservable<LdapSyncResponse> QueueSyncTeamMapping(int teamId)
74+
public IObservable<LdapSyncResponse> QueueSyncTeamMapping(long teamId)
7575
{
7676
return _client.QueueSyncTeamMapping(teamId).ToObservable();
7777
}

Octokit.Reactive/Clients/IObservableAuthorizationsClient.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public interface IObservableAuthorizationsClient
4242
/// <returns>An <see cref="Authorization"/></returns>
4343
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
4444
Justification = "It's fiiiine. It's fine. Trust us.")]
45-
IObservable<Authorization> Get(int id);
45+
IObservable<Authorization> Get(long id);
4646

4747
/// <summary>
4848
/// Creates a new personal token for the authenticated user.
@@ -132,7 +132,7 @@ IObservable<ApplicationAuthorization> Create(
132132
string twoFactorAuthenticationCode);
133133

134134
/// <summary>
135-
/// This method will create a new authorization for the specified OAuth application, only if an authorization
135+
/// This method will create a new authorization for the specified OAuth application, only if an authorization
136136
/// for that application doesn’t already exist for the user. It returns the user’s token for the application
137137
/// if one exists. Otherwise, it creates one.
138138
/// </summary>
@@ -143,7 +143,7 @@ IObservable<ApplicationAuthorization> Create(
143143
/// <param name="clientId">Client Id for the OAuth application that is requesting the token</param>
144144
/// <param name="clientSecret">The client secret</param>
145145
/// <param name="newAuthorization">Defines the scopes and metadata for the token</param>
146-
/// <exception cref="AuthorizationException">Thrown when the user does not have permission to make
146+
/// <exception cref="AuthorizationException">Thrown when the user does not have permission to make
147147
/// this request. Check </exception>
148148
/// <exception cref="TwoFactorRequiredException">Thrown when the current account has two-factor
149149
/// authentication enabled.</exception>
@@ -154,19 +154,19 @@ IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthentication(
154154
NewAuthorization newAuthorization);
155155

156156
/// <summary>
157-
/// This method will create a new authorization for the specified OAuth application, only if an authorization
157+
/// This method will create a new authorization for the specified OAuth application, only if an authorization
158158
/// for that application doesn’t already exist for the user. It returns the user’s token for the application
159159
/// if one exists. Otherwise, it creates one.
160160
/// </summary>
161161
/// <remarks>
162-
/// See <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API
162+
/// See <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app">API
163163
/// documentation</a> for more details.
164164
/// </remarks>
165165
/// <param name="clientId">Client Id for the OAuth application that is requesting the token</param>
166166
/// <param name="clientSecret">The client secret</param>
167167
/// <param name="newAuthorization">Defines the scopes and metadata for the token</param>
168168
/// <param name="twoFactorAuthenticationCode">The two-factor authentication code provided by the user</param>
169-
/// <exception cref="AuthorizationException">Thrown when the user does not have permission to make
169+
/// <exception cref="AuthorizationException">Thrown when the user does not have permission to make
170170
/// this request. Check </exception>
171171
/// <exception cref="TwoFactorChallengeFailedException">Thrown when the two-factor code is not
172172
/// valid.</exception>
@@ -219,29 +219,29 @@ IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthentication(
219219
/// <param name="id">The id of the <see cref="Authorization"/></param>
220220
/// <param name="authorizationUpdate">The changes to make to the authorization</param>
221221
/// <returns></returns>
222-
IObservable<Authorization> Update(int id, AuthorizationUpdate authorizationUpdate);
222+
IObservable<Authorization> Update(long id, AuthorizationUpdate authorizationUpdate);
223223

224224
/// <summary>
225225
/// Deletes the specified <see cref="Authorization"/>.
226226
/// </summary>
227227
/// <remarks>
228228
/// This method requires authentication.
229-
/// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API
229+
/// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API
230230
/// documentation</a> for more details.
231231
/// </remarks>
232232
/// <param name="id">The system-wide Id of the authorization to delete</param>
233233
/// <exception cref="AuthorizationException">
234234
/// Thrown when the current user does not have permission to make the request.
235235
/// </exception>
236236
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
237-
IObservable<Unit> Delete(int id);
237+
IObservable<Unit> Delete(long id);
238238

239239
/// <summary>
240240
/// Deletes the specified <see cref="Authorization"/>.
241241
/// </summary>
242242
/// <remarks>
243243
/// This method requires authentication.
244-
/// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API
244+
/// See the <a href="http://developer.github.com/v3/oauth/#delete-an-authorization">API
245245
/// documentation</a> for more details.
246246
/// </remarks>
247247
/// <param name="id">The system-wide Id of the authorization to delete</param>
@@ -250,6 +250,6 @@ IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthentication(
250250
/// Thrown when the current user does not have permission to make the request.
251251
/// </exception>
252252
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
253-
IObservable<Unit> Delete(int id, string twoFactorAuthenticationCode);
253+
IObservable<Unit> Delete(long id, string twoFactorAuthenticationCode);
254254
}
255255
}

Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface IObservableDeploymentStatusClient
2121
/// <param name="owner">The owner of the repository.</param>
2222
/// <param name="name">The name of the repository.</param>
2323
/// <param name="deploymentId">The id of the deployment.</param>
24-
IObservable<DeploymentStatus> GetAll(string owner, string name, int deploymentId);
24+
IObservable<DeploymentStatus> GetAll(string owner, string name, long deploymentId);
2525

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

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

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

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

7575
/// <summary>
7676
/// Creates a new status for the given deployment. Users with push access can create deployment
@@ -82,6 +82,6 @@ public interface IObservableDeploymentStatusClient
8282
/// <param name="repositoryId">The Id of the repository.</param>
8383
/// <param name="deploymentId">The id of the deployment.</param>
8484
/// <param name="newDeploymentStatus">The new deployment status to create.</param>
85-
IObservable<DeploymentStatus> Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus);
85+
IObservable<DeploymentStatus> Create(long repositoryId, long deploymentId, NewDeploymentStatus newDeploymentStatus);
8686
}
8787
}

Octokit.Reactive/Clients/IObservableMigrationsClient.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface IObservableMigrationsClient
2121
/// https://developer.github.com/v3/migration/migrations/#start-a-migration
2222
/// </remarks>
2323
/// <param name="org">The organization for which to start a migration.</param>
24-
/// <param name="migration">Specifies parameters for the migration in a
24+
/// <param name="migration">Specifies parameters for the migration in a
2525
/// <see cref="StartMigrationRequest"/> object.</param>
2626
/// <returns>The started migration.</returns>
2727
IObservable<Migration> Start(
@@ -64,7 +64,7 @@ IObservable<Migration> GetAll(
6464
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
6565
IObservable<Migration> Get(
6666
string org,
67-
int id);
67+
long id);
6868

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

8282
/// <summary>
8383
/// Deletes a previous migration archive.
@@ -90,7 +90,7 @@ IObservable<byte[]> GetArchive(
9090
/// <returns></returns>
9191
IObservable<Unit> DeleteArchive(
9292
string org,
93-
int id);
93+
long id);
9494

9595
/// <summary>
9696
/// Unlocks a repository that was locked for migration.
@@ -104,7 +104,7 @@ IObservable<Unit> DeleteArchive(
104104
/// <returns></returns>
105105
IObservable<Unit> UnlockRepository(
106106
string org,
107-
int id,
107+
long id,
108108
string repo);
109109
}
110110
}

Octokit.Reactive/Clients/IObservableOrganizationMembersClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public interface IObservableOrganizationMembersClient
318318
/// details of the organization invitation</param>
319319
/// <returns></returns>
320320
IObservable<OrganizationMembershipInvitation> CreateOrganizationInvitation(string org, OrganizationInvitationRequest invitationRequest);
321-
321+
322322
/// <summary>
323323
/// Remove a user's membership with an organization.
324324
/// </summary>
@@ -389,7 +389,7 @@ public interface IObservableOrganizationMembersClient
389389
/// <param name="org">The login for the organization</param>
390390
/// <param name="invitationId">The unique identifier of the invitation</param>
391391
/// <returns></returns>
392-
IObservable<Unit> CancelOrganizationInvitation(string org, int invitationId);
392+
IObservable<Unit> CancelOrganizationInvitation(string org, long invitationId);
393393

394394
/// <summary>
395395
/// Returns all <see cref="OrganizationMembership" />s for the current user.

Octokit.Reactive/Clients/IObservableProjectCardsClient.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public interface IObservableProjectCardsClient
5959
/// </remarks>
6060
/// <param name="id">The id of the card</param>
6161
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
62-
IObservable<ProjectCard> Get(int id);
62+
IObservable<ProjectCard> Get(long id);
6363

6464
/// <summary>
6565
/// Creates a card.
@@ -79,7 +79,7 @@ public interface IObservableProjectCardsClient
7979
/// </remarks>
8080
/// <param name="id">The id of the card</param>
8181
/// <param name="projectCardUpdate">New values to update the card with</param>
82-
IObservable<ProjectCard> Update(int id, ProjectCardUpdate projectCardUpdate);
82+
IObservable<ProjectCard> Update(long id, ProjectCardUpdate projectCardUpdate);
8383

8484
/// <summary>
8585
/// Deletes a card.
@@ -88,7 +88,7 @@ public interface IObservableProjectCardsClient
8888
/// See the <a href="https://developer.github.com/v3/repos/projects/#delete-a-project-card">API documentation</a> for more information.
8989
/// </remarks>
9090
/// <param name="id">The id of the card</param>
91-
IObservable<bool> Delete(int id);
91+
IObservable<bool> Delete(long id);
9292

9393
/// <summary>
9494
/// Moves a card.
@@ -98,6 +98,6 @@ public interface IObservableProjectCardsClient
9898
/// </remarks>
9999
/// <param name="id">The id of the card</param>
100100
/// <param name="position">The position to move the card</param>
101-
IObservable<bool> Move(int id, ProjectCardMove position);
101+
IObservable<bool> Move(long id, ProjectCardMove position);
102102
}
103103
}

0 commit comments

Comments
 (0)