diff --git a/alchemy/src/planetscale/api/sdk.gen.ts b/alchemy/src/planetscale/api/sdk.gen.ts index 42084ed92..b76869ea0 100644 --- a/alchemy/src/planetscale/api/sdk.gen.ts +++ b/alchemy/src/planetscale/api/sdk.gen.ts @@ -7,6 +7,9 @@ import type { } from "../../util/api/client/index.ts"; import { client } from "./client.gen.ts"; import type { + CancelBouncerResizeRequestData, + CancelBouncerResizeRequestErrors, + CancelBouncerResizeRequestResponses, CancelBranchChangeRequestData, CancelBranchChangeRequestErrors, CancelBranchChangeRequestResponses, @@ -28,11 +31,17 @@ import type { CreateBackupData, CreateBackupErrors, CreateBackupResponses, + CreateBouncerData, + CreateBouncerErrors, + CreateBouncerResponses, CreateBranchData, CreateBranchErrors, CreateBranchResponses, CreateDatabaseData, CreateDatabaseErrors, + CreateDatabasePostgresCidrData, + CreateDatabasePostgresCidrErrors, + CreateDatabasePostgresCidrResponses, CreateDatabaseResponses, CreateDeployRequestData, CreateDeployRequestErrors, @@ -43,6 +52,9 @@ import type { CreateOauthTokenData, CreateOauthTokenErrors, CreateOauthTokenResponses, + CreateOrganizationTeamData, + CreateOrganizationTeamErrors, + CreateOrganizationTeamResponses, CreatePasswordData, CreatePasswordErrors, CreatePasswordResponses, @@ -52,6 +64,9 @@ import type { CreateRoleData, CreateRoleErrors, CreateRoleResponses, + CreateServiceTokenData, + CreateServiceTokenErrors, + CreateServiceTokenResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, @@ -61,11 +76,17 @@ import type { DeleteBackupData, DeleteBackupErrors, DeleteBackupResponses, + DeleteBouncerData, + DeleteBouncerErrors, + DeleteBouncerResponses, DeleteBranchData, DeleteBranchErrors, DeleteBranchResponses, DeleteDatabaseData, DeleteDatabaseErrors, + DeleteDatabasePostgresCidrData, + DeleteDatabasePostgresCidrErrors, + DeleteDatabasePostgresCidrResponses, DeleteDatabaseResponses, DeleteKeyspaceData, DeleteKeyspaceErrors, @@ -73,6 +94,9 @@ import type { DeleteOauthTokenData, DeleteOauthTokenErrors, DeleteOauthTokenResponses, + DeleteOrganizationTeamData, + DeleteOrganizationTeamErrors, + DeleteOrganizationTeamResponses, DeletePasswordData, DeletePasswordErrors, DeletePasswordResponses, @@ -82,6 +106,9 @@ import type { DeleteRoleData, DeleteRoleErrors, DeleteRoleResponses, + DeleteServiceTokenData, + DeleteServiceTokenErrors, + DeleteServiceTokenResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, @@ -97,6 +124,12 @@ import type { GetBackupData, GetBackupErrors, GetBackupResponses, + GetBouncerData, + GetBouncerErrors, + GetBouncerResponses, + GetBranchChangeRequestData, + GetBranchChangeRequestErrors, + GetBranchChangeRequestResponses, GetBranchData, GetBranchErrors, GetBranchResponses, @@ -108,10 +141,16 @@ import type { GetCurrentUserResponses, GetDatabaseData, GetDatabaseErrors, + GetDatabasePostgresCidrData, + GetDatabasePostgresCidrErrors, + GetDatabasePostgresCidrResponses, GetDatabaseResponses, GetDatabaseThrottlerData, GetDatabaseThrottlerErrors, GetDatabaseThrottlerResponses, + GetDefaultRoleData, + GetDefaultRoleErrors, + GetDefaultRoleResponses, GetDeploymentData, GetDeploymentErrors, GetDeploymentResponses, @@ -147,7 +186,13 @@ import type { GetOauthTokenResponses, GetOrganizationData, GetOrganizationErrors, + GetOrganizationMembershipData, + GetOrganizationMembershipErrors, + GetOrganizationMembershipResponses, GetOrganizationResponses, + GetOrganizationTeamData, + GetOrganizationTeamErrors, + GetOrganizationTeamResponses, GetPasswordData, GetPasswordErrors, GetPasswordResponses, @@ -159,6 +204,9 @@ import type { GetRoleData, GetRoleErrors, GetRoleResponses, + GetServiceTokenData, + GetServiceTokenErrors, + GetServiceTokenResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, @@ -174,12 +222,27 @@ import type { ListBackupsData, ListBackupsErrors, ListBackupsResponses, + ListBouncerResizeRequestsData, + ListBouncerResizeRequestsErrors, + ListBouncerResizeRequestsResponses, + ListBouncersData, + ListBouncersErrors, + ListBouncersResponses, + ListBranchBouncerResizeRequestsData, + ListBranchBouncerResizeRequestsErrors, + ListBranchBouncerResizeRequestsResponses, ListBranchChangeRequestsData, ListBranchChangeRequestsErrors, ListBranchChangeRequestsResponses, ListBranchesData, ListBranchesErrors, ListBranchesResponses, + ListClusterSizeSkusData, + ListClusterSizeSkusErrors, + ListClusterSizeSkusResponses, + ListDatabasePostgresCidrsData, + ListDatabasePostgresCidrsErrors, + ListDatabasePostgresCidrsResponses, ListDatabaseRegionsData, ListDatabaseRegionsErrors, ListDatabaseRegionsResponses, @@ -222,6 +285,9 @@ import type { ListOrganizationsData, ListOrganizationsErrors, ListOrganizationsResponses, + ListOrganizationTeamsData, + ListOrganizationTeamsErrors, + ListOrganizationTeamsResponses, ListParametersData, ListParametersErrors, ListParametersResponses, @@ -240,6 +306,9 @@ import type { ListRolesData, ListRolesErrors, ListRolesResponses, + ListServiceTokensData, + ListServiceTokensErrors, + ListServiceTokensResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, @@ -252,12 +321,24 @@ import type { QueueDeployRequestData, QueueDeployRequestErrors, QueueDeployRequestResponses, + ReassignRoleObjectsData, + ReassignRoleObjectsErrors, + ReassignRoleObjectsResponses, + RemoveOrganizationMemberData, + RemoveOrganizationMemberErrors, + RemoveOrganizationMemberResponses, RenewPasswordData, RenewPasswordErrors, RenewPasswordResponses, RenewRoleData, RenewRoleErrors, RenewRoleResponses, + ResetDefaultRoleData, + ResetDefaultRoleErrors, + ResetDefaultRoleResponses, + ResetRoleData, + ResetRoleErrors, + ResetRoleResponses, ReviewDeployRequestData, ReviewDeployRequestErrors, ReviewDeployRequestResponses, @@ -270,15 +351,24 @@ import type { UpdateAutoApplyData, UpdateAutoApplyErrors, UpdateAutoApplyResponses, + UpdateAutoDeleteBranchData, + UpdateAutoDeleteBranchErrors, + UpdateAutoDeleteBranchResponses, UpdateBackupData, UpdateBackupErrors, UpdateBackupResponses, + UpdateBouncerResizeRequestData, + UpdateBouncerResizeRequestErrors, + UpdateBouncerResizeRequestResponses, UpdateBranchChangeRequestData, UpdateBranchChangeRequestErrors, UpdateBranchChangeRequestResponses, UpdateBranchClusterConfigData, UpdateBranchClusterConfigErrors, UpdateBranchClusterConfigResponses, + UpdateDatabasePostgresCidrData, + UpdateDatabasePostgresCidrErrors, + UpdateDatabasePostgresCidrResponses, UpdateDatabaseSettingsData, UpdateDatabaseSettingsErrors, UpdateDatabaseSettingsResponses, @@ -296,7 +386,13 @@ import type { UpdateKeyspaceVschemaResponses, UpdateOrganizationData, UpdateOrganizationErrors, + UpdateOrganizationMembershipData, + UpdateOrganizationMembershipErrors, + UpdateOrganizationMembershipResponses, UpdateOrganizationResponses, + UpdateOrganizationTeamData, + UpdateOrganizationTeamErrors, + UpdateOrganizationTeamResponses, UpdatePasswordData, UpdatePasswordErrors, UpdatePasswordResponses, @@ -412,7 +508,7 @@ export class PlanetScaleClient extends _HeyApiClient { GetOrganizationErrors, ThrowOnError >({ - url: "/organizations/{name}", + url: "/organizations/{organization}", ...options, }); } @@ -437,7 +533,7 @@ export class PlanetScaleClient extends _HeyApiClient { UpdateOrganizationErrors, ThrowOnError >({ - url: "/organizations/{name}", + url: "/organizations/{organization}", ...options, headers: { "Content-Type": "application/json", @@ -465,14 +561,14 @@ export class PlanetScaleClient extends _HeyApiClient { ListAuditLogsErrors, ThrowOnError >({ - url: "/organizations/{name}/audit-log", + url: "/organizations/{organization}/audit-log", ...options, }); } /** - * List regions for an organization - * + * List available cluster sizes + * List available cluster sizes for an organization * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * @@ -486,15 +582,15 @@ export class PlanetScaleClient extends _HeyApiClient { * | User | `read_organizations` | * | Organization | `read_organization` | */ - public listRegionsForOrganization( - options: Options, + public listClusterSizeSkus( + options: Options, ) { return (options.client ?? this._client).get< - ListRegionsForOrganizationResponses, - ListRegionsForOrganizationErrors, + ListClusterSizeSkusResponses, + ListClusterSizeSkusErrors, ThrowOnError >({ - url: "/organizations/{name}/regions", + url: "/organizations/{organization}/cluster-size-skus", ...options, }); } @@ -559,6 +655,97 @@ export class PlanetScaleClient extends _HeyApiClient { }); } + /** + * Delete a database + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `delete_database` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `delete_databases` | + * | Database | `delete_database` | + */ + public deleteDatabase( + options: Options, + ) { + return (options.client ?? this._client).delete< + DeleteDatabaseResponses, + DeleteDatabaseErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}", + ...options, + }); + } + + /** + * Get a database + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_databases` | + * | Database | `read_database` | + */ + public getDatabase( + options: Options, + ) { + return (options.client ?? this._client).get< + GetDatabaseResponses, + GetDatabaseErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}", + ...options, + }); + } + + /** + * Update database settings + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_database` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public updateDatabaseSettings( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateDatabaseSettingsResponses, + UpdateDatabaseSettingsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + /** * List branches * @@ -623,6 +810,66 @@ export class PlanetScaleClient extends _HeyApiClient { }); } + /** + * Delete a branch + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `delete_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `delete_branches`, `delete_production_branches` | + * | Database | `delete_branches`, `delete_production_branches` | + * | Branch | `delete_branch` | + */ + public deleteBranch( + options: Options, + ) { + return (options.client ?? this._client).delete< + DeleteBranchResponses, + DeleteBranchErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}", + ...options, + }); + } + + /** + * Get a branch + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | + */ + public getBranch( + options: Options, + ) { + return (options.client ?? this._client).get< + GetBranchResponses, + GetBranchErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}", + ...options, + }); + } + /** * List backups * @@ -782,7 +1029,7 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Get branch change requests + * Get bouncer resize requests * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: @@ -798,21 +1045,51 @@ export class PlanetScaleClient extends _HeyApiClient { * | Database | `read_branches` | * | Branch | `read_branch` | */ - public listBranchChangeRequests( - options: Options, + public listBranchBouncerResizeRequests( + options: Options, ) { return (options.client ?? this._client).get< - ListBranchChangeRequestsResponses, - ListBranchChangeRequestsErrors, + ListBranchBouncerResizeRequestsResponses, + ListBranchBouncerResizeRequestsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncer-resizes", ...options, }); } /** - * Upsert a change request + * List bouncers + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | + */ + public listBouncers( + options: Options, + ) { + return (options.client ?? this._client).get< + ListBouncersResponses, + ListBouncersErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers", + ...options, + }); + } + + /** + * Create a bouncer * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: @@ -827,15 +1104,15 @@ export class PlanetScaleClient extends _HeyApiClient { * | Organization | `write_databases` | * | Database | `write_database` | */ - public updateBranchChangeRequest( - options: Options, + public createBouncer( + options: Options, ) { - return (options.client ?? this._client).patch< - UpdateBranchChangeRequestResponses, - UpdateBranchChangeRequestErrors, + return (options.client ?? this._client).post< + CreateBouncerResponses, + CreateBouncerErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers", ...options, headers: { "Content-Type": "application/json", @@ -845,119 +1122,380 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * List cluster extensions + * Delete a bouncer * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * `write_database` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `read_branches` | - * | Database | `read_branches` | - * | Branch | `read_branch` | + * | Organization | `write_databases` | + * | Database | `write_database` | */ - public listExtensions( - options: Options, + public deleteBouncer( + options: Options, ) { - return (options.client ?? this._client).get< - ListExtensionsResponses, - ListExtensionsErrors, + return (options.client ?? this._client).delete< + DeleteBouncerResponses, + DeleteBouncerErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/extensions", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}", ...options, }); } /** - * Get keyspaces + * Get a bouncer + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | */ - public listKeyspaces( - options: Options, + public getBouncer( + options: Options, ) { return (options.client ?? this._client).get< - ListKeyspacesResponses, - ListKeyspacesErrors, + GetBouncerResponses, + GetBouncerErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}", ...options, }); } /** - * Create a keyspace + * Cancel a resize request * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_database` + * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | */ - public createKeyspace( - options: Options, + public cancelBouncerResizeRequest( + options: Options, ) { - return (options.client ?? this._client).post< - CreateKeyspaceResponses, - CreateKeyspaceErrors, + return (options.client ?? this._client).delete< + CancelBouncerResizeRequestResponses, + CancelBouncerResizeRequestErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes", ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, }); } /** - * Get the VSchema for the keyspace + * Get bouncer resize requests * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | */ - public getKeyspaceVschema( - options: Options, + public listBouncerResizeRequests( + options: Options, ) { return (options.client ?? this._client).get< - GetKeyspaceVschemaResponses, - GetKeyspaceVschemaErrors, + ListBouncerResizeRequestsResponses, + ListBouncerResizeRequestsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes", ...options, }); } /** - * Update the VSchema for the keyspace + * Upsert a bouncer resize request + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_database` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public updateBouncerResizeRequest( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateBouncerResizeRequestResponses, + UpdateBouncerResizeRequestErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Get branch change requests + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | + */ + public listBranchChangeRequests( + options: Options, + ) { + return (options.client ?? this._client).get< + ListBranchChangeRequestsResponses, + ListBranchChangeRequestsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes", + ...options, + }); + } + + /** + * Upsert a change request + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_database` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public updateBranchChangeRequest( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateBranchChangeRequestResponses, + UpdateBranchChangeRequestErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Get a branch change request + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | + */ + public getBranchChangeRequest( + options: Options, + ) { + return (options.client ?? this._client).get< + GetBranchChangeRequestResponses, + GetBranchChangeRequestErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes/{id}", + ...options, + }); + } + + /** + * Change a branch cluster configuration * * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `write_production_branch_vschema`, `write_branch_vschema` + * `write_database` * * */ - public updateKeyspaceVschema( - options: Options, + public updateBranchClusterConfig( + options: Options, ) { return (options.client ?? this._client).patch< - UpdateKeyspaceVschemaResponses, - UpdateKeyspaceVschemaErrors, + UpdateBranchClusterConfigResponses, + UpdateBranchClusterConfigErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/cluster", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Demote a branch + * Demotes a branch from production to development + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `connect_production_branch`, `demote_branches` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `demote_branches` | + * | Database | `demote_branches` | + */ + public demoteBranch( + options: Options, + ) { + return (options.client ?? this._client).post< + DemoteBranchResponses, + DemoteBranchErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/demote", + ...options, + }); + } + + /** + * List cluster extensions + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_branches` | + * | Database | `read_branches` | + * | Branch | `read_branch` | + */ + public listExtensions( + options: Options, + ) { + return (options.client ?? this._client).get< + ListExtensionsResponses, + ListExtensionsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/extensions", + ...options, + }); + } + + /** + * Get keyspaces + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch` + * + * + */ + public listKeyspaces( + options: Options, + ) { + return (options.client ?? this._client).get< + ListKeyspacesResponses, + ListKeyspacesErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces", + ...options, + }); + } + + /** + * Create a keyspace + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `create_branch` + * + * + */ + public createKeyspace( + options: Options, + ) { + return (options.client ?? this._client).post< + CreateKeyspaceResponses, + CreateKeyspaceErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces", ...options, headers: { "Content-Type": "application/json", @@ -969,6 +1507,12 @@ export class PlanetScaleClient extends _HeyApiClient { /** * Delete a keyspace * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `delete_branch`, `delete_production_branch` + * * */ public deleteKeyspace( @@ -979,7 +1523,7 @@ export class PlanetScaleClient extends _HeyApiClient { DeleteKeyspaceErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } @@ -987,6 +1531,12 @@ export class PlanetScaleClient extends _HeyApiClient { /** * Get a keyspace * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch` + * * */ public getKeyspace( @@ -997,7 +1547,7 @@ export class PlanetScaleClient extends _HeyApiClient { GetKeyspaceErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } @@ -1005,6 +1555,12 @@ export class PlanetScaleClient extends _HeyApiClient { /** * Configure keyspace settings * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `create_branch` + * * */ public updateKeyspace( @@ -1015,7 +1571,7 @@ export class PlanetScaleClient extends _HeyApiClient { UpdateKeyspaceErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } @@ -1023,6 +1579,12 @@ export class PlanetScaleClient extends _HeyApiClient { /** * Get keyspace rollout status * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch` + * * */ public getKeyspaceRolloutStatus( @@ -1033,13 +1595,66 @@ export class PlanetScaleClient extends _HeyApiClient { GetKeyspaceRolloutStatusErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}/rollout-status", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/rollout-status", ...options, }); } + /** + * Get the VSchema for the keyspace + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * + * + */ + public getKeyspaceVschema( + options: Options, + ) { + return (options.client ?? this._client).get< + GetKeyspaceVschemaResponses, + GetKeyspaceVschemaErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema", + ...options, + }); + } + + /** + * Update the VSchema for the keyspace + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_production_branch_vschema`, `write_branch_vschema` + * + * + */ + public updateKeyspaceVschema( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateKeyspaceVschemaResponses, + UpdateKeyspaceVschemaErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + /** * List cluster parameters + * Returns the parameters for a branch. To update the parameters, use the "Upsert a change request" endpoint. * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: @@ -1256,6 +1871,35 @@ export class PlanetScaleClient extends _HeyApiClient { }); } + /** + * Promote a branch + * Promotes a branch from development to production + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `connect_production_branch`, `promote_branches` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `promote_branches` | + * | Database | `promote_branches` | + */ + public promoteBranch( + options: Options, + ) { + return (options.client ?? this._client).post< + PromoteBranchResponses, + PromoteBranchErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/branches/{branch}/promote", + ...options, + }); + } + /** * List generated query patterns reports * @@ -1500,13 +2144,13 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Delete role credentials + * Get the default postgres role * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `delete_production_branch_password`, `delete_branch_password` + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` * * **OAuth Scopes** * @@ -1516,31 +2160,27 @@ export class PlanetScaleClient extends _HeyApiClient { * | Database | `manage_passwords`, `manage_production_branch_passwords` | * | Branch | `manage_passwords` | */ - public deleteRole( - options: Options, + public getDefaultRole( + options: Options, ) { - return (options.client ?? this._client).delete< - DeleteRoleResponses, - DeleteRoleErrors, + return (options.client ?? this._client).get< + GetDefaultRoleResponses, + GetDefaultRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/default", ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, }); } /** - * Get a role + * Reset default credentials * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * `delete_production_branch_password`, `delete_branch_password` * * **OAuth Scopes** * @@ -1550,27 +2190,27 @@ export class PlanetScaleClient extends _HeyApiClient { * | Database | `manage_passwords`, `manage_production_branch_passwords` | * | Branch | `manage_passwords` | */ - public getRole( - options: Options, + public resetDefaultRole( + options: Options, ) { - return (options.client ?? this._client).get< - GetRoleResponses, - GetRoleErrors, + return (options.client ?? this._client).post< + ResetDefaultRoleResponses, + ResetDefaultRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/reset-default", ...options, }); } /** - * Update role name + * Delete role credentials * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `create_production_branch_password`, `create_branch_password` + * `delete_production_branch_password`, `delete_branch_password` * * **OAuth Scopes** * @@ -1580,12 +2220,12 @@ export class PlanetScaleClient extends _HeyApiClient { * | Database | `manage_passwords`, `manage_production_branch_passwords` | * | Branch | `manage_passwords` | */ - public updateRole( - options: Options, + public deleteRole( + options: Options, ) { - return (options.client ?? this._client).patch< - UpdateRoleResponses, - UpdateRoleErrors, + return (options.client ?? this._client).delete< + DeleteRoleResponses, + DeleteRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", @@ -1598,13 +2238,13 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Renew role expiration + * Get a role * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `create_production_branch_password`, `create_branch_password` + * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` * * **OAuth Scopes** * @@ -1614,99 +2254,79 @@ export class PlanetScaleClient extends _HeyApiClient { * | Database | `manage_passwords`, `manage_production_branch_passwords` | * | Branch | `manage_passwords` | */ - public renewRole( - options: Options, - ) { - return (options.client ?? this._client).post< - RenewRoleResponses, - RenewRoleErrors, - ThrowOnError - >({ - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/renew", - ...options, - }); - } - - /** - * Delete a branch - * - * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: - * - * **Service Token Accesses** - * `delete_branch` - * - * **OAuth Scopes** - * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `delete_branches`, `delete_production_branches` | - * | Database | `delete_branches`, `delete_production_branches` | - * | Branch | `delete_branch` | - */ - public deleteBranch( - options: Options, + public getRole( + options: Options, ) { - return (options.client ?? this._client).delete< - DeleteBranchResponses, - DeleteBranchErrors, + return (options.client ?? this._client).get< + GetRoleResponses, + GetRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", ...options, }); } /** - * Get a branch + * Update role name * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch` + * `create_production_branch_password`, `create_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `read_branches` | - * | Database | `read_branches` | - * | Branch | `read_branch` | + * | Organization | `manage_passwords`, `manage_production_branch_passwords` | + * | Database | `manage_passwords`, `manage_production_branch_passwords` | + * | Branch | `manage_passwords` | */ - public getBranch( - options: Options, - ) { - return (options.client ?? this._client).get< - GetBranchResponses, - GetBranchErrors, + public updateRole( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateRoleResponses, + UpdateRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, }); } /** - * Change a branch cluster configuration + * Reassign objects owned by one role to another role * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `write_database` + * `delete_production_branch_password`, `delete_branch_password` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `manage_passwords`, `manage_production_branch_passwords` | + * | Database | `manage_passwords`, `manage_production_branch_passwords` | + * | Branch | `manage_passwords` | */ - public updateBranchClusterConfig( - options: Options, + public reassignRoleObjects( + options: Options, ) { - return (options.client ?? this._client).patch< - UpdateBranchClusterConfigResponses, - UpdateBranchClusterConfigErrors, + return (options.client ?? this._client).post< + ReassignRoleObjectsResponses, + ReassignRoleObjectsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/cluster", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reassign", ...options, headers: { "Content-Type": "application/json", @@ -1716,59 +2336,61 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Demote a branch - * Demotes a branch from production to development + * Renew role expiration + * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `connect_production_branch`, `demote_branches` + * `create_production_branch_password`, `create_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `demote_branches` | - * | Database | `demote_branches` | + * | Organization | `manage_passwords`, `manage_production_branch_passwords` | + * | Database | `manage_passwords`, `manage_production_branch_passwords` | + * | Branch | `manage_passwords` | */ - public demoteBranch( - options: Options, + public renewRole( + options: Options, ) { return (options.client ?? this._client).post< - DemoteBranchResponses, - DemoteBranchErrors, + RenewRoleResponses, + RenewRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/demote", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/renew", ...options, }); } /** - * Promote a branch - * Promotes a branch from development to production + * Reset a role's password + * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `connect_production_branch`, `promote_branches` + * `delete_production_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `promote_branches` | - * | Database | `promote_branches` | + * | Organization | `manage_passwords`, `manage_production_branch_passwords` | + * | Database | `manage_passwords`, `manage_production_branch_passwords` | + * | Branch | `manage_passwords` | */ - public promoteBranch( - options: Options, + public resetRole( + options: Options, ) { return (options.client ?? this._client).post< - PromoteBranchResponses, - PromoteBranchErrors, + ResetRoleResponses, + ResetRoleErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/promote", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reset", ...options, }); } @@ -1786,7 +2408,7 @@ export class PlanetScaleClient extends _HeyApiClient { DisableSafeMigrationsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/safe-migrations", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations", ...options, }); } @@ -1804,7 +2426,7 @@ export class PlanetScaleClient extends _HeyApiClient { EnableSafeMigrationsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/safe-migrations", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations", ...options, }); } @@ -1834,7 +2456,7 @@ export class PlanetScaleClient extends _HeyApiClient { GetBranchSchemaErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/schema", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/schema", ...options, }); } @@ -1864,8 +2486,146 @@ export class PlanetScaleClient extends _HeyApiClient { LintBranchSchemaErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/branches/{name}/schema/lint", + url: "/organizations/{organization}/databases/{database}/branches/{branch}/schema/lint", + ...options, + }); + } + + /** + * List IP restriction entries + * + * ### Authorization + * A OAuth token must have at least one of the following scopes in order to use this API endpoint: + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_databases` | + * | Database | `read_database` | + */ + public listDatabasePostgresCidrs( + options: Options, + ) { + return (options.client ?? this._client).get< + ListDatabasePostgresCidrsResponses, + ListDatabasePostgresCidrsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/cidrs", + ...options, + }); + } + + /** + * Create an IP restriction entry + * + * ### Authorization + * A OAuth token must have at least one of the following scopes in order to use this API endpoint: + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public createDatabasePostgresCidr( + options: Options, + ) { + return (options.client ?? this._client).post< + CreateDatabasePostgresCidrResponses, + CreateDatabasePostgresCidrErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/cidrs", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Delete an IP restriction entry + * + * ### Authorization + * A OAuth token must have at least one of the following scopes in order to use this API endpoint: + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public deleteDatabasePostgresCidr( + options: Options, + ) { + return (options.client ?? this._client).delete< + DeleteDatabasePostgresCidrResponses, + DeleteDatabasePostgresCidrErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/cidrs/{id}", + ...options, + }); + } + + /** + * Get an IP restriction entry + * + * ### Authorization + * A OAuth token must have at least one of the following scopes in order to use this API endpoint: + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_databases` | + * | Database | `read_database` | + */ + public getDatabasePostgresCidr( + options: Options, + ) { + return (options.client ?? this._client).get< + GetDatabasePostgresCidrResponses, + GetDatabasePostgresCidrErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/cidrs/{id}", + ...options, + }); + } + + /** + * Update an IP restriction entry + * + * ### Authorization + * A OAuth token must have at least one of the following scopes in order to use this API endpoint: + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_databases` | + * | Database | `write_database` | + */ + public updateDatabasePostgresCidr( + options: Options, + ) { + return (options.client ?? this._client).put< + UpdateDatabasePostgresCidrResponses, + UpdateDatabasePostgresCidrErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/cidrs/{id}", ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, }); } @@ -2073,6 +2833,39 @@ export class PlanetScaleClient extends _HeyApiClient { }); } + /** + * Update auto-delete branch for deploy request + * Enables or disabled the auto-delete branch setting for a deploy request + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_deploy_request`, `create_deploy_request` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `deploy_deploy_requests` | + * | Database | `deploy_deploy_requests` | + */ + public updateAutoDeleteBranch( + options: Options, + ) { + return (options.client ?? this._client).put< + UpdateAutoDeleteBranchResponses, + UpdateAutoDeleteBranchErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-delete-branch", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + /** * Cancel a queued deploy request * @@ -2343,64 +3136,122 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Get deploy request throttler configurations - * + * Get deploy request throttler configurations + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_deploy_request` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_deploy_requests` | + * | Database | `read_deploy_requests` | + */ + public getDeployRequestThrottler( + options: Options, + ) { + return (options.client ?? this._client).get< + GetDeployRequestThrottlerResponses, + GetDeployRequestThrottlerErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler", + ...options, + }); + } + + /** + * Update deploy request throttler configurations + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_deploy_request`, `create_deploy_request` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `deploy_deploy_requests` | + * | Database | `deploy_deploy_requests` | + */ + public updateDeployRequestThrottler( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateDeployRequestThrottlerResponses, + UpdateDeployRequestThrottlerErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * List read-only regions + * List read-only regions for the database's default branch * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_deploy_request` + * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `read_deploy_requests` | - * | Database | `read_deploy_requests` | + * | Organization | `read_branches` | + * | Database | `read_branches` | */ - public getDeployRequestThrottler( - options: Options, + public listReadOnlyRegions( + options: Options, ) { return (options.client ?? this._client).get< - GetDeployRequestThrottlerResponses, - GetDeployRequestThrottlerErrors, + ListReadOnlyRegionsResponses, + ListReadOnlyRegionsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler", + url: "/organizations/{organization}/databases/{database}/read-only-regions", ...options, }); } /** - * Update deploy request throttler configurations + * List database regions * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_deploy_request`, `create_deploy_request` + * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `deploy_deploy_requests` | - * | Database | `deploy_deploy_requests` | + * | Organization | `read_databases` | + * | Database | `read_database` | */ - public updateDeployRequestThrottler( - options: Options, + public listDatabaseRegions( + options: Options, ) { - return (options.client ?? this._client).patch< - UpdateDeployRequestThrottlerResponses, - UpdateDeployRequestThrottlerErrors, + return (options.client ?? this._client).get< + ListDatabaseRegionsResponses, + ListDatabaseRegionsErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler", + url: "/organizations/{organization}/databases/{database}/regions", ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, }); } @@ -2869,402 +3720,626 @@ export class PlanetScaleClient extends _HeyApiClient { } /** - * Delete a database + * Get invoices + * Get the invoices for an organization + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_invoices` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_invoices` | + */ + public listInvoices( + options: Options, + ) { + return (options.client ?? this._client).get< + ListInvoicesResponses, + ListInvoicesErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/invoices", + ...options, + }); + } + + /** + * Get an invoice * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `delete_database` + * `read_invoices` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `delete_databases` | - * | Database | `delete_database` | + * | Organization | `read_invoices` | */ - public deleteDatabase( - options: Options, + public getInvoice( + options: Options, + ) { + return (options.client ?? this._client).get< + GetInvoiceResponses, + GetInvoiceErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/invoices/{id}", + ...options, + }); + } + + /** + * Get invoice line items + * Get the line items for an invoice + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_invoices` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_invoices` | + */ + public getInvoiceLineItems( + options: Options, + ) { + return (options.client ?? this._client).get< + GetInvoiceLineItemsResponses, + GetInvoiceLineItemsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/invoices/{id}/line-items", + ...options, + }); + } + + /** + * List organization members + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_organization` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_organization` | + */ + public listOrganizationMembers( + options: Options, + ) { + return (options.client ?? this._client).get< + ListOrganizationMembersResponses, + ListOrganizationMembersErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/members", + ...options, + }); + } + + /** + * Remove a member from an organization + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_organization` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_organization` | + */ + public removeOrganizationMember( + options: Options, + ) { + return (options.client ?? this._client).delete< + RemoveOrganizationMemberResponses, + RemoveOrganizationMemberErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/members/{id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Get an organization member + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_organization` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_organization` | + */ + public getOrganizationMembership( + options: Options, + ) { + return (options.client ?? this._client).get< + GetOrganizationMembershipResponses, + GetOrganizationMembershipErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/members/{id}", + ...options, + }); + } + + /** + * Update organization member role + * + * ### Authorization + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * + * **Service Token Accesses** + * `write_organization` + * + * **OAuth Scopes** + * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_organization` | + */ + public updateOrganizationMembership( + options: Options, + ) { + return (options.client ?? this._client).patch< + UpdateOrganizationMembershipResponses, + UpdateOrganizationMembershipErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/members/{id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * List OAuth applications + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_oauth_applications` + * + * + */ + public listOauthApplications( + options: Options, + ) { + return (options.client ?? this._client).get< + ListOauthApplicationsResponses, + ListOauthApplicationsErrors, + ThrowOnError + >({ + url: "/organizations/{organization}/oauth-applications", + ...options, + }); + } + + /** + * Get an OAuth application + * + * ### Authorization + * A service token must have at least one of the following access in order to use this API endpoint: + * + * **Service Token Accesses** + * `read_oauth_applications` + * + * + */ + public getOauthApplication( + options: Options, ) { - return (options.client ?? this._client).delete< - DeleteDatabaseResponses, - DeleteDatabaseErrors, + return (options.client ?? this._client).get< + GetOauthApplicationResponses, + GetOauthApplicationErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{name}", + url: "/organizations/{organization}/oauth-applications/{application_id}", ...options, }); } /** - * Get a database - * + * List OAuth tokens + * List OAuth tokens created by an OAuth application * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` + * `read_oauth_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `read_databases` | - * | Database | `read_database` | */ - public getDatabase( - options: Options, + public listOauthTokens( + options: Options, ) { return (options.client ?? this._client).get< - GetDatabaseResponses, - GetDatabaseErrors, + ListOauthTokensResponses, + ListOauthTokensErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{name}", + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens", ...options, }); } /** - * Update database settings + * Delete an OAuth token * * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `write_database` + * `delete_oauth_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `write_databases` | - * | Database | `write_database` | */ - public updateDatabaseSettings( - options: Options, + public deleteOauthToken( + options: Options, ) { - return (options.client ?? this._client).patch< - UpdateDatabaseSettingsResponses, - UpdateDatabaseSettingsErrors, + return (options.client ?? this._client).delete< + DeleteOauthTokenResponses, + DeleteOauthTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{name}", + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, }); } /** - * List read-only regions - * List read-only regions for the database's default branch + * Get an OAuth token + * * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` + * `read_oauth_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `read_branches` | - * | Database | `read_branches` | */ - public listReadOnlyRegions( - options: Options, + public getOauthToken( + options: Options, ) { return (options.client ?? this._client).get< - ListReadOnlyRegionsResponses, - ListReadOnlyRegionsErrors, + GetOauthTokenResponses, + GetOauthTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{name}/read-only-regions", + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", ...options, }); } /** - * List database regions - * + * Create or renew an OAuth token + * Create an OAuth token from an authorization grant code, or refresh an OAuth token from a refresh token * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `delete_branch_password`, `delete_production_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `read_schema_recommendations`, `close_schema_recommendations`, `read_comment`, `create_comment`, `restore_backup`, `restore_production_branch_backup`, `read_backups`, `write_backups`, `delete_backups`, `delete_production_branch_backups`, `write_branch_vschema`, `write_production_branch_vschema` + * `write_oauth_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `read_databases` | - * | Database | `read_database` | */ - public listDatabaseRegions( - options: Options, + public createOauthToken( + options: Options, ) { - return (options.client ?? this._client).get< - ListDatabaseRegionsResponses, - ListDatabaseRegionsErrors, + return (options.client ?? this._client).post< + CreateOauthTokenResponses, + CreateOauthTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/databases/{name}/regions", + url: "/organizations/{organization}/oauth-applications/{id}/token", ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, }); } /** - * Get invoices - * Get the invoices for an organization + * List regions for an organization + * * ### Authorization * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_invoices` + * `read_organization` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | - * | Organization | `read_invoices` | + * | User | `read_organizations` | + * | Organization | `read_organization` | */ - public listInvoices( - options: Options, + public listRegionsForOrganization( + options: Options, ) { return (options.client ?? this._client).get< - ListInvoicesResponses, - ListInvoicesErrors, + ListRegionsForOrganizationResponses, + ListRegionsForOrganizationErrors, ThrowOnError >({ - url: "/organizations/{organization}/invoices", + url: "/organizations/{organization}/regions", ...options, }); } /** - * Get an invoice - * + * List service tokens + * List service tokens for an organization. * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_invoices` + * `read_service_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `read_invoices` | */ - public getInvoice( - options: Options, + public listServiceTokens( + options: Options, ) { return (options.client ?? this._client).get< - GetInvoiceResponses, - GetInvoiceErrors, + ListServiceTokensResponses, + ListServiceTokensErrors, ThrowOnError >({ - url: "/organizations/{organization}/invoices/{id}", + url: "/organizations/{organization}/service-tokens", ...options, }); } /** - * Get invoice line items - * Get the line items for an invoice + * Create a service token + * Create a new service token for the organization. * ### Authorization - * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: + * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_invoices` + * `write_service_tokens` * - * **OAuth Scopes** * - * | Resource | Scopes | - * | :------- | :---------- | - * | Organization | `read_invoices` | */ - public getInvoiceLineItems( - options: Options, + public createServiceToken( + options: Options, ) { - return (options.client ?? this._client).get< - GetInvoiceLineItemsResponses, - GetInvoiceLineItemsErrors, + return (options.client ?? this._client).post< + CreateServiceTokenResponses, + CreateServiceTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/invoices/{id}/line-items", + url: "/organizations/{organization}/service-tokens", ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, }); } /** - * List organization members - * + * Delete a service token + * Delete a service token from the organization. * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_organization` + * `delete_service_tokens` * * */ - public listOrganizationMembers( - options: Options, + public deleteServiceToken( + options: Options, ) { - return (options.client ?? this._client).get< - ListOrganizationMembersResponses, - ListOrganizationMembersErrors, + return (options.client ?? this._client).delete< + DeleteServiceTokenResponses, + DeleteServiceTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/members", + url: "/organizations/{organization}/service-tokens/{id}", ...options, }); } /** - * List OAuth applications - * + * Get a service token + * Get information about a service token. * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** - * `read_oauth_applications` + * `read_service_tokens` * * */ - public listOauthApplications( - options: Options, + public getServiceToken( + options: Options, ) { return (options.client ?? this._client).get< - ListOauthApplicationsResponses, - ListOauthApplicationsErrors, + GetServiceTokenResponses, + GetServiceTokenErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications", + url: "/organizations/{organization}/service-tokens/{id}", ...options, }); } /** - * Get an OAuth application + * List teams in an organization * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_oauth_applications` + * `read_organization` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_organization` | */ - public getOauthApplication( - options: Options, + public listOrganizationTeams( + options: Options, ) { return (options.client ?? this._client).get< - GetOauthApplicationResponses, - GetOauthApplicationErrors, + ListOrganizationTeamsResponses, + ListOrganizationTeamsErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications/{application_id}", + url: "/organizations/{organization}/teams", ...options, }); } /** - * List OAuth tokens - * List OAuth tokens created by an OAuth application + * Create an organization team + * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_oauth_tokens` + * `write_teams` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_organization` | */ - public listOauthTokens( - options: Options, + public createOrganizationTeam( + options: Options, ) { - return (options.client ?? this._client).get< - ListOauthTokensResponses, - ListOauthTokensErrors, + return (options.client ?? this._client).post< + CreateOrganizationTeamResponses, + CreateOrganizationTeamErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens", + url: "/organizations/{organization}/teams", ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, }); } /** - * Delete an OAuth token + * Delete an organization team * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `delete_oauth_tokens` + * `write_teams` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_organization` | */ - public deleteOauthToken( - options: Options, + public deleteOrganizationTeam( + options: Options, ) { return (options.client ?? this._client).delete< - DeleteOauthTokenResponses, - DeleteOauthTokenErrors, + DeleteOrganizationTeamResponses, + DeleteOrganizationTeamErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", + url: "/organizations/{organization}/teams/{team}", ...options, }); } /** - * Get an OAuth token + * Get an organization team * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `read_oauth_tokens` + * `read_organization` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `read_organization` | */ - public getOauthToken( - options: Options, + public getOrganizationTeam( + options: Options, ) { return (options.client ?? this._client).get< - GetOauthTokenResponses, - GetOauthTokenErrors, + GetOrganizationTeamResponses, + GetOrganizationTeamErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", + url: "/organizations/{organization}/teams/{team}", ...options, }); } /** - * Create or renew an OAuth token - * Create an OAuth token from an authorization grant code, or refresh an OAuth token from a refresh token + * Update an organization team + * * ### Authorization - * A service token must have at least one of the following access in order to use this API endpoint: + * A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint: * * **Service Token Accesses** - * `write_oauth_tokens` + * `write_teams` * + * **OAuth Scopes** * + * | Resource | Scopes | + * | :------- | :---------- | + * | Organization | `write_organization` | */ - public createOauthToken( - options: Options, + public updateOrganizationTeam( + options: Options, ) { - return (options.client ?? this._client).post< - CreateOauthTokenResponses, - CreateOauthTokenErrors, + return (options.client ?? this._client).patch< + UpdateOrganizationTeamResponses, + UpdateOrganizationTeamErrors, ThrowOnError >({ - url: "/organizations/{organization}/oauth-applications/{id}/token", + url: "/organizations/{organization}/teams/{team}", ...options, headers: { "Content-Type": "application/json", diff --git a/alchemy/src/planetscale/api/types.gen.ts b/alchemy/src/planetscale/api/types.gen.ts index 38dafb0fe..74fda1759 100644 --- a/alchemy/src/planetscale/api/types.gen.ts +++ b/alchemy/src/planetscale/api/types.gen.ts @@ -158,13 +158,13 @@ export type PaginatedBackup = { */ schedule_time: string; /** - * Day of the week that the backup is scheduled + * Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday */ - schedule_day: 0 | 1 | 2 | 3 | 4 | 5 | 6; + schedule_day: number; /** - * Week of the month that the backup is scheduled + * Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week */ - schedule_week: 0 | 1 | 2 | 3; + schedule_week: number; /** * When the backup policy was created */ @@ -364,13 +364,13 @@ export type Backup = { */ schedule_time: string; /** - * Day of the week that the backup is scheduled + * Day of the week that the backup is scheduled. 0 is Sunday, 6 is Saturday */ - schedule_day: 0 | 1 | 2 | 3 | 4 | 5 | 6; + schedule_day: number; /** - * Week of the month that the backup is scheduled + * Week of the month that the backup is scheduled. 0 is the first week, 3 is the fourth week */ - schedule_week: 0 | 1 | 2 | 3; + schedule_week: number; /** * When the backup policy was created */ @@ -442,6 +442,155 @@ export type Backup = { }; }; +export type PaginatedPostgresBouncerResizeRequest = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the bouncer resize + */ + id: string; + /** + * The state of the bouncer resize + */ + state: "pending" | "resizing" | "canceled" | "completed"; + /** + * The number of replicas per cell for the bouncer after the resize + */ + replicas_per_cell: number; + /** + * The bouncer parameters + */ + parameters: { + [key: string]: unknown; + }; + /** + * The number of replicas per cell for the bouncer before the resize + */ + previous_replicas_per_cell: number; + /** + * The previous bouncer parameters + */ + previous_parameters: { + [key: string]: unknown; + }; + /** + * The time the bouncer resize started + */ + started_at: string; + /** + * The time the bouncer resize completed + */ + completed_at: string; + /** + * The time the bouncer resize was created + */ + created_at: string; + /** + * The time the bouncer resize was last updated + */ + updated_at: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + bouncer: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + sku: { + /** + * The name of the Postgres bouncer SKU + */ + name: string; + /** + * The display name + */ + display_name: string; + /** + * The CPU allocation + */ + cpu: string; + /** + * The amount of memory in bytes + */ + ram: number; + /** + * The sort order of the Postgres bouncer SKU + */ + sort_order: number; + }; + previous_sku: { + /** + * The name of the Postgres bouncer SKU + */ + name: string; + /** + * The display name + */ + display_name: string; + /** + * The CPU allocation + */ + cpu: string; + /** + * The amount of memory in bytes + */ + ram: number; + /** + * The sort order of the Postgres bouncer SKU + */ + sort_order: number; + }; + }>; +}; + export type PaginatedPostgresClusterResizeRequest = { /** * The current page number @@ -820,6 +969,10 @@ export type PaginatedDatabaseBranch = { * The current state of the branch */ state: "pending" | "sleep_in_progress" | "sleeping" | "awakening" | "ready"; + /** + * True if the branch allows passwords to connect directly to a vtgate, bypassing load balancers + */ + direct_vtgate: boolean; /** * The size of the vtgate cluster for the branch */ @@ -1010,6 +1163,10 @@ export type DatabaseBranch = { * The current state of the branch */ state: "pending" | "sleep_in_progress" | "sleeping" | "awakening" | "ready"; + /** + * True if the branch allows passwords to connect directly to a vtgate, bypassing load balancers + */ + direct_vtgate: boolean; /** * The size of the vtgate cluster for the branch */ @@ -1309,12 +1466,12 @@ export type PostgresClusterExtension = { * The type of the parameter */ parameter_type: + | "array" | "boolean" | "bytes" | "float" | "integer" | "internal" - | "milliseconds" | "seconds" | "select" | "string" @@ -1417,12 +1574,12 @@ export type PostgresClusterParameter = { * The type of the parameter */ parameter_type: + | "array" | "boolean" | "bytes" | "float" | "integer" | "internal" - | "milliseconds" | "seconds" | "select" | "string" @@ -1749,6 +1906,14 @@ export type PaginatedDatabaseBranchPassword = { * True if the credentials are expired */ expired: boolean; + /** + * True if the credentials connect directly to a vtgate, bypassing load balancers + */ + direct_vtgate: boolean; + /** + * The list of hosts in each availability zone providing direct access to a vtgate + */ + direct_vtgate_addresses: Array; /** * Time to live (in seconds) for the password. The password will be invalid when TTL has passed */ @@ -1891,6 +2056,14 @@ export type DatabaseBranchPassword = { * True if the credentials are expired */ expired: boolean; + /** + * True if the credentials connect directly to a vtgate, bypassing load balancers + */ + direct_vtgate: boolean; + /** + * The list of hosts in each availability zone providing direct access to a vtgate + */ + direct_vtgate_addresses: Array; /** * Time to live (in seconds) for the password. The password will be invalid when TTL has passed */ @@ -1995,6 +2168,118 @@ export type DatabaseBranchPassword = { }; }; +export type PaginatedPostgresClusterCidr = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the IP allowlist entry + */ + id: string; + /** + * The schema name to restrict access to (optional) + */ + schema: string; + /** + * The role to restrict access to (optional) + */ + role: string; + /** + * List of CIDR ranges + */ + cidrs: Array; + /** + * When the entry was created + */ + created_at: string; + /** + * When the entry was updated + */ + updated_at: string; + /** + * When the entry was deleted + */ + deleted_at: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + }>; +}; + +export type PostgresClusterCidr = { + /** + * The ID of the IP allowlist entry + */ + id: string; + /** + * The schema name to restrict access to (optional) + */ + schema: string; + /** + * The role to restrict access to (optional) + */ + role: string; + /** + * List of CIDR ranges + */ + cidrs: Array; + /** + * When the entry was created + */ + created_at: string; + /** + * When the entry was updated + */ + updated_at: string; + /** + * When the entry was deleted + */ + deleted_at: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; +}; + export type PaginatedDatabase = { /** * The current page number @@ -2801,11 +3086,11 @@ export type PaginatedServiceToken = { */ display_name: string; /** - * The plain text token. Available only after create. + * The plaintext token. Available only after create. */ token: string; /** - * The plain text refresh token. Available only after create. + * The plaintext refresh token. Available only after create. */ plain_text_refresh_token: string; /** @@ -3019,11 +3304,11 @@ export type ServiceToken = { */ display_name: string; /** - * The plain text token. Available only after create. + * The plaintext token. Available only after create. */ token: string; /** - * The plain text refresh token. Available only after create. + * The plaintext refresh token. Available only after create. */ plain_text_refresh_token: string; /** @@ -3335,53 +3620,144 @@ export type PaginatedOrganizationMembership = { }>; }; -export type PaginatedOrganization = { - /** - * The current page number - */ - current_page: number; - /** - * The next page number - */ - next_page: number; - /** - * The next page of results - */ - next_page_url: string; - /** - * The previous page number - */ - prev_page: number; +export type OrganizationMembership = { /** - * The previous page of results + * The ID of the membership */ - prev_page_url: string; - data: Array<{ + id: string; + user: { /** - * The ID for the organization + * The ID of the user */ id: string; /** - * The name of the organization + * The display name of the user + */ + display_name: string; + /** + * The name of the user */ name: string; /** - * The billing email of the organization + * The email of the user */ - billing_email: string; + email: string; /** - * When the organization was created + * The URL source of the user's avatar + */ + avatar_url: string; + /** + * When the user was created */ created_at: string; /** - * When the organization was last updated + * When the user was last updated */ updated_at: string; /** - * The billing plan of the organization + * Whether or not the user has configured two factor authentication */ - plan: string; - /** + two_factor_auth_configured: boolean; + default_organization: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + /** + * Whether or not the user is managed by SSO + */ + sso: boolean; + /** + * Whether or not the user is managed by an authentication provider + */ + managed: boolean; + /** + * Whether or not the user is managed by a SSO directory + */ + directory_managed: boolean; + /** + * Whether or not the user is verified by email + */ + email_verified: boolean; + }; + /** + * The role of the user in the organization + */ + role: "member" | "admin"; + /** + * When the membership was created + */ + created_at: string; + /** + * When the membership was last updated + */ + updated_at: string; +}; + +export type PaginatedOrganization = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID for the organization + */ + id: string; + /** + * The name of the organization + */ + name: string; + /** + * The billing email of the organization + */ + billing_email: string; + /** + * When the organization was created + */ + created_at: string; + /** + * When the organization was last updated + */ + updated_at: string; + /** + * The billing plan of the organization + */ + plan: string; + /** * Whether or not the organization's billing information is valid */ valid_billing_info: boolean; @@ -3527,6 +3903,73 @@ export type Organization = { payment_info_required: boolean; }; +export type ClusterSizeSkuSerializer = { + /** + * The name of the cluster SKU + */ + name: string; + /** + * The display name + */ + display_name: string; + /** + * The number of CPUs + */ + cpu: string; + /** + * The amount of storage in bytes + */ + storage: number; + /** + * The amount of memory in bytes + */ + ram: number; + /** + * Whether or not the cluster SKU is Metal + */ + metal: boolean; + /** + * Whether or not the cluster SKU is enabled for the organization + */ + enabled: boolean; + /** + * The provider of the cluster SKU (nil, AWS or GCP) + */ + provider: string; + /** + * The default vtgate size for the cluster SKU + */ + default_vtgate: string; + /** + * The default vtgate rate for the cluster SKU + */ + default_vtgate_rate: number; + /** + * The replica rate for the cluster SKU + */ + replica_rate?: number; + /** + * The rate for the cluster SKU + */ + rate?: number; + /** + * The sort order of the cluster SKU + */ + sort_order: number; + /** + * The architecture of the cluster SKU (null, x86_64 or arm64) + */ + architecture: string; + /** + * Whether or not the cluster SKU is a development SKU + */ + development: boolean; + /** + * Whether or not the cluster SKU is a production SKU + */ + production: boolean; +}; + export type PaginatedAuditLogEvent = { /** * Whether there is a next page of results @@ -3618,138 +4061,208 @@ export type PaginatedAuditLogEvent = { }>; }; -export type PaginatedPostgresRole = { +export type PostgresBouncerResizeRequest = { /** - * The current page number + * The ID of the bouncer resize */ - current_page: number; + id: string; /** - * The next page number + * The state of the bouncer resize */ - next_page: number; + state: "pending" | "resizing" | "canceled" | "completed"; /** - * The next page of results + * The number of replicas per cell for the bouncer after the resize */ - next_page_url: string; + replicas_per_cell: number; /** - * The previous page number + * The bouncer parameters */ - prev_page: number; + parameters: { + [key: string]: unknown; + }; /** - * The previous page of results + * The number of replicas per cell for the bouncer before the resize */ - prev_page_url: string; - data: Array<{ + previous_replicas_per_cell: number; + /** + * The previous bouncer parameters + */ + previous_parameters: { + [key: string]: unknown; + }; + /** + * The time the bouncer resize started + */ + started_at: string; + /** + * The time the bouncer resize completed + */ + completed_at: string; + /** + * The time the bouncer resize was created + */ + created_at: string; + /** + * The time the bouncer resize was last updated + */ + updated_at: string; + actor: { /** - * The ID of the role + * The ID of the actor */ id: string; /** - * The name of the role + * The name of the actor */ - name: string; + display_name: string; /** - * The database connection string + * The URL of the actor's avatar */ - access_host_url: string; + avatar_url: string; + }; + bouncer: { /** - * The database connection string for private connections + * The ID for the resource */ - private_access_host_url: string; + id: string; /** - * The service name to set up private connectivity + * The name for the resource */ - private_connection_service_name: string; + name: string; /** - * The database user name + * When the resource was created */ - username: string; + created_at: string; /** - * The plain text password, available only after create + * When the resource was last updated */ - password: string; + updated_at: string; /** - * The database name + * When the resource was deleted, if deleted */ - database_name: string; + deleted_at: string; + }; + sku: { /** - * When the role was created + * The name of the Postgres bouncer SKU */ - created_at: string; + name: string; /** - * When the role was updated + * The display name */ - updated_at: string; + display_name: string; /** - * When the role was deleted + * The CPU allocation */ - deleted_at: string; + cpu: string; /** - * When the role expires + * The amount of memory in bytes */ - expires_at: string; + ram: number; /** - * When the role was dropped + * The sort order of the Postgres bouncer SKU */ - dropped_at: string; + sort_order: number; + }; + previous_sku: { /** - * Error message available when dropping the role fails + * The name of the Postgres bouncer SKU */ - drop_failed: string; + name: string; /** - * True if the credentials are expired + * The display name */ - expired: boolean; + display_name: string; /** - * Whether the role is the default postgres user + * The CPU allocation */ - default: boolean; + cpu: string; /** - * Number of seconds before the credentials expire + * The amount of memory in bytes */ - ttl: number; + ram: number; /** - * Database roles these credentials inherit + * The sort order of the Postgres bouncer SKU */ - inherited_roles: Array< - | "pg_checkpoint" - | "pg_create_subscription" - | "pg_maintain" - | "pg_monitor" - | "pg_read_all_data" - | "pg_read_all_settings" - | "pg_read_all_stats" - | "pg_signal_backend" - | "pg_stat_scan_tables" - | "pg_use_reserved_connections" - | "pg_write_all_data" - | "postgres" - >; - branch: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - actor: { - /** - * The ID of the actor + sort_order: number; + }; +}; + +export type PaginatedPostgresBouncer = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the bouncer + */ + id: string; + /** + * The name of the bouncer + */ + name: string; + sku: { + /** + * The name of the Postgres bouncer SKU + */ + name: string; + /** + * The display name + */ + display_name: string; + /** + * The CPU allocation + */ + cpu: string; + /** + * The amount of memory in bytes + */ + ram: number; + /** + * The sort order of the Postgres bouncer SKU + */ + sort_order: number; + }; + /** + * The instance type the bouncer targets + */ + target: "primary" | "replica" | "replica_az_affinity"; + /** + * The count of replicas in each cell + */ + replicas_per_cell: number; + /** + * When the bouncer was created + */ + created_at: string; + /** + * When the bouncer was updated + */ + updated_at: string; + /** + * When the bouncer was deleted + */ + deleted_at: string; + actor: { + /** + * The ID of the actor */ id: string; /** @@ -3761,95 +4274,194 @@ export type PaginatedPostgresRole = { */ avatar_url: string; }; + branch: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + parameters: Array<{ + /** + * The ID of the parameter + */ + id: string; + /** + * The namespace of the parameter + */ + namespace: "pgbouncer"; + /** + * The name of the parameter + */ + name: string; + /** + * The display name of the parameter + */ + display_name: string; + /** + * The category of the parameter + */ + category: string; + /** + * The description of the parameter + */ + description: string; + /** + * The type of the parameter + */ + parameter_type: + | "array" + | "boolean" + | "bytes" + | "float" + | "integer" + | "internal" + | "seconds" + | "select" + | "string" + | "time"; + /** + * The default value of the parameter + */ + default_value: string; + /** + * The configured value of the parameter + */ + value: string; + /** + * Whether the parameter is required + */ + required: boolean; + /** + * When the parameter was created + */ + created_at: string; + /** + * When the parameter was last updated + */ + updated_at: string; + /** + * True if processes require a server restart on change + */ + restart: boolean; + /** + * The maximum value of the parameter + */ + max: number; + /** + * The minimum value of the parameter + */ + min: number; + /** + * The step change of the parameter + */ + step: number; + /** + * The URL of the parameter + */ + url: string; + /** + * Valid options for the parameter value + */ + options: Array; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + }>; }>; }; -export type PostgresRole = { +export type PostgresBouncer = { /** - * The ID of the role + * The ID of the bouncer */ id: string; /** - * The name of the role + * The name of the bouncer */ name: string; + sku: { + /** + * The name of the Postgres bouncer SKU + */ + name: string; + /** + * The display name + */ + display_name: string; + /** + * The CPU allocation + */ + cpu: string; + /** + * The amount of memory in bytes + */ + ram: number; + /** + * The sort order of the Postgres bouncer SKU + */ + sort_order: number; + }; /** - * The database connection string - */ - access_host_url: string; - /** - * The database connection string for private connections - */ - private_access_host_url: string; - /** - * The service name to set up private connectivity - */ - private_connection_service_name: string; - /** - * The database user name - */ - username: string; - /** - * The plain text password, available only after create + * The instance type the bouncer targets */ - password: string; + target: "primary" | "replica" | "replica_az_affinity"; /** - * The database name + * The count of replicas in each cell */ - database_name: string; + replicas_per_cell: number; /** - * When the role was created + * When the bouncer was created */ created_at: string; /** - * When the role was updated + * When the bouncer was updated */ updated_at: string; /** - * When the role was deleted + * When the bouncer was deleted */ deleted_at: string; - /** - * When the role expires - */ - expires_at: string; - /** - * When the role was dropped - */ - dropped_at: string; - /** - * Error message available when dropping the role fails - */ - drop_failed: string; - /** - * True if the credentials are expired - */ - expired: boolean; - /** - * Whether the role is the default postgres user - */ - default: boolean; - /** - * Number of seconds before the credentials expire - */ - ttl: number; - /** - * Database roles these credentials inherit - */ - inherited_roles: Array< - | "pg_checkpoint" - | "pg_create_subscription" - | "pg_maintain" - | "pg_monitor" - | "pg_read_all_data" - | "pg_read_all_settings" - | "pg_read_all_stats" - | "pg_signal_backend" - | "pg_stat_scan_tables" - | "pg_use_reserved_connections" - | "pg_write_all_data" - | "postgres" - >; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; branch: { /** * The ID for the resource @@ -3872,64 +4484,89 @@ export type PostgresRole = { */ deleted_at: string; }; - actor: { + parameters: Array<{ /** - * The ID of the actor + * The ID of the parameter */ id: string; /** - * The name of the actor + * The namespace of the parameter + */ + namespace: "pgbouncer"; + /** + * The name of the parameter + */ + name: string; + /** + * The display name of the parameter */ display_name: string; /** - * The URL of the actor's avatar + * The category of the parameter */ - avatar_url: string; - }; -}; - -export type PaginatedQueryPatternsDownload = { - /** - * Whether there is a next page of results - */ - has_next: boolean; - /** - * Whether there is a previous page of results - */ - has_prev: boolean; - /** - * The ID of the first object in the current results - */ - cursor_start: string; - /** - * The ID of the last object in the current results - */ - cursor_end: string; - data: Array<{ + category: string; /** - * The ID of the query patterns download + * The description of the parameter */ - id: string; + description: string; /** - * The state of the download + * The type of the parameter */ - state: "pending" | "completed" | "failed"; + parameter_type: + | "array" + | "boolean" + | "bytes" + | "float" + | "integer" + | "internal" + | "seconds" + | "select" + | "string" + | "time"; /** - * When the download was created + * The default value of the parameter + */ + default_value: string; + /** + * The configured value of the parameter + */ + value: string; + /** + * Whether the parameter is required + */ + required: boolean; + /** + * When the parameter was created */ created_at: string; /** - * When the download was finished + * When the parameter was last updated */ - finished_at: string; + updated_at: string; /** - * The URL to access the query patterns download + * True if processes require a server restart on change + */ + restart: boolean; + /** + * The maximum value of the parameter + */ + max: number; + /** + * The minimum value of the parameter + */ + min: number; + /** + * The step change of the parameter + */ + step: number; + /** + * The URL of the parameter */ url: string; /** - * The URL to download the query patterns file + * Valid options for the parameter value */ - download_url: string; + options: Array; actor: { /** * The ID of the actor @@ -3947,48 +4584,7 @@ export type PaginatedQueryPatternsDownload = { }>; }; -export type QueryPatternsDownload = { - /** - * The ID of the query patterns download - */ - id: string; - /** - * The state of the download - */ - state: "pending" | "completed" | "failed"; - /** - * When the download was created - */ - created_at: string; - /** - * When the download was finished - */ - finished_at: string; - /** - * The URL to access the query patterns download - */ - url: string; - /** - * The URL to download the query patterns file - */ - download_url: string; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; -}; - -export type PaginatedPublicPlanetscaleRegionSerializer = { +export type PaginatedPostgresRole = { /** * The current page number */ @@ -4011,390 +4607,95 @@ export type PaginatedPublicPlanetscaleRegionSerializer = { prev_page_url: string; data: Array<{ /** - * The ID of the region + * The ID of the role */ id: string; /** - * The cloud provider for the region - */ - provider: string; - /** - * Whether new clusters can be created in this region + * The name of the role */ - enabled: boolean; + name: string; /** - * List of public IP addresses for the region + * The database connection string */ - public_ip_addresses: Array; + access_host_url: string; /** - * The name of the region + * The database connection string for private connections */ - display_name: string; + private_access_host_url: string; /** - * The location of the region + * The service name to set up private connectivity */ - location: string; + private_connection_service_name: string; /** - * The slug identifier for the region + * The database user name */ - slug: string; - }>; -}; - -export type User = { - /** - * The ID of the user - */ - id: string; - /** - * The display name of the user - */ - display_name: string; - /** - * The name of the user - */ - name: string; - /** - * The email of the user - */ - email: string; - /** - * The URL source of the user's avatar - */ - avatar_url: string; - /** - * When the user was created - */ - created_at: string; - /** - * When the user was last updated - */ - updated_at: string; - /** - * Whether or not the user has configured two factor authentication - */ - two_factor_auth_configured: boolean; - default_organization: { + username: string; /** - * The ID for the resource + * The plain text password, available only after create */ - id: string; + password: string; /** - * The name for the resource + * The database name */ - name: string; + database_name: string; /** - * When the resource was created + * When the role was created */ created_at: string; /** - * When the resource was last updated + * When the role was updated */ updated_at: string; /** - * When the resource was deleted, if deleted + * When the role was deleted */ deleted_at: string; - }; - /** - * Whether or not the user is managed by SSO - */ - sso: boolean; - /** - * Whether or not the user is managed by an authentication provider - */ - managed: boolean; - /** - * Whether or not the user is managed by a SSO directory - */ - directory_managed: boolean; - /** - * Whether or not the user is verified by email - */ - email_verified: boolean; -}; - -export type PaginatedWorkflow = { - /** - * The current page number - */ - current_page: number; - /** - * The next page number - */ - next_page: number; - /** - * The next page of results - */ - next_page_url: string; - /** - * The previous page number - */ - prev_page: number; - /** - * The previous page of results - */ - prev_page_url: string; - data: Array<{ /** - * The ID of the workflow + * When the role expires */ - id: string; + expires_at: string; /** - * The name of the workflow + * When the role was dropped */ - name: string; + dropped_at: string; /** - * The sequence number of the workflow + * When the role was disabled */ - number: number; + disabled_at: string; /** - * The state of the workflow + * Error message available when dropping the role fails */ - state: - | "pending" - | "copying" - | "running" - | "stopped" - | "verifying_data" - | "verified_data" - | "switching_replicas" - | "switched_replicas" - | "switching_primaries" - | "switched_primaries" - | "reversing_traffic" - | "reversing_traffic_for_cancel" - | "cutting_over" - | "cutover" - | "reversed_cutover" - | "completed" - | "cancelling" - | "cancelled" - | "error"; - /** - * When the workflow was created - */ - created_at: string; - /** - * When the workflow was last updated - */ - updated_at: string; - /** - * When the workflow was started - */ - started_at: string; - /** - * When the workflow was completed - */ - completed_at: string; - /** - * When the workflow was cancelled - */ - cancelled_at: string; - /** - * When the workflow was reversed - */ - reversed_at: string; - /** - * When the workflow was retried - */ - retried_at: string; - /** - * When the data copy was completed - */ - data_copy_completed_at: string; - /** - * When the cutover was completed - */ - cutover_at: string; - /** - * Whether or not the replicas have been switched - */ - replicas_switched: boolean; - /** - * Whether or not the primaries have been switched - */ - primaries_switched: boolean; - /** - * When the replicas were switched - */ - switch_replicas_at: string; - /** - * When the primaries were switched - */ - switch_primaries_at: string; - /** - * When the data was verified - */ - verify_data_at: string; - /** - * The type of the workflow - */ - workflow_type: "move_tables"; - /** - * The subtype of the workflow - */ - workflow_subtype: string; - /** - * Whether or not secondary keys are deferred - */ - defer_secondary_keys: boolean; + drop_failed: string; /** - * The behavior when DDL changes during the workflow + * True if the credentials are expired */ - on_ddl: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; + expired: boolean; /** - * Whether or not the workflow may be retried + * Whether the role is the default postgres user */ - may_retry: boolean; + default: boolean; /** - * Whether or not the verified data is stale + * Number of seconds before the credentials expire */ - verified_data_stale: boolean; + ttl: number; /** - * Whether or not sequence tables have been created + * Database roles these credentials inherit */ - sequence_tables_applied: boolean; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - verify_data_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - reversed_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - switch_replicas_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - switch_primaries_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cancelled_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - completed_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - retried_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cutover_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - reversed_cutover_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; + inherited_roles: Array< + | "pscale_managed" + | "pg_checkpoint" + | "pg_create_subscription" + | "pg_maintain" + | "pg_monitor" + | "pg_read_all_data" + | "pg_read_all_settings" + | "pg_read_all_stats" + | "pg_signal_backend" + | "pg_stat_scan_tables" + | "pg_use_reserved_connections" + | "pg_write_all_data" + | "postgres" + >; branch: { /** * The ID for the resource @@ -4417,224 +4718,137 @@ export type PaginatedWorkflow = { */ deleted_at: string; }; - source_keyspace: { + actor: { /** - * The ID for the resource + * The ID of the actor */ id: string; /** - * The name for the resource + * The name of the actor */ - name: string; + display_name: string; /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - target_keyspace: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - global_keyspace: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted + * The URL of the actor's avatar */ - deleted_at: string; + avatar_url: string; }; }>; }; -export type Workflow = { +export type PostgresRole = { /** - * The ID of the workflow + * The ID of the role */ id: string; /** - * The name of the workflow + * The name of the role */ name: string; /** - * The sequence number of the workflow - */ - number: number; - /** - * The state of the workflow - */ - state: - | "pending" - | "copying" - | "running" - | "stopped" - | "verifying_data" - | "verified_data" - | "switching_replicas" - | "switched_replicas" - | "switching_primaries" - | "switched_primaries" - | "reversing_traffic" - | "reversing_traffic_for_cancel" - | "cutting_over" - | "cutover" - | "reversed_cutover" - | "completed" - | "cancelling" - | "cancelled" - | "error"; - /** - * When the workflow was created - */ - created_at: string; - /** - * When the workflow was last updated - */ - updated_at: string; - /** - * When the workflow was started - */ - started_at: string; - /** - * When the workflow was completed - */ - completed_at: string; - /** - * When the workflow was cancelled + * The database connection string */ - cancelled_at: string; + access_host_url: string; /** - * When the workflow was reversed + * The database connection string for private connections */ - reversed_at: string; + private_access_host_url: string; /** - * When the workflow was retried + * The service name to set up private connectivity */ - retried_at: string; + private_connection_service_name: string; /** - * When the data copy was completed + * The database user name */ - data_copy_completed_at: string; + username: string; /** - * When the cutover was completed + * The plain text password, available only after create */ - cutover_at: string; + password: string; /** - * Whether or not the replicas have been switched + * The database name */ - replicas_switched: boolean; + database_name: string; /** - * Whether or not the primaries have been switched + * When the role was created */ - primaries_switched: boolean; + created_at: string; /** - * When the replicas were switched + * When the role was updated */ - switch_replicas_at: string; + updated_at: string; /** - * When the primaries were switched + * When the role was deleted */ - switch_primaries_at: string; + deleted_at: string; /** - * When the data was verified + * When the role expires */ - verify_data_at: string; + expires_at: string; /** - * The type of the workflow + * When the role was dropped */ - workflow_type: "move_tables"; + dropped_at: string; /** - * The subtype of the workflow + * When the role was disabled */ - workflow_subtype: string; + disabled_at: string; /** - * Whether or not secondary keys are deferred + * Error message available when dropping the role fails */ - defer_secondary_keys: boolean; + drop_failed: string; /** - * The behavior when DDL changes during the workflow + * True if the credentials are expired */ - on_ddl: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; + expired: boolean; /** - * Whether or not the workflow may be retried + * Whether the role is the default postgres user */ - may_retry: boolean; + default: boolean; /** - * Whether or not the verified data is stale + * Number of seconds before the credentials expire */ - verified_data_stale: boolean; + ttl: number; /** - * Whether or not sequence tables have been created + * Database roles these credentials inherit */ - sequence_tables_applied: boolean; - actor: { + inherited_roles: Array< + | "pscale_managed" + | "pg_checkpoint" + | "pg_create_subscription" + | "pg_maintain" + | "pg_monitor" + | "pg_read_all_data" + | "pg_read_all_settings" + | "pg_read_all_stats" + | "pg_signal_backend" + | "pg_stat_scan_tables" + | "pg_use_reserved_connections" + | "pg_write_all_data" + | "postgres" + >; + branch: { /** - * The ID of the actor + * The ID for the resource */ id: string; /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar + * The name for the resource */ - avatar_url: string; - }; - verify_data_by: { + name: string; /** - * The ID of the actor + * When the resource was created */ - id: string; + created_at: string; /** - * The name of the actor + * When the resource was last updated */ - display_name: string; + updated_at: string; /** - * The URL of the actor's avatar + * When the resource was deleted, if deleted */ - avatar_url: string; + deleted_at: string; }; - reversed_by: { + actor: { /** * The ID of the actor */ @@ -4648,63 +4862,93 @@ export type Workflow = { */ avatar_url: string; }; - switch_replicas_by: { +}; + +export type PaginatedQueryPatternsDownload = { + /** + * Whether there is a next page of results + */ + has_next: boolean; + /** + * Whether there is a previous page of results + */ + has_prev: boolean; + /** + * The ID of the first object in the current results + */ + cursor_start: string; + /** + * The ID of the last object in the current results + */ + cursor_end: string; + data: Array<{ /** - * The ID of the actor + * The ID of the query patterns download */ id: string; /** - * The name of the actor + * The state of the download */ - display_name: string; + state: "pending" | "completed" | "failed"; /** - * The URL of the actor's avatar + * When the download was created */ - avatar_url: string; - }; - switch_primaries_by: { + created_at: string; /** - * The ID of the actor + * When the download was finished */ - id: string; + finished_at: string; /** - * The name of the actor + * The URL to access the query patterns download */ - display_name: string; + url: string; /** - * The URL of the actor's avatar + * The URL to download the query patterns file */ - avatar_url: string; - }; - cancelled_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - completed_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - retried_by: { + download_url: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + }>; +}; + +export type QueryPatternsDownload = { + /** + * The ID of the query patterns download + */ + id: string; + /** + * The state of the download + */ + state: "pending" | "completed" | "failed"; + /** + * When the download was created + */ + created_at: string; + /** + * When the download was finished + */ + finished_at: string; + /** + * The URL to access the query patterns download + */ + url: string; + /** + * The URL to download the query patterns file + */ + download_url: string; + actor: { /** * The ID of the actor */ @@ -4718,101 +4962,95 @@ export type Workflow = { */ avatar_url: string; }; - cutover_by: { +}; + +export type PaginatedPublicPlanetscaleRegionSerializer = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ /** - * The ID of the actor + * The ID of the region */ id: string; /** - * The name of the actor + * The cloud provider for the region */ - display_name: string; + provider: string; /** - * The URL of the actor's avatar + * Whether new clusters can be created in this region */ - avatar_url: string; - }; - reversed_cutover_by: { + enabled: boolean; /** - * The ID of the actor + * List of public IP addresses for the region */ - id: string; + public_ip_addresses: Array; /** - * The name of the actor + * The name of the region */ display_name: string; /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - branch: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - source_keyspace: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - target_keyspace: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated + * The location of the region */ - updated_at: string; + location: string; /** - * When the resource was deleted, if deleted + * The slug identifier for the region */ - deleted_at: string; - }; - global_keyspace: { + slug: string; + }>; +}; + +export type User = { + /** + * The ID of the user + */ + id: string; + /** + * The display name of the user + */ + display_name: string; + /** + * The name of the user + */ + name: string; + /** + * The email of the user + */ + email: string; + /** + * The URL source of the user's avatar + */ + avatar_url: string; + /** + * When the user was created + */ + created_at: string; + /** + * When the user was last updated + */ + updated_at: string; + /** + * Whether or not the user has configured two factor authentication + */ + two_factor_auth_configured: boolean; + default_organization: { /** * The ID for the resource */ @@ -4834,9 +5072,25 @@ export type Workflow = { */ deleted_at: string; }; + /** + * Whether or not the user is managed by SSO + */ + sso: boolean; + /** + * Whether or not the user is managed by an authentication provider + */ + managed: boolean; + /** + * Whether or not the user is managed by a SSO directory + */ + directory_managed: boolean; + /** + * Whether or not the user is verified by email + */ + email_verified: boolean; }; -export type PaginatedDeployRequestReview = { +export type PaginatedWorkflow = { /** * The current page number */ @@ -4859,117 +5113,132 @@ export type PaginatedDeployRequestReview = { prev_page_url: string; data: Array<{ /** - * The ID of the review + * The ID of the workflow */ id: string; /** - * The text body of the review + * The name of the workflow */ - body: string; + name: string; /** - * The HTML body of the review + * The sequence number of the workflow */ - html_body: string; + number: number; /** - * Whether the review is a comment or approval + * The state of the workflow */ - state: "commented" | "approved"; + state: + | "pending" + | "copying" + | "running" + | "stopped" + | "verifying_data" + | "verified_data" + | "switching_replicas" + | "switched_replicas" + | "switching_primaries" + | "switched_primaries" + | "reversing_traffic" + | "reversing_traffic_for_cancel" + | "cutting_over" + | "cutover" + | "reversed_cutover" + | "completed" + | "cancelling" + | "cancelled" + | "error"; /** - * When the review was created + * When the workflow was created */ created_at: string; /** - * When the review was last updated + * When the workflow was last updated */ updated_at: string; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - }>; -}; - -export type DeployRequestReview = { - /** - * The ID of the review - */ - id: string; - /** - * The text body of the review - */ - body: string; - /** - * The HTML body of the review - */ - html_body: string; - /** - * Whether the review is a comment or approval - */ - state: "commented" | "approved"; - /** - * When the review was created - */ - created_at: string; - /** - * When the review was last updated - */ - updated_at: string; - actor: { /** - * The ID of the actor + * When the workflow was started */ - id: string; + started_at: string; /** - * The name of the actor + * When the workflow was completed */ - display_name: string; + completed_at: string; /** - * The URL of the actor's avatar + * When the workflow was cancelled */ - avatar_url: string; - }; -}; - -export type PaginatedDatabaseDeployRequest = { - /** - * The current page number - */ - current_page: number; - /** - * The next page number - */ - next_page: number; - /** - * The next page of results - */ - next_page_url: string; - /** - * The previous page number - */ - prev_page: number; - /** - * The previous page of results - */ - prev_page_url: string; - data: Array<{ + cancelled_at: string; /** - * The ID of the deploy request + * When the workflow was reversed */ - id: string; + reversed_at: string; /** - * The number of the deploy request + * When the workflow was retried */ - number: number; + retried_at: string; + /** + * When the data copy was completed + */ + data_copy_completed_at: string; + /** + * When the cutover was completed + */ + cutover_at: string; + /** + * Whether or not the replicas have been switched + */ + replicas_switched: boolean; + /** + * Whether or not the primaries have been switched + */ + primaries_switched: boolean; + /** + * When the replicas were switched + */ + switch_replicas_at: string; + /** + * When the primaries were switched + */ + switch_primaries_at: string; + /** + * When the data was verified + */ + verify_data_at: string; + /** + * The type of the workflow + */ + workflow_type: "move_tables"; + /** + * The subtype of the workflow + */ + workflow_subtype: string; + /** + * Whether or not secondary keys are deferred + */ + defer_secondary_keys: boolean; + /** + * The behavior when DDL changes during the workflow + */ + on_ddl: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; + /** + * The errors that occurred during the workflow + */ + workflow_errors: string; + /** + * Whether or not the workflow may be retried + */ + may_retry: boolean; + /** + * Whether or not the workflow may be restarted + */ + may_restart: boolean; + /** + * Whether or not the verified data is stale + */ + verified_data_stale: boolean; + /** + * Whether or not sequence tables have been created + */ + sequence_tables_applied: boolean; actor: { /** * The ID of the actor @@ -4984,7 +5253,7 @@ export type PaginatedDatabaseDeployRequest = { */ avatar_url: string; }; - closed_by: { + verify_data_by: { /** * The ID of the actor */ @@ -4998,19 +5267,7 @@ export type PaginatedDatabaseDeployRequest = { */ avatar_url: string; }; - /** - * The name of the branch the deploy request was created from - */ - branch: string; - /** - * The ID of the branch the deploy request was created from - */ - branch_id: string; - /** - * Whether or not the deploy request branch was deleted - */ - branch_deleted: boolean; - branch_deleted_by: { + reversed_by: { /** * The ID of the actor */ @@ -5024,2226 +5281,5126 @@ export type PaginatedDatabaseDeployRequest = { */ avatar_url: string; }; - /** - * When the deploy request branch was deleted - */ - branch_deleted_at: string; - /** - * The name of the branch the deploy request will be merged into - */ - into_branch: string; - /** - * Whether or not the branch the deploy request will be merged into is sharded - */ - into_branch_sharded: boolean; - /** - * The number of shards the branch the deploy request will be merged into has - */ - into_branch_shard_count: number; - /** - * Whether or not the deploy request is approved - */ - approved: boolean; - /** - * Whether the deploy request is open or closed - */ - state: "open" | "closed"; - /** - * The deployment state of the deploy request - */ - deployment_state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; - deployment: { + switch_replicas_by: { /** - * The ID of the deployment + * The ID of the actor */ id: string; /** - * Whether or not to automatically cutover once deployment is finished + * The name of the actor */ - auto_cutover: boolean; + display_name: string; /** - * Whether or not to automatically delete the head branch once deployment is finished + * The URL of the actor's avatar */ - auto_delete_branch: boolean; + avatar_url: string; + }; + switch_primaries_by: { /** - * When the deployment was created + * The ID of the actor */ - created_at: string; + id: string; /** - * When the cutover for the deployment was initiated + * The name of the actor */ - cutover_at: string; + display_name: string; /** - * Whether or not the deployment cutover will expire soon + * The URL of the actor's avatar */ - cutover_expiring: boolean; + avatar_url: string; + }; + cancelled_by: { /** - * Deploy check errors for the deployment + * The ID of the actor */ - deploy_check_errors: string; + id: string; /** - * When the deployment was finished + * The name of the actor */ - finished_at: string; + display_name: string; /** - * When the deployment was queued + * The URL of the actor's avatar */ - queued_at: string; + avatar_url: string; + }; + completed_by: { /** - * When the deployment was ready for cutover + * The ID of the actor */ - ready_to_cutover_at: string; + id: string; /** - * When the deployment was started + * The name of the actor */ - started_at: string; + display_name: string; /** - * The state the deployment is in + * The URL of the actor's avatar */ - state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; + avatar_url: string; + }; + retried_by: { /** - * When the deployment was submitted + * The ID of the actor */ - submitted_at: string; + id: string; /** - * When the deployment was last updated + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + reversed_cutover_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + branch: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated */ updated_at: string; /** - * The name of the base branch the deployment will be merged into + * When the resource was deleted, if deleted */ - into_branch: string; + deleted_at: string; + }; + source_keyspace: { /** - * The number of the deploy request associated with this deployment + * The ID for the resource */ - deploy_request_number: number; + id: string; /** - * Whether the deployment is deployable + * The name for the resource */ - deployable: boolean; + name: string; /** - * The deployments ahead of this one in the queue + * When the resource was created */ - preceding_deployments: Array<{ - [key: string]: unknown; - }>; - deploy_operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The keyspace modified by the deploy operation - */ - keyspace_name: string; - /** - * The name of the table modifed by the deploy operation - */ - table_name: string; - /** - * The operation name of the deploy operation - */ - operation_name: string; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * A link to documentation explaining the deploy error, if present - */ - deploy_error_docs_url: string; - /** - * The DDL statement for the deploy operation - */ - ddl_statement: string; - /** - * A syntax-highlighted DDL statement for the deploy operation - */ - syntax_highlighted_ddl: string; - /** - * When the deploy operation was created - */ - created_at: string; - /** - * When the deploy operation was last updated - */ - updated_at: string; - /** - * When the deploy operation was last throttled - */ - throttled_at: string; - /** - * Whether or not the deploy operation is capable of dropping data - */ - can_drop_data: boolean; - /** - * Whether or not the table modified by the deploy operation is currently locked - */ - table_locked: boolean; - /** - * Whether or not the table modified by the deploy operation was recently used - */ - table_recently_used: boolean; - /** - * When the table modified by the deploy operation was last used - */ - table_recently_used_at: string; - /** - * Names of foreign keys removed by this operation - */ - removed_foreign_key_names: Array; - /** - * Deploy errors for the deploy operation - */ - deploy_errors: string; - }>; - deploy_operation_summaries: Array<{ - /** - * The ID for the deploy operation summary - */ - id: string; - /** - * When the deploy operation summary was created - */ - created_at: string; - /** - * Deploy errors for the deploy operation summary - */ - deploy_errors: string; - /** - * The DDL statement for the deploy operation summary - */ - ddl_statement: string; - /** - * The estimated seconds until completion for the deploy operation summary - */ - eta_seconds: number; - /** - * The keyspace modified by the deploy operation summary - */ - keyspace_name: string; - /** - * The operation name of the deploy operation summary - */ - operation_name: string; - /** - * The percent completion for the deploy operation summary - */ - progress_percentage: number; - /** - * The state of the deploy operation summary - */ - state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; - /** - * A syntax-highlighted DDL statement for the deploy operation summary - */ - syntax_highlighted_ddl: string; - /** - * The name of the table modifed by the deploy operation summary - */ - table_name: string; - /** - * When the table modified by the deploy operation summary was last used - */ - table_recently_used_at: string; - /** - * When the deploy operation summary was last throttled - */ - throttled_at: string; - /** - * Names of foreign keys removed by this operation summary - */ - removed_foreign_key_names: Array; - /** - * The number of shards in the keyspace modified by the deploy operation summary - */ - shard_count: number; - /** - * Names of shards in the keyspace modified by the deploy operation summary - */ - shard_names: Array; - /** - * Whether or not the deploy operation summary is capable of dropping data - */ - can_drop_data: boolean; - /** - * Whether or not the table modified by the deploy operation summary was recently used - */ - table_recently_used: boolean; - /** - * Whether or not the keyspace modified by the deploy operation summary is sharded - */ - sharded: boolean; - operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The shard the deploy operation is being performed on - */ - shard: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - }>; - }>; + created_at: string; /** - * Schema lint errors preventing the deployment from completing + * When the resource was last updated */ - lint_errors: Array<{ - [key: string]: unknown; - }>; + updated_at: string; /** - * The schema dependencies that must be satisfied + * When the resource was deleted, if deleted */ - sequential_diff_dependencies: Array<{ - [key: string]: unknown; - }>; + deleted_at: string; + }; + target_keyspace: { /** - * Lookup Vitess index operations + * The ID for the resource */ - lookup_vindex_operations: Array<{ - [key: string]: unknown; - }>; + id: string; /** - * Deployment throttling configurations + * The name for the resource */ - throttler_configurations: Array<{ - [key: string]: unknown; - }>; + name: string; /** - * The request to revert the schema operations in this deployment + * When the resource was created */ - deployment_revert_request: { - [key: string]: unknown; - }; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cutover_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cancelled_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; + created_at: string; /** - * When the schema was last updated for the deployment + * When the resource was last updated */ - schema_last_updated_at: string; + updated_at: string; /** - * Whether or not the deployment has a table locked + * When the resource was deleted, if deleted */ - table_locked: boolean; + deleted_at: string; + }; + global_keyspace: { /** - * The name of he table that is locked by the deployment + * The ID for the resource */ - locked_table_name: string; + id: string; /** - * Whether or not the deployment is an instant DDL deployment + * The name for the resource */ - instant_ddl: boolean; + name: string; /** - * Whether or not the deployment is eligible for instant DDL + * When the resource was created */ - instant_ddl_eligible: boolean; + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; }; - /** - * The number of comments on the deploy request - */ - num_comments: number; - /** - * The PlanetScale app address for the deploy request - */ - html_url: string; - /** - * Notes on the deploy request - */ - notes: string; - /** - * The HTML body of the deploy request - */ - html_body: string; - /** - * When the deploy request was created - */ - created_at: string; - /** - * When the deploy request was last updated - */ - updated_at: string; - /** - * When the deploy request was closed - */ - closed_at: string; - /** - * When the deploy request was deployed - */ - deployed_at: string; }>; }; -export type DatabaseDeployRequest = { +export type Workflow = { /** - * The ID of the deploy request + * The ID of the workflow */ id: string; /** - * The number of the deploy request - */ - number: number; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - closed_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - /** - * The name of the branch the deploy request was created from + * The name of the workflow */ - branch: string; + name: string; /** - * The ID of the branch the deploy request was created from + * The sequence number of the workflow */ - branch_id: string; + number: number; /** - * Whether or not the deploy request branch was deleted + * The state of the workflow */ - branch_deleted: boolean; - branch_deleted_by: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; + state: + | "pending" + | "copying" + | "running" + | "stopped" + | "verifying_data" + | "verified_data" + | "switching_replicas" + | "switched_replicas" + | "switching_primaries" + | "switched_primaries" + | "reversing_traffic" + | "reversing_traffic_for_cancel" + | "cutting_over" + | "cutover" + | "reversed_cutover" + | "completed" + | "cancelling" + | "cancelled" + | "error"; /** - * When the deploy request branch was deleted + * When the workflow was created */ - branch_deleted_at: string; + created_at: string; /** - * The name of the branch the deploy request will be merged into + * When the workflow was last updated */ - into_branch: string; + updated_at: string; /** - * Whether or not the branch the deploy request will be merged into is sharded + * When the workflow was started */ - into_branch_sharded: boolean; + started_at: string; /** - * The number of shards the branch the deploy request will be merged into has + * When the workflow was completed */ - into_branch_shard_count: number; + completed_at: string; /** - * Whether or not the deploy request is approved + * When the workflow was cancelled */ - approved: boolean; + cancelled_at: string; /** - * Whether the deploy request is open or closed + * When the workflow was reversed */ - state: "open" | "closed"; + reversed_at: string; /** - * The deployment state of the deploy request + * When the workflow was retried */ - deployment_state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; - deployment: { + retried_at: string; + /** + * When the data copy was completed + */ + data_copy_completed_at: string; + /** + * When the cutover was completed + */ + cutover_at: string; + /** + * Whether or not the replicas have been switched + */ + replicas_switched: boolean; + /** + * Whether or not the primaries have been switched + */ + primaries_switched: boolean; + /** + * When the replicas were switched + */ + switch_replicas_at: string; + /** + * When the primaries were switched + */ + switch_primaries_at: string; + /** + * When the data was verified + */ + verify_data_at: string; + /** + * The type of the workflow + */ + workflow_type: "move_tables"; + /** + * The subtype of the workflow + */ + workflow_subtype: string; + /** + * Whether or not secondary keys are deferred + */ + defer_secondary_keys: boolean; + /** + * The behavior when DDL changes during the workflow + */ + on_ddl: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; + /** + * The errors that occurred during the workflow + */ + workflow_errors: string; + /** + * Whether or not the workflow may be retried + */ + may_retry: boolean; + /** + * Whether or not the workflow may be restarted + */ + may_restart: boolean; + /** + * Whether or not the verified data is stale + */ + verified_data_stale: boolean; + /** + * Whether or not sequence tables have been created + */ + sequence_tables_applied: boolean; + actor: { /** - * The ID of the deployment + * The ID of the actor */ id: string; /** - * Whether or not to automatically cutover once deployment is finished + * The name of the actor */ - auto_cutover: boolean; + display_name: string; /** - * Whether or not to automatically delete the head branch once deployment is finished + * The URL of the actor's avatar */ - auto_delete_branch: boolean; + avatar_url: string; + }; + verify_data_by: { /** - * When the deployment was created + * The ID of the actor */ - created_at: string; + id: string; /** - * When the cutover for the deployment was initiated + * The name of the actor */ - cutover_at: string; + display_name: string; /** - * Whether or not the deployment cutover will expire soon + * The URL of the actor's avatar */ - cutover_expiring: boolean; + avatar_url: string; + }; + reversed_by: { /** - * Deploy check errors for the deployment + * The ID of the actor */ - deploy_check_errors: string; + id: string; /** - * When the deployment was finished + * The name of the actor */ - finished_at: string; + display_name: string; /** - * When the deployment was queued + * The URL of the actor's avatar */ - queued_at: string; + avatar_url: string; + }; + switch_replicas_by: { /** - * When the deployment was ready for cutover + * The ID of the actor */ - ready_to_cutover_at: string; + id: string; /** - * When the deployment was started + * The name of the actor */ - started_at: string; + display_name: string; /** - * The state the deployment is in + * The URL of the actor's avatar */ - state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; + avatar_url: string; + }; + switch_primaries_by: { /** - * When the deployment was submitted + * The ID of the actor */ - submitted_at: string; + id: string; /** - * When the deployment was last updated + * The name of the actor */ - updated_at: string; + display_name: string; /** - * The name of the base branch the deployment will be merged into + * The URL of the actor's avatar */ - into_branch: string; + avatar_url: string; + }; + cancelled_by: { /** - * The number of the deploy request associated with this deployment + * The ID of the actor */ - deploy_request_number: number; + id: string; /** - * Whether the deployment is deployable + * The name of the actor */ - deployable: boolean; + display_name: string; /** - * The deployments ahead of this one in the queue + * The URL of the actor's avatar */ - preceding_deployments: Array<{ - [key: string]: unknown; - }>; - deploy_operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The keyspace modified by the deploy operation + avatar_url: string; + }; + completed_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + retried_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + reversed_cutover_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + branch: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + source_keyspace: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + target_keyspace: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + global_keyspace: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; +}; + +export type PaginatedDeployRequestReview = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the review + */ + id: string; + /** + * The text body of the review + */ + body: string; + /** + * The HTML body of the review + */ + html_body: string; + /** + * Whether the review is a comment or approval + */ + state: "commented" | "approved"; + /** + * When the review was created + */ + created_at: string; + /** + * When the review was last updated + */ + updated_at: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + }>; +}; + +export type DeployRequestReview = { + /** + * The ID of the review + */ + id: string; + /** + * The text body of the review + */ + body: string; + /** + * The HTML body of the review + */ + html_body: string; + /** + * Whether the review is a comment or approval + */ + state: "commented" | "approved"; + /** + * When the review was created + */ + created_at: string; + /** + * When the review was last updated + */ + updated_at: string; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; +}; + +export type PaginatedDatabaseDeployRequest = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the deploy request + */ + id: string; + /** + * The number of the deploy request + */ + number: number; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + closed_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * The name of the branch the deploy request was created from + */ + branch: string; + /** + * The ID of the branch the deploy request was created from + */ + branch_id: string; + /** + * Whether or not the deploy request branch was deleted + */ + branch_deleted: boolean; + branch_deleted_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the deploy request branch was deleted + */ + branch_deleted_at: string; + /** + * The name of the branch the deploy request will be merged into + */ + into_branch: string; + /** + * Whether or not the branch the deploy request will be merged into is sharded + */ + into_branch_sharded: boolean; + /** + * The number of shards the branch the deploy request will be merged into has + */ + into_branch_shard_count: number; + /** + * Whether or not the deploy request is approved + */ + approved: boolean; + /** + * Whether the deploy request is open or closed + */ + state: "open" | "closed"; + /** + * The deployment state of the deploy request + */ + deployment_state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + deployment: { + /** + * The ID of the deployment + */ + id: string; + /** + * Whether or not to automatically cutover once deployment is finished + */ + auto_cutover: boolean; + /** + * Whether or not to automatically delete the head branch once deployment is finished + */ + auto_delete_branch: boolean; + /** + * When the deployment was created + */ + created_at: string; + /** + * When the cutover for the deployment was initiated + */ + cutover_at: string; + /** + * Whether or not the deployment cutover will expire soon + */ + cutover_expiring: boolean; + /** + * Deploy check errors for the deployment + */ + deploy_check_errors: string; + /** + * When the deployment was finished + */ + finished_at: string; + /** + * When the deployment was queued + */ + queued_at: string; + /** + * When the deployment was ready for cutover + */ + ready_to_cutover_at: string; + /** + * When the deployment was started + */ + started_at: string; + /** + * The state the deployment is in + */ + state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + /** + * When the deployment was submitted + */ + submitted_at: string; + /** + * When the deployment was last updated + */ + updated_at: string; + /** + * The name of the base branch the deployment will be merged into + */ + into_branch: string; + /** + * The number of the deploy request associated with this deployment + */ + deploy_request_number: number; + /** + * Whether the deployment is deployable + */ + deployable: boolean; + /** + * The deployments ahead of this one in the queue + */ + preceding_deployments: Array<{ + [key: string]: unknown; + }>; + deploy_operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The keyspace modified by the deploy operation + */ + keyspace_name: string; + /** + * The name of the table modifed by the deploy operation + */ + table_name: string; + /** + * The operation name of the deploy operation + */ + operation_name: string; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * A link to documentation explaining the deploy error, if present + */ + deploy_error_docs_url: string; + /** + * The DDL statement for the deploy operation + */ + ddl_statement: string; + /** + * A syntax-highlighted DDL statement for the deploy operation + */ + syntax_highlighted_ddl: string; + /** + * When the deploy operation was created + */ + created_at: string; + /** + * When the deploy operation was last updated + */ + updated_at: string; + /** + * When the deploy operation was last throttled + */ + throttled_at: string; + /** + * Whether or not the deploy operation is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation is currently locked + */ + table_locked: boolean; + /** + * Whether or not the table modified by the deploy operation was recently used + */ + table_recently_used: boolean; + /** + * When the table modified by the deploy operation was last used + */ + table_recently_used_at: string; + /** + * Names of foreign keys removed by this operation + */ + removed_foreign_key_names: Array; + /** + * Deploy errors for the deploy operation + */ + deploy_errors: string; + }>; + deploy_operation_summaries: Array<{ + /** + * The ID for the deploy operation summary + */ + id: string; + /** + * When the deploy operation summary was created + */ + created_at: string; + /** + * Deploy errors for the deploy operation summary + */ + deploy_errors: string; + /** + * The DDL statement for the deploy operation summary + */ + ddl_statement: string; + /** + * The estimated seconds until completion for the deploy operation summary + */ + eta_seconds: number; + /** + * The keyspace modified by the deploy operation summary + */ + keyspace_name: string; + /** + * The operation name of the deploy operation summary + */ + operation_name: string; + /** + * The percent completion for the deploy operation summary + */ + progress_percentage: number; + /** + * The state of the deploy operation summary + */ + state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; + /** + * A syntax-highlighted DDL statement for the deploy operation summary + */ + syntax_highlighted_ddl: string; + /** + * The name of the table modifed by the deploy operation summary + */ + table_name: string; + /** + * When the table modified by the deploy operation summary was last used + */ + table_recently_used_at: string; + /** + * When the deploy operation summary was last throttled + */ + throttled_at: string; + /** + * Names of foreign keys removed by this operation summary + */ + removed_foreign_key_names: Array; + /** + * The number of shards in the keyspace modified by the deploy operation summary + */ + shard_count: number; + /** + * Names of shards in the keyspace modified by the deploy operation summary + */ + shard_names: Array; + /** + * Whether or not the deploy operation summary is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation summary was recently used + */ + table_recently_used: boolean; + /** + * Whether or not the keyspace modified by the deploy operation summary is sharded + */ + sharded: boolean; + operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The shard the deploy operation is being performed on + */ + shard: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + }>; + }>; + /** + * Schema lint errors preventing the deployment from completing + */ + lint_errors: Array<{ + [key: string]: unknown; + }>; + /** + * The schema dependencies that must be satisfied + */ + sequential_diff_dependencies: Array<{ + [key: string]: unknown; + }>; + /** + * Lookup Vitess index operations + */ + lookup_vindex_operations: Array<{ + [key: string]: unknown; + }>; + /** + * Deployment throttling configurations + */ + throttler_configurations: Array<{ + [key: string]: unknown; + }>; + /** + * The request to revert the schema operations in this deployment + */ + deployment_revert_request: { + [key: string]: unknown; + }; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cancelled_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the schema was last updated for the deployment + */ + schema_last_updated_at: string; + /** + * Whether or not the deployment has a table locked + */ + table_locked: boolean; + /** + * The name of he table that is locked by the deployment + */ + locked_table_name: string; + /** + * Whether or not the deployment is an instant DDL deployment + */ + instant_ddl: boolean; + /** + * Whether or not the deployment is eligible for instant DDL + */ + instant_ddl_eligible: boolean; + }; + /** + * The number of comments on the deploy request + */ + num_comments: number; + /** + * The PlanetScale app address for the deploy request + */ + html_url: string; + /** + * Notes on the deploy request + */ + notes: string; + /** + * The HTML body of the deploy request + */ + html_body: string; + /** + * When the deploy request was created + */ + created_at: string; + /** + * When the deploy request was last updated + */ + updated_at: string; + /** + * When the deploy request was closed + */ + closed_at: string; + /** + * When the deploy request was deployed + */ + deployed_at: string; + }>; +}; + +export type DatabaseDeployRequest = { + /** + * The ID of the deploy request + */ + id: string; + /** + * The number of the deploy request + */ + number: number; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + closed_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * The name of the branch the deploy request was created from + */ + branch: string; + /** + * The ID of the branch the deploy request was created from + */ + branch_id: string; + /** + * Whether or not the deploy request branch was deleted + */ + branch_deleted: boolean; + branch_deleted_by: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the deploy request branch was deleted + */ + branch_deleted_at: string; + /** + * The name of the branch the deploy request will be merged into + */ + into_branch: string; + /** + * Whether or not the branch the deploy request will be merged into is sharded + */ + into_branch_sharded: boolean; + /** + * The number of shards the branch the deploy request will be merged into has + */ + into_branch_shard_count: number; + /** + * Whether or not the deploy request is approved + */ + approved: boolean; + /** + * Whether the deploy request is open or closed + */ + state: "open" | "closed"; + /** + * The deployment state of the deploy request + */ + deployment_state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + deployment: { + /** + * The ID of the deployment + */ + id: string; + /** + * Whether or not to automatically cutover once deployment is finished + */ + auto_cutover: boolean; + /** + * Whether or not to automatically delete the head branch once deployment is finished + */ + auto_delete_branch: boolean; + /** + * When the deployment was created + */ + created_at: string; + /** + * When the cutover for the deployment was initiated + */ + cutover_at: string; + /** + * Whether or not the deployment cutover will expire soon + */ + cutover_expiring: boolean; + /** + * Deploy check errors for the deployment + */ + deploy_check_errors: string; + /** + * When the deployment was finished + */ + finished_at: string; + /** + * When the deployment was queued + */ + queued_at: string; + /** + * When the deployment was ready for cutover + */ + ready_to_cutover_at: string; + /** + * When the deployment was started + */ + started_at: string; + /** + * The state the deployment is in + */ + state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + /** + * When the deployment was submitted + */ + submitted_at: string; + /** + * When the deployment was last updated + */ + updated_at: string; + /** + * The name of the base branch the deployment will be merged into + */ + into_branch: string; + /** + * The number of the deploy request associated with this deployment + */ + deploy_request_number: number; + /** + * Whether the deployment is deployable + */ + deployable: boolean; + /** + * The deployments ahead of this one in the queue + */ + preceding_deployments: Array<{ + [key: string]: unknown; + }>; + deploy_operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The keyspace modified by the deploy operation + */ + keyspace_name: string; + /** + * The name of the table modifed by the deploy operation + */ + table_name: string; + /** + * The operation name of the deploy operation + */ + operation_name: string; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * A link to documentation explaining the deploy error, if present + */ + deploy_error_docs_url: string; + /** + * The DDL statement for the deploy operation + */ + ddl_statement: string; + /** + * A syntax-highlighted DDL statement for the deploy operation + */ + syntax_highlighted_ddl: string; + /** + * When the deploy operation was created + */ + created_at: string; + /** + * When the deploy operation was last updated + */ + updated_at: string; + /** + * When the deploy operation was last throttled + */ + throttled_at: string; + /** + * Whether or not the deploy operation is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation is currently locked + */ + table_locked: boolean; + /** + * Whether or not the table modified by the deploy operation was recently used + */ + table_recently_used: boolean; + /** + * When the table modified by the deploy operation was last used + */ + table_recently_used_at: string; + /** + * Names of foreign keys removed by this operation + */ + removed_foreign_key_names: Array; + /** + * Deploy errors for the deploy operation + */ + deploy_errors: string; + }>; + deploy_operation_summaries: Array<{ + /** + * The ID for the deploy operation summary + */ + id: string; + /** + * When the deploy operation summary was created + */ + created_at: string; + /** + * Deploy errors for the deploy operation summary + */ + deploy_errors: string; + /** + * The DDL statement for the deploy operation summary + */ + ddl_statement: string; + /** + * The estimated seconds until completion for the deploy operation summary + */ + eta_seconds: number; + /** + * The keyspace modified by the deploy operation summary + */ + keyspace_name: string; + /** + * The operation name of the deploy operation summary + */ + operation_name: string; + /** + * The percent completion for the deploy operation summary + */ + progress_percentage: number; + /** + * The state of the deploy operation summary + */ + state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; + /** + * A syntax-highlighted DDL statement for the deploy operation summary + */ + syntax_highlighted_ddl: string; + /** + * The name of the table modifed by the deploy operation summary + */ + table_name: string; + /** + * When the table modified by the deploy operation summary was last used + */ + table_recently_used_at: string; + /** + * When the deploy operation summary was last throttled + */ + throttled_at: string; + /** + * Names of foreign keys removed by this operation summary + */ + removed_foreign_key_names: Array; + /** + * The number of shards in the keyspace modified by the deploy operation summary + */ + shard_count: number; + /** + * Names of shards in the keyspace modified by the deploy operation summary + */ + shard_names: Array; + /** + * Whether or not the deploy operation summary is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation summary was recently used + */ + table_recently_used: boolean; + /** + * Whether or not the keyspace modified by the deploy operation summary is sharded + */ + sharded: boolean; + operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The shard the deploy operation is being performed on + */ + shard: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + }>; + }>; + /** + * Schema lint errors preventing the deployment from completing + */ + lint_errors: Array<{ + [key: string]: unknown; + }>; + /** + * The schema dependencies that must be satisfied + */ + sequential_diff_dependencies: Array<{ + [key: string]: unknown; + }>; + /** + * Lookup Vitess index operations + */ + lookup_vindex_operations: Array<{ + [key: string]: unknown; + }>; + /** + * Deployment throttling configurations + */ + throttler_configurations: Array<{ + [key: string]: unknown; + }>; + /** + * The request to revert the schema operations in this deployment + */ + deployment_revert_request: { + [key: string]: unknown; + }; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cancelled_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the schema was last updated for the deployment + */ + schema_last_updated_at: string; + /** + * Whether or not the deployment has a table locked + */ + table_locked: boolean; + /** + * The name of he table that is locked by the deployment + */ + locked_table_name: string; + /** + * Whether or not the deployment is an instant DDL deployment + */ + instant_ddl: boolean; + /** + * Whether or not the deployment is eligible for instant DDL + */ + instant_ddl_eligible: boolean; + }; + /** + * The number of comments on the deploy request + */ + num_comments: number; + /** + * The PlanetScale app address for the deploy request + */ + html_url: string; + /** + * Notes on the deploy request + */ + notes: string; + /** + * The HTML body of the deploy request + */ + html_body: string; + /** + * When the deploy request was created + */ + created_at: string; + /** + * When the deploy request was last updated + */ + updated_at: string; + /** + * When the deploy request was closed + */ + closed_at: string; + /** + * When the deploy request was deployed + */ + deployed_at: string; +}; + +export type Deployment = { + /** + * The ID of the deployment + */ + id: string; + /** + * Whether or not to automatically cutover once deployment is finished + */ + auto_cutover: boolean; + /** + * Whether or not to automatically delete the head branch once deployment is finished + */ + auto_delete_branch: boolean; + /** + * When the deployment was created + */ + created_at: string; + /** + * When the cutover for the deployment was initiated + */ + cutover_at: string; + /** + * Whether or not the deployment cutover will expire soon + */ + cutover_expiring: boolean; + /** + * Deploy check errors for the deployment + */ + deploy_check_errors: string; + /** + * When the deployment was finished + */ + finished_at: string; + /** + * When the deployment was queued + */ + queued_at: string; + /** + * When the deployment was ready for cutover + */ + ready_to_cutover_at: string; + /** + * When the deployment was started + */ + started_at: string; + /** + * The state the deployment is in + */ + state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + /** + * When the deployment was submitted + */ + submitted_at: string; + /** + * When the deployment was last updated + */ + updated_at: string; + /** + * The name of the base branch the deployment will be merged into + */ + into_branch: string; + /** + * The number of the deploy request associated with this deployment + */ + deploy_request_number: number; + /** + * Whether the deployment is deployable + */ + deployable: boolean; + /** + * The deployments ahead of this one in the queue + */ + preceding_deployments: Array<{ + [key: string]: unknown; + }>; + deploy_operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The keyspace modified by the deploy operation + */ + keyspace_name: string; + /** + * The name of the table modifed by the deploy operation + */ + table_name: string; + /** + * The operation name of the deploy operation + */ + operation_name: string; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * A link to documentation explaining the deploy error, if present + */ + deploy_error_docs_url: string; + /** + * The DDL statement for the deploy operation + */ + ddl_statement: string; + /** + * A syntax-highlighted DDL statement for the deploy operation + */ + syntax_highlighted_ddl: string; + /** + * When the deploy operation was created + */ + created_at: string; + /** + * When the deploy operation was last updated + */ + updated_at: string; + /** + * When the deploy operation was last throttled + */ + throttled_at: string; + /** + * Whether or not the deploy operation is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation is currently locked + */ + table_locked: boolean; + /** + * Whether or not the table modified by the deploy operation was recently used + */ + table_recently_used: boolean; + /** + * When the table modified by the deploy operation was last used + */ + table_recently_used_at: string; + /** + * Names of foreign keys removed by this operation + */ + removed_foreign_key_names: Array; + /** + * Deploy errors for the deploy operation + */ + deploy_errors: string; + }>; + deploy_operation_summaries: Array<{ + /** + * The ID for the deploy operation summary + */ + id: string; + /** + * When the deploy operation summary was created + */ + created_at: string; + /** + * Deploy errors for the deploy operation summary + */ + deploy_errors: string; + /** + * The DDL statement for the deploy operation summary + */ + ddl_statement: string; + /** + * The estimated seconds until completion for the deploy operation summary + */ + eta_seconds: number; + /** + * The keyspace modified by the deploy operation summary + */ + keyspace_name: string; + /** + * The operation name of the deploy operation summary + */ + operation_name: string; + /** + * The percent completion for the deploy operation summary + */ + progress_percentage: number; + /** + * The state of the deploy operation summary + */ + state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; + /** + * A syntax-highlighted DDL statement for the deploy operation summary + */ + syntax_highlighted_ddl: string; + /** + * The name of the table modifed by the deploy operation summary + */ + table_name: string; + /** + * When the table modified by the deploy operation summary was last used + */ + table_recently_used_at: string; + /** + * When the deploy operation summary was last throttled + */ + throttled_at: string; + /** + * Names of foreign keys removed by this operation summary + */ + removed_foreign_key_names: Array; + /** + * The number of shards in the keyspace modified by the deploy operation summary + */ + shard_count: number; + /** + * Names of shards in the keyspace modified by the deploy operation summary + */ + shard_names: Array; + /** + * Whether or not the deploy operation summary is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation summary was recently used + */ + table_recently_used: boolean; + /** + * Whether or not the keyspace modified by the deploy operation summary is sharded + */ + sharded: boolean; + operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The shard the deploy operation is being performed on + */ + shard: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + }>; + }>; + /** + * Schema lint errors preventing the deployment from completing + */ + lint_errors: Array<{ + [key: string]: unknown; + }>; + /** + * The schema dependencies that must be satisfied + */ + sequential_diff_dependencies: Array<{ + [key: string]: unknown; + }>; + /** + * Lookup Vitess index operations + */ + lookup_vindex_operations: Array<{ + [key: string]: unknown; + }>; + /** + * Deployment throttling configurations + */ + throttler_configurations: Array<{ + [key: string]: unknown; + }>; + /** + * The request to revert the schema operations in this deployment + */ + deployment_revert_request: { + [key: string]: unknown; + }; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cancelled_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the schema was last updated for the deployment + */ + schema_last_updated_at: string; + /** + * Whether or not the deployment has a table locked + */ + table_locked: boolean; + /** + * The name of he table that is locked by the deployment + */ + locked_table_name: string; + /** + * Whether or not the deployment is an instant DDL deployment + */ + instant_ddl: boolean; + /** + * Whether or not the deployment is eligible for instant DDL + */ + instant_ddl_eligible: boolean; +}; + +export type PaginatedDeployOperation = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The keyspace modified by the deploy operation + */ + keyspace_name: string; + /** + * The name of the table modifed by the deploy operation + */ + table_name: string; + /** + * The operation name of the deploy operation + */ + operation_name: string; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * A link to documentation explaining the deploy error, if present + */ + deploy_error_docs_url: string; + /** + * The DDL statement for the deploy operation + */ + ddl_statement: string; + /** + * A syntax-highlighted DDL statement for the deploy operation + */ + syntax_highlighted_ddl: string; + /** + * When the deploy operation was created + */ + created_at: string; + /** + * When the deploy operation was last updated + */ + updated_at: string; + /** + * When the deploy operation was last throttled + */ + throttled_at: string; + /** + * Whether or not the deploy operation is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation is currently locked + */ + table_locked: boolean; + /** + * Whether or not the table modified by the deploy operation was recently used + */ + table_recently_used: boolean; + /** + * When the table modified by the deploy operation was last used + */ + table_recently_used_at: string; + /** + * Names of foreign keys removed by this operation + */ + removed_foreign_key_names: Array; + /** + * Deploy errors for the deploy operation + */ + deploy_errors: string; + }>; +}; + +export type PaginatedDeployment = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the deployment + */ + id: string; + /** + * Whether or not to automatically cutover once deployment is finished + */ + auto_cutover: boolean; + /** + * Whether or not to automatically delete the head branch once deployment is finished + */ + auto_delete_branch: boolean; + /** + * When the deployment was created + */ + created_at: string; + /** + * When the cutover for the deployment was initiated + */ + cutover_at: string; + /** + * Whether or not the deployment cutover will expire soon + */ + cutover_expiring: boolean; + /** + * Deploy check errors for the deployment + */ + deploy_check_errors: string; + /** + * When the deployment was finished + */ + finished_at: string; + /** + * When the deployment was queued + */ + queued_at: string; + /** + * When the deployment was ready for cutover + */ + ready_to_cutover_at: string; + /** + * When the deployment was started + */ + started_at: string; + /** + * The state the deployment is in + */ + state: + | "pending" + | "ready" + | "no_changes" + | "queued" + | "submitting" + | "in_progress" + | "pending_cutover" + | "in_progress_vschema" + | "in_progress_cancel" + | "in_progress_cutover" + | "complete" + | "complete_cancel" + | "complete_error" + | "complete_pending_revert" + | "in_progress_revert" + | "in_progress_revert_vschema" + | "complete_revert" + | "complete_revert_error" + | "cancelled" + | "error"; + /** + * When the deployment was submitted + */ + submitted_at: string; + /** + * When the deployment was last updated + */ + updated_at: string; + /** + * The name of the base branch the deployment will be merged into + */ + into_branch: string; + /** + * The number of the deploy request associated with this deployment + */ + deploy_request_number: number; + /** + * Whether the deployment is deployable + */ + deployable: boolean; + /** + * The deployments ahead of this one in the queue + */ + preceding_deployments: Array<{ + [key: string]: unknown; + }>; + deploy_operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The keyspace modified by the deploy operation + */ + keyspace_name: string; + /** + * The name of the table modifed by the deploy operation + */ + table_name: string; + /** + * The operation name of the deploy operation + */ + operation_name: string; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * A link to documentation explaining the deploy error, if present + */ + deploy_error_docs_url: string; + /** + * The DDL statement for the deploy operation + */ + ddl_statement: string; + /** + * A syntax-highlighted DDL statement for the deploy operation + */ + syntax_highlighted_ddl: string; + /** + * When the deploy operation was created + */ + created_at: string; + /** + * When the deploy operation was last updated + */ + updated_at: string; + /** + * When the deploy operation was last throttled + */ + throttled_at: string; + /** + * Whether or not the deploy operation is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation is currently locked + */ + table_locked: boolean; + /** + * Whether or not the table modified by the deploy operation was recently used + */ + table_recently_used: boolean; + /** + * When the table modified by the deploy operation was last used + */ + table_recently_used_at: string; + /** + * Names of foreign keys removed by this operation + */ + removed_foreign_key_names: Array; + /** + * Deploy errors for the deploy operation + */ + deploy_errors: string; + }>; + deploy_operation_summaries: Array<{ + /** + * The ID for the deploy operation summary + */ + id: string; + /** + * When the deploy operation summary was created + */ + created_at: string; + /** + * Deploy errors for the deploy operation summary + */ + deploy_errors: string; + /** + * The DDL statement for the deploy operation summary + */ + ddl_statement: string; + /** + * The estimated seconds until completion for the deploy operation summary + */ + eta_seconds: number; + /** + * The keyspace modified by the deploy operation summary + */ + keyspace_name: string; + /** + * The operation name of the deploy operation summary + */ + operation_name: string; + /** + * The percent completion for the deploy operation summary + */ + progress_percentage: number; + /** + * The state of the deploy operation summary + */ + state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; + /** + * A syntax-highlighted DDL statement for the deploy operation summary + */ + syntax_highlighted_ddl: string; + /** + * The name of the table modifed by the deploy operation summary + */ + table_name: string; + /** + * When the table modified by the deploy operation summary was last used + */ + table_recently_used_at: string; + /** + * When the deploy operation summary was last throttled + */ + throttled_at: string; + /** + * Names of foreign keys removed by this operation summary + */ + removed_foreign_key_names: Array; + /** + * The number of shards in the keyspace modified by the deploy operation summary + */ + shard_count: number; + /** + * Names of shards in the keyspace modified by the deploy operation summary + */ + shard_names: Array; + /** + * Whether or not the deploy operation summary is capable of dropping data + */ + can_drop_data: boolean; + /** + * Whether or not the table modified by the deploy operation summary was recently used + */ + table_recently_used: boolean; + /** + * Whether or not the keyspace modified by the deploy operation summary is sharded + */ + sharded: boolean; + operations: Array<{ + /** + * The ID for the deploy operation + */ + id: string; + /** + * The shard the deploy operation is being performed on + */ + shard: string; + /** + * The state of the deploy operation + */ + state: + | "pending" + | "queued" + | "in_progress" + | "complete" + | "cancelled" + | "error"; + /** + * The percent completion for the deploy operation + */ + progress_percentage: number; + /** + * The estimated seconds until completion for the deploy operation + */ + eta_seconds: number; + }>; + }>; + /** + * Schema lint errors preventing the deployment from completing + */ + lint_errors: Array<{ + [key: string]: unknown; + }>; + /** + * The schema dependencies that must be satisfied + */ + sequential_diff_dependencies: Array<{ + [key: string]: unknown; + }>; + /** + * Lookup Vitess index operations + */ + lookup_vindex_operations: Array<{ + [key: string]: unknown; + }>; + /** + * Deployment throttling configurations + */ + throttler_configurations: Array<{ + [key: string]: unknown; + }>; + /** + * The request to revert the schema operations in this deployment + */ + deployment_revert_request: { + [key: string]: unknown; + }; + actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cutover_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + cancelled_actor: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + /** + * When the schema was last updated for the deployment + */ + schema_last_updated_at: string; + /** + * Whether or not the deployment has a table locked + */ + table_locked: boolean; + /** + * The name of he table that is locked by the deployment + */ + locked_table_name: string; + /** + * Whether or not the deployment is an instant DDL deployment + */ + instant_ddl: boolean; + /** + * Whether or not the deployment is eligible for instant DDL + */ + instant_ddl_eligible: boolean; + }>; +}; + +export type PaginatedDatabaseWebhook = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the webhook + */ + id: string; + /** + * The URL the webhook will send events to + */ + url: string; + /** + * The secret used to sign the webhook payloads + */ + secret: string; + /** + * Whether the webhook is enabled + */ + enabled: boolean; + /** + * The last result sent by the webhook + */ + last_sent_result: string; + /** + * Whether the last sent was successful + */ + last_sent_success: boolean; + /** + * When the last event was sent + */ + last_sent_at: string; + /** + * When the webhook was created + */ + created_at: string; + /** + * When the webhook was updated + */ + updated_at: string; + /** + * The events this webhook subscribes to + */ + events: Array< + | "branch.ready" + | "branch.anomaly" + | "branch.primary_promoted" + | "branch.schema_recommendation" + | "branch.sleeping" + | "branch.start_maintenance" + | "cluster.storage" + | "database.access_request" + | "deploy_request.closed" + | "deploy_request.errored" + | "deploy_request.in_progress" + | "deploy_request.opened" + | "deploy_request.pending_cutover" + | "deploy_request.queued" + | "deploy_request.reverted" + | "deploy_request.schema_applied" + | "keyspace.storage" + | "webhook.test" + >; + }>; +}; + +export type DatabaseWebhook = { + /** + * The ID of the webhook + */ + id: string; + /** + * The URL the webhook will send events to + */ + url: string; + /** + * The secret used to sign the webhook payloads + */ + secret: string; + /** + * Whether the webhook is enabled + */ + enabled: boolean; + /** + * The last result sent by the webhook + */ + last_sent_result: string; + /** + * Whether the last sent was successful + */ + last_sent_success: boolean; + /** + * When the last event was sent + */ + last_sent_at: string; + /** + * When the webhook was created + */ + created_at: string; + /** + * When the webhook was updated + */ + updated_at: string; + /** + * The events this webhook subscribes to + */ + events: Array< + | "branch.ready" + | "branch.anomaly" + | "branch.primary_promoted" + | "branch.schema_recommendation" + | "branch.sleeping" + | "branch.start_maintenance" + | "cluster.storage" + | "database.access_request" + | "deploy_request.closed" + | "deploy_request.errored" + | "deploy_request.in_progress" + | "deploy_request.opened" + | "deploy_request.pending_cutover" + | "deploy_request.queued" + | "deploy_request.reverted" + | "deploy_request.schema_applied" + | "keyspace.storage" + | "webhook.test" + >; +}; + +export type PaginatedLineItem = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID for the line item + */ + id: string; + /** + * The total for the line item + */ + subtotal: number; + /** + * The description for the line item + */ + description: string; + /** + * The name of the billable item + */ + metric_name: string; + /** + * The ID for the billed database + */ + database_id: string; + /** + * The name for the billed database + */ + database_name: string; + resource: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; + }>; +}; + +export type PaginatedInvoice = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the invoice + */ + id: string; + /** + * The total amount of the invoice + */ + total: number; + /** + * Start of the billing period + */ + billing_period_start: string; + /** + * End of the billing period + */ + billing_period_end: string; + }>; +}; + +export type Invoice = { + /** + * The ID of the invoice + */ + id: string; + /** + * The total amount of the invoice + */ + total: number; + /** + * Start of the billing period + */ + billing_period_start: string; + /** + * End of the billing period + */ + billing_period_end: string; +}; + +export type PaginatedOrganizationTeam = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array<{ + /** + * The ID of the team + */ + id: string; + /** + * The display name of the team + */ + display_name: string; + creator: { + /** + * The ID of the actor */ - keyspace_name: string; + id: string; /** - * The name of the table modifed by the deploy operation + * The name of the actor */ - table_name: string; + display_name: string; /** - * The operation name of the deploy operation + * The URL of the actor's avatar */ - operation_name: string; + avatar_url: string; + }; + members: Array<{ /** - * The estimated seconds until completion for the deploy operation + * The ID of the user */ - eta_seconds: number; + id: string; /** - * The percent completion for the deploy operation + * The display name of the user */ - progress_percentage: number; + display_name: string; /** - * A link to documentation explaining the deploy error, if present + * The name of the user */ - deploy_error_docs_url: string; + name: string; /** - * The DDL statement for the deploy operation + * The email of the user */ - ddl_statement: string; + email: string; /** - * A syntax-highlighted DDL statement for the deploy operation + * The URL source of the user's avatar */ - syntax_highlighted_ddl: string; + avatar_url: string; /** - * When the deploy operation was created + * When the user was created */ created_at: string; /** - * When the deploy operation was last updated + * When the user was last updated */ updated_at: string; /** - * When the deploy operation was last throttled - */ - throttled_at: string; - /** - * Whether or not the deploy operation is capable of dropping data - */ - can_drop_data: boolean; - /** - * Whether or not the table modified by the deploy operation is currently locked + * Whether or not the user has configured two factor authentication */ - table_locked: boolean; + two_factor_auth_configured: boolean; + default_organization: { + /** + * The ID for the resource + */ + id: string; + /** + * The name for the resource + */ + name: string; + /** + * When the resource was created + */ + created_at: string; + /** + * When the resource was last updated + */ + updated_at: string; + /** + * When the resource was deleted, if deleted + */ + deleted_at: string; + }; /** - * Whether or not the table modified by the deploy operation was recently used + * Whether or not the user is managed by SSO */ - table_recently_used: boolean; + sso: boolean; /** - * When the table modified by the deploy operation was last used + * Whether or not the user is managed by an authentication provider */ - table_recently_used_at: string; + managed: boolean; /** - * Names of foreign keys removed by this operation + * Whether or not the user is managed by a SSO directory */ - removed_foreign_key_names: Array; + directory_managed: boolean; /** - * Deploy errors for the deploy operation + * Whether or not the user is verified by email */ - deploy_errors: string; + email_verified: boolean; }>; - deploy_operation_summaries: Array<{ + databases: Array<{ /** - * The ID for the deploy operation summary + * The ID of the database */ id: string; /** - * When the deploy operation summary was created - */ - created_at: string; - /** - * Deploy errors for the deploy operation summary - */ - deploy_errors: string; - /** - * The DDL statement for the deploy operation summary - */ - ddl_statement: string; - /** - * The estimated seconds until completion for the deploy operation summary - */ - eta_seconds: number; - /** - * The keyspace modified by the deploy operation summary - */ - keyspace_name: string; - /** - * The operation name of the deploy operation summary - */ - operation_name: string; - /** - * The percent completion for the deploy operation summary - */ - progress_percentage: number; - /** - * The state of the deploy operation summary - */ - state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; - /** - * A syntax-highlighted DDL statement for the deploy operation summary - */ - syntax_highlighted_ddl: string; - /** - * The name of the table modifed by the deploy operation summary - */ - table_name: string; - /** - * When the table modified by the deploy operation summary was last used + * The name of the database */ - table_recently_used_at: string; + name: string; /** - * When the deploy operation summary was last throttled + * The URL to the database API endpoint */ - throttled_at: string; + url: string; /** - * Names of foreign keys removed by this operation summary + * The URL to retrieve this database's branches via the API */ - removed_foreign_key_names: Array; + branches_url: string; + }>; + /** + * The name of the team + */ + name: string; + /** + * The slug of the team + */ + slug: string; + /** + * When the team was created + */ + created_at: string; + /** + * When the team was last updated + */ + updated_at: string; + /** + * The description of the team + */ + description: string; + /** + * Whether the team is managed through SSO/directory services + */ + managed: boolean; + }>; +}; + +export type OrganizationTeam = { + /** + * The ID of the team + */ + id: string; + /** + * The display name of the team + */ + display_name: string; + creator: { + /** + * The ID of the actor + */ + id: string; + /** + * The name of the actor + */ + display_name: string; + /** + * The URL of the actor's avatar + */ + avatar_url: string; + }; + members: Array<{ + /** + * The ID of the user + */ + id: string; + /** + * The display name of the user + */ + display_name: string; + /** + * The name of the user + */ + name: string; + /** + * The email of the user + */ + email: string; + /** + * The URL source of the user's avatar + */ + avatar_url: string; + /** + * When the user was created + */ + created_at: string; + /** + * When the user was last updated + */ + updated_at: string; + /** + * Whether or not the user has configured two factor authentication + */ + two_factor_auth_configured: boolean; + default_organization: { /** - * The number of shards in the keyspace modified by the deploy operation summary + * The ID for the resource */ - shard_count: number; + id: string; /** - * Names of shards in the keyspace modified by the deploy operation summary + * The name for the resource */ - shard_names: Array; + name: string; /** - * Whether or not the deploy operation summary is capable of dropping data + * When the resource was created */ - can_drop_data: boolean; + created_at: string; /** - * Whether or not the table modified by the deploy operation summary was recently used + * When the resource was last updated */ - table_recently_used: boolean; + updated_at: string; /** - * Whether or not the keyspace modified by the deploy operation summary is sharded + * When the resource was deleted, if deleted */ - sharded: boolean; - operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The shard the deploy operation is being performed on - */ - shard: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - }>; - }>; + deleted_at: string; + }; /** - * Schema lint errors preventing the deployment from completing + * Whether or not the user is managed by SSO + */ + sso: boolean; + /** + * Whether or not the user is managed by an authentication provider + */ + managed: boolean; + /** + * Whether or not the user is managed by a SSO directory + */ + directory_managed: boolean; + /** + * Whether or not the user is verified by email + */ + email_verified: boolean; + }>; + databases: Array<{ + /** + * The ID of the database + */ + id: string; + /** + * The name of the database + */ + name: string; + /** + * The URL to the database API endpoint + */ + url: string; + /** + * The URL to retrieve this database's branches via the API + */ + branches_url: string; + }>; + /** + * The name of the team + */ + name: string; + /** + * The slug of the team + */ + slug: string; + /** + * When the team was created + */ + created_at: string; + /** + * When the team was last updated + */ + updated_at: string; + /** + * The description of the team + */ + description: string; + /** + * Whether the team is managed through SSO/directory services + */ + managed: boolean; +}; + +export type KeyspaceResizeRequest = { + id: string; + type: "KeyspaceResizeRequest"; + state: "resizing" | "completed"; + started_at: string; + completed_at: string; + created_at: string; + updated_at: string; + extra_replicas?: number; + vector_pool_allocation?: string; + previous_vector_pool_allocation?: string; + cluster_name?: string; + cluster_display_name?: string; + previous_cluster_name?: string; + previous_cluster_display_name?: string; + replicas?: number; + previous_replicas?: number; + cluster_rank?: number; + previous_cluster_rank?: number; + actor?: { + [key: string]: unknown; + }; + cluster_rate_name?: string; + cluster_rate_display_name?: string; + previous_cluster_rate_name?: string; + previous_cluster_rate_display_name?: string; +}; + +export type PaginatedKeyspaceResizeRequest = { + /** + * The current page number + */ + current_page: number; + /** + * The next page number + */ + next_page: number; + /** + * The next page of results + */ + next_page_url: string; + /** + * The previous page number + */ + prev_page: number; + /** + * The previous page of results + */ + prev_page_url: string; + data: Array; +}; + +export type GeneralError = { + code?: string; + message?: string; +}; + +export type ListOrganizationsData = { + body?: never; + path?: never; + query?: { + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations"; +}; + +export type ListOrganizationsErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListOrganizationsError = + ListOrganizationsErrors[keyof ListOrganizationsErrors]; + +export type ListOrganizationsResponses = { + /** + * Gets the organizations for the current user + */ + 200: PaginatedOrganization; +}; + +export type ListOrganizationsResponse = + ListOrganizationsResponses[keyof ListOrganizationsResponses]; + +export type GetOrganizationData = { + body?: never; + path: { + /** + * The name of the organization + */ + organization: string; + }; + query?: never; + url: "/organizations/{organization}"; +}; + +export type GetOrganizationErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type GetOrganizationError = + GetOrganizationErrors[keyof GetOrganizationErrors]; + +export type GetOrganizationResponses = { + /** + * Returns an organization + */ + 200: Organization; +}; + +export type GetOrganizationResponse = + GetOrganizationResponses[keyof GetOrganizationResponses]; + +export type UpdateOrganizationData = { + body?: { + /** + * The billing email for the organization + */ + billing_email?: string; + /** + * Whether or not the IdP provider is be responsible for managing roles in PlanetScale + */ + idp_managed_roles?: boolean; + /** + * The expected monthly budget for the organization + */ + invoice_budget_amount?: number; + }; + path: { + /** + * The name of the organization */ - lint_errors: Array<{ - [key: string]: unknown; - }>; + organization: string; + }; + query?: never; + url: "/organizations/{organization}"; +}; + +export type UpdateOrganizationErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type UpdateOrganizationError = + UpdateOrganizationErrors[keyof UpdateOrganizationErrors]; + +export type UpdateOrganizationResponses = { + /** + * Returns the updated organization + */ + 200: Organization; +}; + +export type UpdateOrganizationResponse = + UpdateOrganizationResponses[keyof UpdateOrganizationResponses]; + +export type ListAuditLogsData = { + body?: never; + path: { /** - * The schema dependencies that must be satisfied + * The name of the organization */ - sequential_diff_dependencies: Array<{ - [key: string]: unknown; - }>; + organization: string; + }; + query?: never; + url: "/organizations/{organization}/audit-log"; +}; + +export type ListAuditLogsErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListAuditLogsError = ListAuditLogsErrors[keyof ListAuditLogsErrors]; + +export type ListAuditLogsResponses = { + /** + * Returns the audit log events + */ + 200: PaginatedAuditLogEvent; +}; + +export type ListAuditLogsResponse = + ListAuditLogsResponses[keyof ListAuditLogsResponses]; + +export type ListClusterSizeSkusData = { + body?: never; + path: { /** - * Lookup Vitess index operations + * The name of the organization */ - lookup_vindex_operations: Array<{ - [key: string]: unknown; - }>; + organization: string; + }; + query?: { /** - * Deployment throttling configurations + * The database engine to filter by. Defaults to 'mysql'. */ - throttler_configurations: Array<{ - [key: string]: unknown; - }>; + engine?: "mysql" | "postgresql"; /** - * The request to revert the schema operations in this deployment + * Whether to include pricing rates in the response. Defaults to false. */ - deployment_revert_request: { - [key: string]: unknown; - }; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cutover_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cancelled_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; + rates?: boolean; /** - * When the schema was last updated for the deployment + * The region slug to get rates for. If not specified, uses the organization's default region. */ - schema_last_updated_at: string; + region?: string; + }; + url: "/organizations/{organization}/cluster-size-skus"; +}; + +export type ListClusterSizeSkusErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListClusterSizeSkusError = + ListClusterSizeSkusErrors[keyof ListClusterSizeSkusErrors]; + +export type ListClusterSizeSkusResponses = { + /** + * Returns available cluster sizes with optional pricing rates + */ + 200: Array; +}; + +export type ListClusterSizeSkusResponse = + ListClusterSizeSkusResponses[keyof ListClusterSizeSkusResponses]; + +export type ListDatabasesData = { + body?: never; + path: { /** - * Whether or not the deployment has a table locked + * The name of the organization the database belongs to */ - table_locked: boolean; + organization: string; + }; + query?: { /** - * The name of he table that is locked by the deployment + * Search term to filter databases by name */ - locked_table_name: string; + q?: string; /** - * Whether or not the deployment is an instant DDL deployment + * If provided, specifies the page offset of returned results */ - instant_ddl: boolean; + page?: number; /** - * Whether or not the deployment is eligible for instant DDL + * If provided, specifies the number of returned results */ - instant_ddl_eligible: boolean; + per_page?: number; }; + url: "/organizations/{organization}/databases"; +}; + +export type ListDatabasesErrors = { /** - * The number of comments on the deploy request + * Unauthorized */ - num_comments: number; + 401: GeneralError; /** - * The PlanetScale app address for the deploy request + * Forbidden */ - html_url: string; + 403: GeneralError; /** - * Notes on the deploy request + * Not Found */ - notes: string; + 404: GeneralError; /** - * The HTML body of the deploy request + * Internal Server Error */ - html_body: string; + 500: GeneralError; +}; + +export type ListDatabasesError = ListDatabasesErrors[keyof ListDatabasesErrors]; + +export type ListDatabasesResponses = { + /** + * Retrieves the databases for an organization + */ + 200: PaginatedDatabase; +}; + +export type ListDatabasesResponse = + ListDatabasesResponses[keyof ListDatabasesResponses]; + +export type CreateDatabaseData = { + body?: { + /** + * Name of the database + */ + name: string; + /** + * The region the database will be deployed in. If left blank, defaults to the organization's default region. + */ + region?: string; + /** + * The database cluster size name (e.g., 'PS_10', 'PS_80'). Use the 'List available cluster sizes' endpoint to get available options for your organization. /v1/organizations/:organization/cluster-size-skus + */ + cluster_size: string; + /** + * The number of replicas for the database. 0 for non-HA, 2+ for HA. + */ + replicas?: number; + /** + * The kind of database to create. + */ + kind?: "mysql" | "postgresql"; + /** + * For PostgreSQL databases, the PostgreSQL major version to use for the database. Defaults to the latest available major version. + */ + major_version?: string; + }; + path: { + /** + * The name of the organization the database belongs to + */ + organization: string; + }; + query?: never; + url: "/organizations/{organization}/databases"; +}; + +export type CreateDatabaseErrors = { /** - * When the deploy request was created + * Unauthorized */ - created_at: string; + 401: GeneralError; /** - * When the deploy request was last updated + * Forbidden */ - updated_at: string; + 403: GeneralError; /** - * When the deploy request was closed + * Not Found */ - closed_at: string; + 404: GeneralError; /** - * When the deploy request was deployed + * Internal Server Error */ - deployed_at: string; + 500: GeneralError; }; -export type Deployment = { - /** - * The ID of the deployment - */ - id: string; - /** - * Whether or not to automatically cutover once deployment is finished - */ - auto_cutover: boolean; +export type CreateDatabaseError = + CreateDatabaseErrors[keyof CreateDatabaseErrors]; + +export type CreateDatabaseResponses = { /** - * Whether or not to automatically delete the head branch once deployment is finished + * Returns the created database */ - auto_delete_branch: boolean; + 201: Database; +}; + +export type CreateDatabaseResponse = + CreateDatabaseResponses[keyof CreateDatabaseResponses]; + +export type DeleteDatabaseData = { + body?: never; + path: { + /** + * The name of the organization the database belongs to + */ + organization: string; + /** + * The name of the database + */ + database: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}"; +}; + +export type DeleteDatabaseErrors = { /** - * When the deployment was created + * Unauthorized */ - created_at: string; + 401: GeneralError; /** - * When the cutover for the deployment was initiated + * Forbidden */ - cutover_at: string; + 403: GeneralError; /** - * Whether or not the deployment cutover will expire soon + * Not Found */ - cutover_expiring: boolean; + 404: GeneralError; /** - * Deploy check errors for the deployment + * Internal Server Error */ - deploy_check_errors: string; + 500: GeneralError; +}; + +export type DeleteDatabaseError = + DeleteDatabaseErrors[keyof DeleteDatabaseErrors]; + +export type DeleteDatabaseResponses = { /** - * When the deployment was finished + * Deletes a database */ - finished_at: string; + 204: unknown; +}; + +export type GetDatabaseData = { + body?: never; + path: { + /** + * The name of the organization the database belongs to + */ + organization: string; + /** + * The name of the database + */ + database: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}"; +}; + +export type GetDatabaseErrors = { /** - * When the deployment was queued + * Unauthorized */ - queued_at: string; + 401: GeneralError; /** - * When the deployment was ready for cutover + * Forbidden */ - ready_to_cutover_at: string; + 403: GeneralError; /** - * When the deployment was started + * Not Found */ - started_at: string; + 404: GeneralError; /** - * The state the deployment is in + * Internal Server Error */ - state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; + 500: GeneralError; +}; + +export type GetDatabaseError = GetDatabaseErrors[keyof GetDatabaseErrors]; + +export type GetDatabaseResponses = { /** - * When the deployment was submitted + * Returns a database */ - submitted_at: string; + 200: Database; +}; + +export type GetDatabaseResponse = + GetDatabaseResponses[keyof GetDatabaseResponses]; + +export type UpdateDatabaseSettingsData = { + body?: { + /** + * The name to update the database to + */ + new_name?: string; + /** + * Whether or not to copy migration data to new branches and in deploy requests. (Vitess only) + */ + automatic_migrations?: boolean; + /** + * A migration framework to use on the database. (Vitess only) + */ + migration_framework?: string; + /** + * Name of table to use as migration table for the database. (Vitess only) + */ + migration_table_name?: string; + /** + * Whether or not deploy requests must be approved by a database administrator other than the request creator + */ + require_approval_for_deploy?: boolean; + /** + * Whether or not to limit branch creation to the same region as the one selected during database creation. + */ + restrict_branch_region?: boolean; + /** + * Whether or not data branching is allowed on the database. (Vitess only) + */ + allow_data_branching?: boolean; + /** + * Whether or not foreign key constraints are allowed on the database. (Vitess only) + */ + allow_foreign_key_constraints?: boolean; + /** + * Whether or not full queries should be collected from the database + */ + insights_raw_queries?: boolean; + /** + * Whether or not the web console can be used on the production branch of the database + */ + production_branch_web_console?: boolean; + /** + * The default branch of the database + */ + default_branch?: string; + }; + path: { + /** + * The name of the organization the database belongs to + */ + organization: string; + /** + * The name of the database + */ + database: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}"; +}; + +export type UpdateDatabaseSettingsErrors = { /** - * When the deployment was last updated + * Unauthorized */ - updated_at: string; + 401: GeneralError; /** - * The name of the base branch the deployment will be merged into + * Forbidden */ - into_branch: string; + 403: GeneralError; /** - * The number of the deploy request associated with this deployment + * Not Found */ - deploy_request_number: number; + 404: GeneralError; /** - * Whether the deployment is deployable + * Internal Server Error */ - deployable: boolean; + 500: GeneralError; +}; + +export type UpdateDatabaseSettingsError = + UpdateDatabaseSettingsErrors[keyof UpdateDatabaseSettingsErrors]; + +export type UpdateDatabaseSettingsResponses = { /** - * The deployments ahead of this one in the queue + * Returns the updated database */ - preceding_deployments: Array<{ - [key: string]: unknown; - }>; - deploy_operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; + 200: Database; +}; + +export type UpdateDatabaseSettingsResponse = + UpdateDatabaseSettingsResponses[keyof UpdateDatabaseSettingsResponses]; + +export type ListBranchesData = { + body?: never; + path: { /** - * The keyspace modified by the deploy operation + * The name of the organization the branch belongs to */ - keyspace_name: string; + organization: string; /** - * The name of the table modifed by the deploy operation + * The name of the database the branch belongs to */ - table_name: string; + database: string; + }; + query?: { /** - * The operation name of the deploy operation + * Search branches by name */ - operation_name: string; + q?: string; /** - * The estimated seconds until completion for the deploy operation + * Filter branches by production status */ - eta_seconds: number; + production?: boolean; /** - * The percent completion for the deploy operation + * Filter branches by safe migrations (DDL protection) */ - progress_percentage: number; + safe_migrations?: boolean; /** - * A link to documentation explaining the deploy error, if present + * Order branches by created_at time */ - deploy_error_docs_url: string; + order?: "asc" | "desc"; /** - * The DDL statement for the deploy operation + * If provided, specifies the page offset of returned results */ - ddl_statement: string; + page?: number; /** - * A syntax-highlighted DDL statement for the deploy operation + * If provided, specifies the number of returned results */ - syntax_highlighted_ddl: string; + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches"; +}; + +export type ListBranchesErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListBranchesError = ListBranchesErrors[keyof ListBranchesErrors]; + +export type ListBranchesResponses = { + /** + * Returns database branches + */ + 200: PaginatedDatabaseBranch; +}; + +export type ListBranchesResponse = + ListBranchesResponses[keyof ListBranchesResponses]; + +export type CreateBranchData = { + body?: { /** - * When the deploy operation was created + * The name of the branch to create */ - created_at: string; + name: string; /** - * When the deploy operation was last updated + * Parent branch */ - updated_at: string; + parent_branch: string; /** - * When the deploy operation was last throttled + * If provided, restores the backup's schema and data to the new branch. Must have `restore_production_branch_backup(s)` or `restore_backup(s)` access to do this. */ - throttled_at: string; + backup_id?: string; /** - * Whether or not the deploy operation is capable of dropping data + * The region to create the branch in. If not provided, the branch will be created in the default region for its database. */ - can_drop_data: boolean; + region?: string; /** - * Whether or not the table modified by the deploy operation is currently locked + * Restore from a point-in-time recovery timestamp (e.g. 2023-01-01T00:00:00Z). Available only for PostgreSQL databases. */ - table_locked: boolean; + restore_point?: string; /** - * Whether or not the table modified by the deploy operation was recently used + * If provided, restores the last successful backup's schema and data to the new branch. Must have `restore_production_branch_backup(s)` or `restore_backup(s)` access to do this, in addition to Data Branching™ being enabled for the branch. */ - table_recently_used: boolean; + seed_data?: "last_successful_backup"; /** - * When the table modified by the deploy operation was last used + * The database cluster size is required if a backup_id is provided. Options: PS_10, PS_20, PS_40, ..., PS_2800 */ - table_recently_used_at: string; + cluster_size?: string; /** - * Names of foreign keys removed by this operation + * For PostgreSQL databases, the PostgreSQL major version to use for the branch. Defaults to the major version of the parent branch if it exists or the database's default branch major version. Ignored for branches restored from backups. */ - removed_foreign_key_names: Array; + major_version?: string; + }; + path: { /** - * Deploy errors for the deploy operation + * The name of the organization the branch belongs to */ - deploy_errors: string; - }>; - deploy_operation_summaries: Array<{ + organization: string; /** - * The ID for the deploy operation summary + * The name of the database the branch belongs to */ - id: string; + database: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches"; +}; + +export type CreateBranchErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type CreateBranchError = CreateBranchErrors[keyof CreateBranchErrors]; + +export type CreateBranchResponses = { + /** + * Returns the created branch + */ + 201: DatabaseBranch; +}; + +export type CreateBranchResponse = + CreateBranchResponses[keyof CreateBranchResponses]; + +export type DeleteBranchData = { + body?: never; + path: { /** - * When the deploy operation summary was created + * The name of the organization the branch belongs to */ - created_at: string; + organization: string; /** - * Deploy errors for the deploy operation summary + * The name of the database the branch belongs to */ - deploy_errors: string; + database: string; /** - * The DDL statement for the deploy operation summary + * The name of the branch */ - ddl_statement: string; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}"; +}; + +export type DeleteBranchErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type DeleteBranchError = DeleteBranchErrors[keyof DeleteBranchErrors]; + +export type DeleteBranchResponses = { + /** + * Delete a branch + */ + 204: unknown; +}; + +export type GetBranchData = { + body?: never; + path: { /** - * The estimated seconds until completion for the deploy operation summary + * The name of the organization the branch belongs to */ - eta_seconds: number; + organization: string; /** - * The keyspace modified by the deploy operation summary + * The name of the database the branch belongs to */ - keyspace_name: string; + database: string; /** - * The operation name of the deploy operation summary + * The name of the branch */ - operation_name: string; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}"; +}; + +export type GetBranchErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type GetBranchError = GetBranchErrors[keyof GetBranchErrors]; + +export type GetBranchResponses = { + /** + * Returns information about a branch + */ + 200: DatabaseBranch; +}; + +export type GetBranchResponse = GetBranchResponses[keyof GetBranchResponses]; + +export type ListBackupsData = { + body?: never; + path: { /** - * The percent completion for the deploy operation summary + * The name of the organization the branch belongs to */ - progress_percentage: number; + organization: string; /** - * The state of the deploy operation summary + * The name of the database the branch belongs to */ - state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; + database: string; /** - * A syntax-highlighted DDL statement for the deploy operation summary + * The name of the branch */ - syntax_highlighted_ddl: string; + branch: string; + }; + query?: { /** - * The name of the table modifed by the deploy operation summary + * Whether to include all backups, including deleted ones */ - table_name: string; + all?: boolean; /** - * When the table modified by the deploy operation summary was last used + * Filter backups by state */ - table_recently_used_at: string; + state?: + | "pending" + | "running" + | "success" + | "failed" + | "canceled" + | "ignored"; /** - * When the deploy operation summary was last throttled + * Filter backups by backup policy ID */ - throttled_at: string; + policy?: string; /** - * Names of foreign keys removed by this operation summary + * Filter backups started after this date (e.g. 2023-01-01T00:00:00Z) */ - removed_foreign_key_names: Array; + from?: string; /** - * The number of shards in the keyspace modified by the deploy operation summary + * Filter backups started before this date (e.g. 2023-01-31T23:59:59Z) */ - shard_count: number; + to?: string; /** - * Names of shards in the keyspace modified by the deploy operation summary + * Filter backups that are running during a specific time (e.g. 2023-01-01T00:00:00Z..2023-01-01T23:59:59Z) */ - shard_names: Array; + running_at?: string; /** - * Whether or not the deploy operation summary is capable of dropping data + * Filter backups by production branch */ - can_drop_data: boolean; + production?: boolean; /** - * Whether or not the table modified by the deploy operation summary was recently used + * If provided, specifies the page offset of returned results */ - table_recently_used: boolean; + page?: number; /** - * Whether or not the keyspace modified by the deploy operation summary is sharded + * If provided, specifies the number of returned results */ - sharded: boolean; - operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The shard the deploy operation is being performed on - */ - shard: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - }>; - }>; + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups"; +}; + +export type ListBackupsErrors = { /** - * Schema lint errors preventing the deployment from completing + * Unauthorized */ - lint_errors: Array<{ - [key: string]: unknown; - }>; + 401: GeneralError; /** - * The schema dependencies that must be satisfied + * Forbidden */ - sequential_diff_dependencies: Array<{ - [key: string]: unknown; - }>; + 403: GeneralError; /** - * Lookup Vitess index operations + * Not Found */ - lookup_vindex_operations: Array<{ - [key: string]: unknown; - }>; + 404: GeneralError; /** - * Deployment throttling configurations + * Internal Server Error */ - throttler_configurations: Array<{ - [key: string]: unknown; - }>; + 500: GeneralError; +}; + +export type ListBackupsError = ListBackupsErrors[keyof ListBackupsErrors]; + +export type ListBackupsResponses = { /** - * The request to revert the schema operations in this deployment + * Returns database branch backups */ - deployment_revert_request: { - [key: string]: unknown; - }; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; + 200: PaginatedBackup; +}; + +export type ListBackupsResponse = + ListBackupsResponses[keyof ListBackupsResponses]; + +export type CreateBackupData = { + body?: { /** - * The URL of the actor's avatar + * Name for the backup */ - avatar_url: string; - }; - cutover_actor: { + name?: string; /** - * The ID of the actor + * Unit for the retention period of the backup */ - id: string; + retention_unit?: "hour" | "day" | "week" | "month" | "year"; /** - * The name of the actor + * Value between `1` and `1000` for the retention period of the backup (i.e retention_value `6` and retention_unit `hour` means 6 hours) */ - display_name: string; + retention_value?: number; /** - * The URL of the actor's avatar + * Whether the backup is an immediate backup that may affect database performance. Emergency backups are only supported for PostgreSQL databases. */ - avatar_url: string; + emergency?: boolean; }; - cancelled_actor: { + path: { /** - * The ID of the actor + * The name of the organization the branch belongs to */ - id: string; + organization: string; /** - * The name of the actor + * The name of the database the branch belongs to */ - display_name: string; + database: string; /** - * The URL of the actor's avatar + * The name of the branch */ - avatar_url: string; + branch: string; }; - /** - * When the schema was last updated for the deployment - */ - schema_last_updated_at: string; - /** - * Whether or not the deployment has a table locked - */ - table_locked: boolean; - /** - * The name of he table that is locked by the deployment - */ - locked_table_name: string; - /** - * Whether or not the deployment is an instant DDL deployment - */ - instant_ddl: boolean; - /** - * Whether or not the deployment is eligible for instant DDL - */ - instant_ddl_eligible: boolean; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups"; }; -export type PaginatedDeployOperation = { +export type CreateBackupErrors = { /** - * The current page number + * Unauthorized */ - current_page: number; + 401: GeneralError; /** - * The next page number + * Forbidden */ - next_page: number; + 403: GeneralError; /** - * The next page of results + * Not Found */ - next_page_url: string; + 404: GeneralError; /** - * The previous page number + * Internal Server Error */ - prev_page: number; + 500: GeneralError; +}; + +export type CreateBackupError = CreateBackupErrors[keyof CreateBackupErrors]; + +export type CreateBackupResponses = { /** - * The previous page of results + * Returns the created database branch backup */ - prev_page_url: string; - data: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The keyspace modified by the deploy operation - */ - keyspace_name: string; - /** - * The name of the table modifed by the deploy operation - */ - table_name: string; - /** - * The operation name of the deploy operation - */ - operation_name: string; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; + 201: Backup; +}; + +export type CreateBackupResponse = + CreateBackupResponses[keyof CreateBackupResponses]; + +export type DeleteBackupData = { + body?: never; + path: { /** - * The percent completion for the deploy operation + * The ID of the backup */ - progress_percentage: number; + id: string; /** - * A link to documentation explaining the deploy error, if present + * The name of the organization the branch belongs to */ - deploy_error_docs_url: string; + organization: string; /** - * The DDL statement for the deploy operation + * The name of the database the branch belongs to */ - ddl_statement: string; + database: string; /** - * A syntax-highlighted DDL statement for the deploy operation + * The name of the branch */ - syntax_highlighted_ddl: string; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; +}; + +export type DeleteBackupErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type DeleteBackupError = DeleteBackupErrors[keyof DeleteBackupErrors]; + +export type DeleteBackupResponses = { + /** + * Delete a backup + */ + 204: unknown; +}; + +export type GetBackupData = { + body?: never; + path: { /** - * When the deploy operation was created + * The ID for the backup */ - created_at: string; + id: string; /** - * When the deploy operation was last updated + * The name of the organization the branch belongs to */ - updated_at: string; + organization: string; /** - * When the deploy operation was last throttled + * The name of the database the branch belongs to */ - throttled_at: string; + database: string; /** - * Whether or not the deploy operation is capable of dropping data + * The name of the branch */ - can_drop_data: boolean; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; +}; + +export type GetBackupErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type GetBackupError = GetBackupErrors[keyof GetBackupErrors]; + +export type GetBackupResponses = { + /** + * Returns a database branch backup + */ + 200: Backup; +}; + +export type GetBackupResponse = GetBackupResponses[keyof GetBackupResponses]; + +export type UpdateBackupData = { + body?: { /** - * Whether or not the table modified by the deploy operation is currently locked + * Whether the backup is protected from deletion or not */ - table_locked: boolean; + protected?: boolean; + }; + path: { /** - * Whether or not the table modified by the deploy operation was recently used + * The ID of the backup */ - table_recently_used: boolean; + id: string; /** - * When the table modified by the deploy operation was last used + * The name of the organization the branch belongs to */ - table_recently_used_at: string; + organization: string; /** - * Names of foreign keys removed by this operation + * The name of the database the branch belongs to */ - removed_foreign_key_names: Array; + database: string; /** - * Deploy errors for the deploy operation + * The name of the branch */ - deploy_errors: string; - }>; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; }; -export type PaginatedDeployment = { +export type UpdateBackupErrors = { /** - * The current page number + * Unauthorized */ - current_page: number; + 401: GeneralError; /** - * The next page number + * Forbidden */ - next_page: number; + 403: GeneralError; /** - * The next page of results + * Not Found */ - next_page_url: string; + 404: GeneralError; /** - * The previous page number + * Internal Server Error */ - prev_page: number; + 500: GeneralError; +}; + +export type UpdateBackupError = UpdateBackupErrors[keyof UpdateBackupErrors]; + +export type UpdateBackupResponses = { /** - * The previous page of results + * Returns the backup */ - prev_page_url: string; - data: Array<{ - /** - * The ID of the deployment - */ - id: string; + 200: Backup; +}; + +export type UpdateBackupResponse = + UpdateBackupResponses[keyof UpdateBackupResponses]; + +export type ListBranchBouncerResizeRequestsData = { + body?: never; + path: { /** - * Whether or not to automatically cutover once deployment is finished + * The name of the organization that owns this resource */ - auto_cutover: boolean; + organization: string; /** - * Whether or not to automatically delete the head branch once deployment is finished + * The name of the database that owns this resource */ - auto_delete_branch: boolean; + database: string; /** - * When the deployment was created + * The name of the branch that owns this resource */ - created_at: string; + branch: string; + }; + query?: { /** - * When the cutover for the deployment was initiated + * If provided, specifies the page offset of returned results */ - cutover_at: string; + page?: number; /** - * Whether or not the deployment cutover will expire soon + * If provided, specifies the number of returned results */ - cutover_expiring: boolean; + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncer-resizes"; +}; + +export type ListBranchBouncerResizeRequestsErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListBranchBouncerResizeRequestsError = + ListBranchBouncerResizeRequestsErrors[keyof ListBranchBouncerResizeRequestsErrors]; + +export type ListBranchBouncerResizeRequestsResponses = { + /** + * Returns bouncer resize requests + */ + 200: PaginatedPostgresBouncerResizeRequest; +}; + +export type ListBranchBouncerResizeRequestsResponse = + ListBranchBouncerResizeRequestsResponses[keyof ListBranchBouncerResizeRequestsResponses]; + +export type ListBouncersData = { + body?: never; + path: { /** - * Deploy check errors for the deployment + * The name of the organization that owns this resource */ - deploy_check_errors: string; + organization: string; /** - * When the deployment was finished + * The name of the database that owns this resource */ - finished_at: string; + database: string; /** - * When the deployment was queued + * The name of the branch that owns this resource */ - queued_at: string; + branch: string; + }; + query?: { /** - * When the deployment was ready for cutover + * If provided, specifies the page offset of returned results */ - ready_to_cutover_at: string; + page?: number; /** - * When the deployment was started + * If provided, specifies the number of returned results */ - started_at: string; + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers"; +}; + +export type ListBouncersErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListBouncersError = ListBouncersErrors[keyof ListBouncersErrors]; + +export type ListBouncersResponses = { + /** + * Returns bouncers + */ + 200: PaginatedPostgresBouncer; +}; + +export type ListBouncersResponse = + ListBouncersResponses[keyof ListBouncersResponses]; + +export type CreateBouncerData = { + body?: { /** - * The state the deployment is in + * The bouncer name */ - state: - | "pending" - | "ready" - | "no_changes" - | "queued" - | "submitting" - | "in_progress" - | "pending_cutover" - | "in_progress_vschema" - | "in_progress_cancel" - | "in_progress_cutover" - | "complete" - | "complete_cancel" - | "complete_error" - | "complete_pending_revert" - | "in_progress_revert" - | "in_progress_revert_vschema" - | "complete_revert" - | "complete_revert_error" - | "cancelled" - | "error"; + name?: string; /** - * When the deployment was submitted + * The type of server the bouncer targets */ - submitted_at: string; + target?: string; /** - * When the deployment was last updated + * The size SKU for the bouncer */ - updated_at: string; + bouncer_size?: string; /** - * The name of the base branch the deployment will be merged into + * The number of replica servers per cell */ - into_branch: string; + replicas_per_cell?: number; + }; + path: { /** - * The number of the deploy request associated with this deployment + * The name of the organization that owns this resource */ - deploy_request_number: number; + organization: string; /** - * Whether the deployment is deployable + * The name of the database that owns this resource */ - deployable: boolean; + database: string; /** - * The deployments ahead of this one in the queue + * The name of the branch that owns this resource */ - preceding_deployments: Array<{ - [key: string]: unknown; - }>; - deploy_operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The keyspace modified by the deploy operation - */ - keyspace_name: string; - /** - * The name of the table modifed by the deploy operation - */ - table_name: string; - /** - * The operation name of the deploy operation - */ - operation_name: string; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * A link to documentation explaining the deploy error, if present - */ - deploy_error_docs_url: string; - /** - * The DDL statement for the deploy operation - */ - ddl_statement: string; - /** - * A syntax-highlighted DDL statement for the deploy operation - */ - syntax_highlighted_ddl: string; - /** - * When the deploy operation was created - */ - created_at: string; - /** - * When the deploy operation was last updated - */ - updated_at: string; - /** - * When the deploy operation was last throttled - */ - throttled_at: string; - /** - * Whether or not the deploy operation is capable of dropping data - */ - can_drop_data: boolean; - /** - * Whether or not the table modified by the deploy operation is currently locked - */ - table_locked: boolean; - /** - * Whether or not the table modified by the deploy operation was recently used - */ - table_recently_used: boolean; - /** - * When the table modified by the deploy operation was last used - */ - table_recently_used_at: string; - /** - * Names of foreign keys removed by this operation - */ - removed_foreign_key_names: Array; - /** - * Deploy errors for the deploy operation - */ - deploy_errors: string; - }>; - deploy_operation_summaries: Array<{ - /** - * The ID for the deploy operation summary - */ - id: string; - /** - * When the deploy operation summary was created - */ - created_at: string; - /** - * Deploy errors for the deploy operation summary - */ - deploy_errors: string; - /** - * The DDL statement for the deploy operation summary - */ - ddl_statement: string; - /** - * The estimated seconds until completion for the deploy operation summary - */ - eta_seconds: number; - /** - * The keyspace modified by the deploy operation summary - */ - keyspace_name: string; - /** - * The operation name of the deploy operation summary - */ - operation_name: string; - /** - * The percent completion for the deploy operation summary - */ - progress_percentage: number; - /** - * The state of the deploy operation summary - */ - state: "pending" | "in_progress" | "complete" | "cancelled" | "error"; - /** - * A syntax-highlighted DDL statement for the deploy operation summary - */ - syntax_highlighted_ddl: string; - /** - * The name of the table modifed by the deploy operation summary - */ - table_name: string; - /** - * When the table modified by the deploy operation summary was last used - */ - table_recently_used_at: string; - /** - * When the deploy operation summary was last throttled - */ - throttled_at: string; - /** - * Names of foreign keys removed by this operation summary - */ - removed_foreign_key_names: Array; - /** - * The number of shards in the keyspace modified by the deploy operation summary - */ - shard_count: number; - /** - * Names of shards in the keyspace modified by the deploy operation summary - */ - shard_names: Array; - /** - * Whether or not the deploy operation summary is capable of dropping data - */ - can_drop_data: boolean; - /** - * Whether or not the table modified by the deploy operation summary was recently used - */ - table_recently_used: boolean; - /** - * Whether or not the keyspace modified by the deploy operation summary is sharded - */ - sharded: boolean; - operations: Array<{ - /** - * The ID for the deploy operation - */ - id: string; - /** - * The shard the deploy operation is being performed on - */ - shard: string; - /** - * The state of the deploy operation - */ - state: - | "pending" - | "queued" - | "in_progress" - | "complete" - | "cancelled" - | "error"; - /** - * The percent completion for the deploy operation - */ - progress_percentage: number; - /** - * The estimated seconds until completion for the deploy operation - */ - eta_seconds: number; - }>; - }>; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers"; +}; + +export type CreateBouncerErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type CreateBouncerError = CreateBouncerErrors[keyof CreateBouncerErrors]; + +export type CreateBouncerResponses = { + /** + * Returns the new bouncer + */ + 200: PostgresBouncer; +}; + +export type CreateBouncerResponse = + CreateBouncerResponses[keyof CreateBouncerResponses]; + +export type DeleteBouncerData = { + body?: never; + path: { /** - * Schema lint errors preventing the deployment from completing + * The name of the organization that owns this resource */ - lint_errors: Array<{ - [key: string]: unknown; - }>; + organization: string; /** - * The schema dependencies that must be satisfied + * The name of the database that owns this resource */ - sequential_diff_dependencies: Array<{ - [key: string]: unknown; - }>; + database: string; /** - * Lookup Vitess index operations + * The name of the branch that owns this resource */ - lookup_vindex_operations: Array<{ - [key: string]: unknown; - }>; + branch: string; /** - * Deployment throttling configurations + * The name of the bouncer */ - throttler_configurations: Array<{ - [key: string]: unknown; - }>; + bouncer: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}"; +}; + +export type DeleteBouncerErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type DeleteBouncerError = DeleteBouncerErrors[keyof DeleteBouncerErrors]; + +export type DeleteBouncerResponses = { + /** + * Deletes the bouncer + */ + 204: unknown; +}; + +export type GetBouncerData = { + body?: never; + path: { /** - * The request to revert the schema operations in this deployment + * The name of the organization that owns this resource */ - deployment_revert_request: { - [key: string]: unknown; - }; - actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cutover_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; - cancelled_actor: { - /** - * The ID of the actor - */ - id: string; - /** - * The name of the actor - */ - display_name: string; - /** - * The URL of the actor's avatar - */ - avatar_url: string; - }; + organization: string; /** - * When the schema was last updated for the deployment + * The name of the database that owns this resource */ - schema_last_updated_at: string; + database: string; /** - * Whether or not the deployment has a table locked + * The name of the branch that owns this resource */ - table_locked: boolean; + branch: string; /** - * The name of he table that is locked by the deployment + * The name of the bouncer */ - locked_table_name: string; + bouncer: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}"; +}; + +export type GetBouncerErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type GetBouncerError = GetBouncerErrors[keyof GetBouncerErrors]; + +export type GetBouncerResponses = { + /** + * Returns a bouncer + */ + 200: PostgresBouncer; +}; + +export type GetBouncerResponse = GetBouncerResponses[keyof GetBouncerResponses]; + +export type CancelBouncerResizeRequestData = { + body?: never; + path: { /** - * Whether or not the deployment is an instant DDL deployment + * The name of the organization that owns this resource */ - instant_ddl: boolean; + organization: string; /** - * Whether or not the deployment is eligible for instant DDL + * The name of the database that owns this resource */ - instant_ddl_eligible: boolean; - }>; + database: string; + /** + * The name of the branch that owns this resource + */ + branch: string; + /** + * The name of the bouncer + */ + bouncer: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes"; }; -export type PaginatedDatabaseWebhook = { +export type CancelBouncerResizeRequestErrors = { /** - * The current page number + * Unauthorized */ - current_page: number; + 401: GeneralError; /** - * The next page number + * Forbidden */ - next_page: number; + 403: GeneralError; /** - * The next page of results + * Not Found */ - next_page_url: string; + 404: GeneralError; /** - * The previous page number + * Internal Server Error */ - prev_page: number; + 500: GeneralError; +}; + +export type CancelBouncerResizeRequestError = + CancelBouncerResizeRequestErrors[keyof CancelBouncerResizeRequestErrors]; + +export type CancelBouncerResizeRequestResponses = { /** - * The previous page of results + * Cancels a resize request + */ + 204: unknown; +}; + +export type ListBouncerResizeRequestsData = { + body?: never; + path: { + /** + * The name of the organization that owns this resource + */ + organization: string; + /** + * The name of the database that owns this resource + */ + database: string; + /** + * The name of the branch that owns this resource + */ + branch: string; + /** + * The name of the bouncer + */ + bouncer: string; + }; + query?: { + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes"; +}; + +export type ListBouncerResizeRequestsErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type ListBouncerResizeRequestsError = + ListBouncerResizeRequestsErrors[keyof ListBouncerResizeRequestsErrors]; + +export type ListBouncerResizeRequestsResponses = { + /** + * Returns bouncer resize requests */ - prev_page_url: string; - data: Array<{ - /** - * The ID of the webhook - */ - id: string; - /** - * The URL the webhook will send events to - */ - url: string; - /** - * The secret used to sign the webhook payloads - */ - secret: string; + 200: PaginatedPostgresBouncerResizeRequest; +}; + +export type ListBouncerResizeRequestsResponse = + ListBouncerResizeRequestsResponses[keyof ListBouncerResizeRequestsResponses]; + +export type UpdateBouncerResizeRequestData = { + body?: { /** - * Whether the webhook is enabled + * The bouncer size SKU name (e.g., 'PGB_5', 'PGB_10', 'PGB_20', 'PGB_40', 'PGB_80', 'PGB_160'). Defaults to 'PGB_5'. */ - enabled: boolean; + bouncer_size?: string; /** - * The last result sent by the webhook + * The number of PgBouncers per availability zone. Defaults to 1. */ - last_sent_result: string; + replicas_per_cell?: number; /** - * Whether the last sent was successful + * Bouncer configuration parameters nested by namespace (e.g., {"pgbouncer": {"default_pool_size": "100"}}). Use the 'List cluster parameters' endpoint to retrieve available parameters. Only parameters with namespace 'pgbouncer' can be updated. */ - last_sent_success: boolean; + parameters?: { + [key: string]: unknown; + }; + }; + path: { /** - * When the last event was sent + * The name of the organization that owns this resource */ - last_sent_at: string; + organization: string; /** - * When the webhook was created + * The name of the database that owns this resource */ - created_at: string; + database: string; /** - * When the webhook was updated + * The name of the branch that owns this resource */ - updated_at: string; + branch: string; /** - * The events this webhook subscribes to + * The name of the bouncer */ - events: Array< - | "branch.ready" - | "branch.anomaly" - | "branch.schema_recommendation" - | "branch.sleeping" - | "branch.start_maintenance" - | "cluster.storage" - | "database.access_request" - | "deploy_request.closed" - | "deploy_request.errored" - | "deploy_request.in_progress" - | "deploy_request.opened" - | "deploy_request.pending_cutover" - | "deploy_request.queued" - | "deploy_request.reverted" - | "deploy_request.schema_applied" - | "keyspace.storage" - | "webhook.test" - >; - }>; + bouncer: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes"; }; -export type DatabaseWebhook = { +export type UpdateBouncerResizeRequestErrors = { /** - * The ID of the webhook - */ - id: string; - /** - * The URL the webhook will send events to - */ - url: string; - /** - * The secret used to sign the webhook payloads - */ - secret: string; - /** - * Whether the webhook is enabled - */ - enabled: boolean; - /** - * The last result sent by the webhook - */ - last_sent_result: string; - /** - * Whether the last sent was successful + * Unauthorized */ - last_sent_success: boolean; + 401: GeneralError; /** - * When the last event was sent + * Forbidden */ - last_sent_at: string; + 403: GeneralError; /** - * When the webhook was created + * Not Found */ - created_at: string; + 404: GeneralError; /** - * When the webhook was updated + * Internal Server Error */ - updated_at: string; + 500: GeneralError; +}; + +export type UpdateBouncerResizeRequestError = + UpdateBouncerResizeRequestErrors[keyof UpdateBouncerResizeRequestErrors]; + +export type UpdateBouncerResizeRequestResponses = { /** - * The events this webhook subscribes to + * Returns bouncer resize request */ - events: Array< - | "branch.ready" - | "branch.anomaly" - | "branch.schema_recommendation" - | "branch.sleeping" - | "branch.start_maintenance" - | "cluster.storage" - | "database.access_request" - | "deploy_request.closed" - | "deploy_request.errored" - | "deploy_request.in_progress" - | "deploy_request.opened" - | "deploy_request.pending_cutover" - | "deploy_request.queued" - | "deploy_request.reverted" - | "deploy_request.schema_applied" - | "keyspace.storage" - | "webhook.test" - >; + 200: PostgresBouncerResizeRequest; }; -export type PaginatedLineItem = { +export type UpdateBouncerResizeRequestResponse = + UpdateBouncerResizeRequestResponses[keyof UpdateBouncerResizeRequestResponses]; + +export type ListBranchChangeRequestsData = { + body?: never; + path: { + /** + * The name of the organization that owns this resource + */ + organization: string; + /** + * The name of the database that owns this resource + */ + database: string; + /** + * The name of the branch that owns this resource + */ + branch: string; + }; + query?: { + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes"; +}; + +export type ListBranchChangeRequestsErrors = { /** - * The current page number + * Unauthorized */ - current_page: number; + 401: GeneralError; /** - * The next page number + * Forbidden */ - next_page: number; + 403: GeneralError; /** - * The next page of results + * Not Found */ - next_page_url: string; + 404: GeneralError; /** - * The previous page number + * Internal Server Error */ - prev_page: number; + 500: GeneralError; +}; + +export type ListBranchChangeRequestsError = + ListBranchChangeRequestsErrors[keyof ListBranchChangeRequestsErrors]; + +export type ListBranchChangeRequestsResponses = { /** - * The previous page of results + * Returns branch change requests */ - prev_page_url: string; - data: Array<{ + 200: PaginatedPostgresClusterResizeRequest; +}; + +export type ListBranchChangeRequestsResponse = + ListBranchChangeRequestsResponses[keyof ListBranchChangeRequestsResponses]; + +export type UpdateBranchChangeRequestData = { + body?: { /** - * The ID for the line item + * The size of the cluster. Available sizes can be found using the 'List cluster sizes' endpoint. */ - id: string; + cluster_size?: string; /** - * The total for the line item + * The total number of replicas */ - subtotal: number; + replicas?: number; /** - * The description for the line item + * Cluster configuration parameters nested by namespace (e.g., {"pgconf": {"max_connections": "200"}}). Use the 'List cluster parameters' endpoint to retrieve available parameters. Supported namespaces include 'patroni', 'pgconf', and 'pgbouncer'. */ - description: string; + parameters?: { + [key: string]: unknown; + }; + }; + path: { /** - * The name of the billable item + * The name of the organization that owns this resource */ - metric_name: string; + organization: string; /** - * The ID for the billed database + * The name of the database that owns this resource */ - database_id: string; + database: string; /** - * The name for the billed database + * The name of the branch that owns this resource */ - database_name: string; - resource: { - /** - * The ID for the resource - */ - id: string; - /** - * The name for the resource - */ - name: string; - /** - * When the resource was created - */ - created_at: string; - /** - * When the resource was last updated - */ - updated_at: string; - /** - * When the resource was deleted, if deleted - */ - deleted_at: string; - }; - }>; + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes"; }; -export type PaginatedInvoice = { +export type UpdateBranchChangeRequestErrors = { /** - * The current page number + * Unauthorized */ - current_page: number; + 401: GeneralError; /** - * The next page number + * Forbidden */ - next_page: number; + 403: GeneralError; /** - * The next page of results + * Not Found */ - next_page_url: string; + 404: GeneralError; /** - * The previous page number + * Internal Server Error */ - prev_page: number; + 500: GeneralError; +}; + +export type UpdateBranchChangeRequestError = + UpdateBranchChangeRequestErrors[keyof UpdateBranchChangeRequestErrors]; + +export type UpdateBranchChangeRequestResponses = { /** - * The previous page of results + * Returns the branch change request */ - prev_page_url: string; - data: Array<{ + 200: PostgresClusterResizeRequest; +}; + +export type UpdateBranchChangeRequestResponse = + UpdateBranchChangeRequestResponses[keyof UpdateBranchChangeRequestResponses]; + +export type GetBranchChangeRequestData = { + body?: never; + path: { /** - * The ID of the invoice + * The name of the organization that owns this resource */ - id: string; + organization: string; /** - * The total amount of the invoice + * The name of the database that owns this resource */ - total: number; + database: string; /** - * Start of the billing period + * The name of the branch that owns this resource */ - billing_period_start: string; + branch: string; /** - * End of the billing period + * The ID of the change request */ - billing_period_end: string; - }>; + id: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes/{id}"; }; -export type Invoice = { +export type GetBranchChangeRequestErrors = { /** - * The ID of the invoice + * Unauthorized */ - id: string; + 401: GeneralError; /** - * The total amount of the invoice + * Forbidden */ - total: number; + 403: GeneralError; /** - * Start of the billing period + * Not Found */ - billing_period_start: string; + 404: GeneralError; /** - * End of the billing period + * Internal Server Error */ - billing_period_end: string; + 500: GeneralError; }; -export type KeyspaceResizeRequest = { - id: string; - type: "KeyspaceResizeRequest"; - state: "resizing" | "completed"; - started_at: string; - completed_at: string; - created_at: string; - updated_at: string; - extra_replicas?: number; - vector_pool_allocation?: string; - previous_vector_pool_allocation?: string; - cluster_name?: string; - cluster_display_name?: string; - previous_cluster_name?: string; - previous_cluster_display_name?: string; - replicas?: number; - previous_replicas?: number; - cluster_rank?: number; - previous_cluster_rank?: number; - actor?: { - [key: string]: unknown; - }; - cluster_rate_name?: string; - cluster_rate_display_name?: string; - previous_cluster_rate_name?: string; - previous_cluster_rate_display_name?: string; -}; +export type GetBranchChangeRequestError = + GetBranchChangeRequestErrors[keyof GetBranchChangeRequestErrors]; -export type PaginatedKeyspaceResizeRequest = { +export type GetBranchChangeRequestResponses = { /** - * The current page number + * Returns a branch change request */ - current_page: number; + 200: PostgresClusterResizeRequest; +}; + +export type GetBranchChangeRequestResponse = + GetBranchChangeRequestResponses[keyof GetBranchChangeRequestResponses]; + +export type UpdateBranchClusterConfigData = { + body?: { + /** + * The new size of the database cluster: PS_10, PS_20,… + */ + cluster_size: string; + }; + path: { + /** + * The name of the organization the branch belongs to + */ + organization: string; + /** + * The name of the database the branch belongs to + */ + database: string; + /** + * The name of the branch to configure + */ + branch: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/cluster"; +}; + +export type UpdateBranchClusterConfigErrors = { /** - * The next page number + * Unauthorized */ - next_page: number; + 401: GeneralError; /** - * The next page of results + * Forbidden */ - next_page_url: string; + 403: GeneralError; /** - * The previous page number + * Not Found */ - prev_page: number; + 404: GeneralError; /** - * The previous page of results + * Internal Server Error */ - prev_page_url: string; - data: Array; + 500: GeneralError; }; -export type GeneralError = { - code?: string; - message?: string; +export type UpdateBranchClusterConfigError = + UpdateBranchClusterConfigErrors[keyof UpdateBranchClusterConfigErrors]; + +export type UpdateBranchClusterConfigResponses = { + /** + * Returns an empty response body + */ + 204: unknown; }; -export type ListOrganizationsData = { +export type DemoteBranchData = { body?: never; - path?: never; - query?: { + path: { /** - * If provided, specifies the page offset of returned results + * The name of the organization the branch belongs to */ - page?: number; + organization: string; /** - * If provided, specifies the number of returned results + * The name of the database the branch belongs to */ - per_page?: number; + database: string; + /** + * The name of the branch + */ + branch: string; }; - url: "/organizations"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/demote"; }; -export type ListOrganizationsErrors = { +export type DemoteBranchErrors = { /** * Unauthorized */ @@ -7262,32 +10419,39 @@ export type ListOrganizationsErrors = { 500: GeneralError; }; -export type ListOrganizationsError = - ListOrganizationsErrors[keyof ListOrganizationsErrors]; +export type DemoteBranchError = DemoteBranchErrors[keyof DemoteBranchErrors]; -export type ListOrganizationsResponses = { +export type DemoteBranchResponses = { /** - * Gets the organizations for the current user + * Returns a development branch */ - 200: PaginatedOrganization; + 200: DatabaseBranch; }; -export type ListOrganizationsResponse = - ListOrganizationsResponses[keyof ListOrganizationsResponses]; +export type DemoteBranchResponse = + DemoteBranchResponses[keyof DemoteBranchResponses]; -export type GetOrganizationData = { +export type ListExtensionsData = { body?: never; path: { /** - * The name of the organization + * The name of the organization that owns this resource */ - name: string; + organization: string; + /** + * The name of the database that owns this resource + */ + database: string; + /** + * The name of the branch that owns this resource + */ + branch: string; }; query?: never; - url: "/organizations/{name}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/extensions"; }; -export type GetOrganizationErrors = { +export type ListExtensionsErrors = { /** * Unauthorized */ @@ -7306,45 +10470,49 @@ export type GetOrganizationErrors = { 500: GeneralError; }; -export type GetOrganizationError = - GetOrganizationErrors[keyof GetOrganizationErrors]; +export type ListExtensionsError = + ListExtensionsErrors[keyof ListExtensionsErrors]; -export type GetOrganizationResponses = { +export type ListExtensionsResponses = { /** - * Returns an organization + * Returns cluster extensions */ - 200: Organization; + 200: Array; }; -export type GetOrganizationResponse = - GetOrganizationResponses[keyof GetOrganizationResponses]; +export type ListExtensionsResponse = + ListExtensionsResponses[keyof ListExtensionsResponses]; -export type UpdateOrganizationData = { - body?: { +export type ListKeyspacesData = { + body?: never; + path: { /** - * The billing email for the organization + * The name of the organization the branch belongs to */ - billing_email?: string; + organization: string; /** - * Whether or not the IdP provider is be responsible for managing roles in PlanetScale + * The name of the database the branch belongs to */ - idp_managed_roles?: boolean; + database: string; /** - * The expected monthly budget for the organization + * The name of the branch */ - invoice_budget_amount?: number; + branch: string; }; - path: { + query?: { /** - * The name of the organization + * If provided, specifies the page offset of returned results */ - name: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{name}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces"; }; -export type UpdateOrganizationErrors = { +export type ListKeyspacesErrors = { /** * Unauthorized */ @@ -7363,32 +10531,56 @@ export type UpdateOrganizationErrors = { 500: GeneralError; }; -export type UpdateOrganizationError = - UpdateOrganizationErrors[keyof UpdateOrganizationErrors]; +export type ListKeyspacesError = ListKeyspacesErrors[keyof ListKeyspacesErrors]; -export type UpdateOrganizationResponses = { +export type ListKeyspacesResponses = { /** - * Returns the updated organization + * Returns keyspaces */ - 200: Organization; + 200: PaginatedDatabaseBranchKeyspace; }; -export type UpdateOrganizationResponse = - UpdateOrganizationResponses[keyof UpdateOrganizationResponses]; +export type ListKeyspacesResponse = + ListKeyspacesResponses[keyof ListKeyspacesResponses]; -export type ListAuditLogsData = { - body?: never; +export type CreateKeyspaceData = { + body?: { + /** + * The name of the keyspace + */ + name: string; + /** + * The database cluster size name (e.g., 'PS_10', 'PS_80'). Use the 'List available cluster sizes' endpoint to get available options for your organization. /v1/organizations/:organization/cluster-size-skus + */ + cluster_size: string; + /** + * The number of additional replicas beyond the included default + */ + extra_replicas?: number; + /** + * The number of shards. Default: 1 + */ + shards?: number; + }; path: { /** - * The name of the organization + * The name of the organization the branch belongs to */ - name: string; + organization: string; + /** + * The name of the database the branch belongs to + */ + database: string; + /** + * The name of the branch + */ + branch: string; }; query?: never; - url: "/organizations/{name}/audit-log"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces"; }; -export type ListAuditLogsErrors = { +export type CreateKeyspaceErrors = { /** * Unauthorized */ @@ -7407,40 +10599,44 @@ export type ListAuditLogsErrors = { 500: GeneralError; }; -export type ListAuditLogsError = ListAuditLogsErrors[keyof ListAuditLogsErrors]; +export type CreateKeyspaceError = + CreateKeyspaceErrors[keyof CreateKeyspaceErrors]; -export type ListAuditLogsResponses = { +export type CreateKeyspaceResponses = { /** - * Returns the audit log events + * Returns a created keyspace */ - 200: PaginatedAuditLogEvent; + 200: DatabaseBranchKeyspace; }; -export type ListAuditLogsResponse = - ListAuditLogsResponses[keyof ListAuditLogsResponses]; +export type CreateKeyspaceResponse = + CreateKeyspaceResponses[keyof CreateKeyspaceResponses]; -export type ListRegionsForOrganizationData = { +export type DeleteKeyspaceData = { body?: never; path: { /** - * The name of the organization + * The name of the organization the branch belongs to */ - name: string; - }; - query?: { + organization: string; /** - * If provided, specifies the page offset of returned results + * The name of the database the branch belongs to */ - page?: number; + database: string; /** - * If provided, specifies the number of returned results + * The name of the branch */ - per_page?: number; + branch: string; + /** + * The name of the keyspace + */ + keyspace: string; }; - url: "/organizations/{name}/regions"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}"; }; -export type ListRegionsForOrganizationErrors = { +export type DeleteKeyspaceErrors = { /** * Unauthorized */ @@ -7459,45 +10655,41 @@ export type ListRegionsForOrganizationErrors = { 500: GeneralError; }; -export type ListRegionsForOrganizationError = - ListRegionsForOrganizationErrors[keyof ListRegionsForOrganizationErrors]; +export type DeleteKeyspaceError = + DeleteKeyspaceErrors[keyof DeleteKeyspaceErrors]; -export type ListRegionsForOrganizationResponses = { +export type DeleteKeyspaceResponses = { /** - * Returns the organization's regions + * Delete a keyspace */ - 200: PaginatedPlanetscaleRegion; + 204: unknown; }; -export type ListRegionsForOrganizationResponse = - ListRegionsForOrganizationResponses[keyof ListRegionsForOrganizationResponses]; - -export type ListDatabasesData = { +export type GetKeyspaceData = { body?: never; path: { /** - * The name of the organization the database belongs to + * The name of the organization the branch belongs to */ organization: string; - }; - query?: { /** - * Search term to filter databases by name + * The name of the database the branch belongs to */ - q?: string; + database: string; /** - * If provided, specifies the page offset of returned results + * The name of the branch */ - page?: number; + branch: string; /** - * If provided, specifies the number of returned results + * The name of the keyspace */ - per_page?: number; + keyspace: string; }; - url: "/organizations/{organization}/databases"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}"; }; -export type ListDatabasesErrors = { +export type GetKeyspaceErrors = { /** * Unauthorized */ @@ -7516,48 +10708,43 @@ export type ListDatabasesErrors = { 500: GeneralError; }; -export type ListDatabasesError = ListDatabasesErrors[keyof ListDatabasesErrors]; +export type GetKeyspaceError = GetKeyspaceErrors[keyof GetKeyspaceErrors]; -export type ListDatabasesResponses = { +export type GetKeyspaceResponses = { /** - * Retrieves the databases for an organization + * Returns information about a keyspace */ - 200: PaginatedDatabase; + 200: DatabaseBranchKeyspace; }; -export type ListDatabasesResponse = - ListDatabasesResponses[keyof ListDatabasesResponses]; +export type GetKeyspaceResponse = + GetKeyspaceResponses[keyof GetKeyspaceResponses]; -export type CreateDatabaseData = { - body?: { - /** - * Name of the database - */ - name: string; +export type UpdateKeyspaceData = { + body?: never; + path: { /** - * The region the database will be deployed in. If left blank, defaults to the organization's default region. + * The name of the organization the branch belongs to */ - region?: string; + organization: string; /** - * The database cluster size. Options: PS_10, PS_20, PS_40, PS_80, PS_160, PS_320, PS_400, PS_640, PS_700, PS_900, PS_1280, PS_1400, PS_1800, PS_2100, PS_2560, PS_2700, PS_2800. + * The name of the database the branch belongs to */ - cluster_size: string; + database: string; /** - * The kind of database to create. + * The name of the branch */ - kind?: "mysql" | "postgresql"; - }; - path: { + branch: string; /** - * The name of the organization the database belongs to + * The name of the keyspace */ - organization: string; + keyspace: string; }; query?: never; - url: "/organizations/{organization}/databases"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}"; }; -export type CreateDatabaseErrors = { +export type UpdateKeyspaceErrors = { /** * Unauthorized */ @@ -7576,20 +10763,20 @@ export type CreateDatabaseErrors = { 500: GeneralError; }; -export type CreateDatabaseError = - CreateDatabaseErrors[keyof CreateDatabaseErrors]; +export type UpdateKeyspaceError = + UpdateKeyspaceErrors[keyof UpdateKeyspaceErrors]; -export type CreateDatabaseResponses = { +export type UpdateKeyspaceResponses = { /** - * Returns the created database + * Returns the keyspace */ - 201: Database; + 200: DatabaseBranchKeyspace; }; -export type CreateDatabaseResponse = - CreateDatabaseResponses[keyof CreateDatabaseResponses]; +export type UpdateKeyspaceResponse = + UpdateKeyspaceResponses[keyof UpdateKeyspaceResponses]; -export type ListBranchesData = { +export type GetKeyspaceRolloutStatusData = { body?: never; path: { /** @@ -7600,37 +10787,20 @@ export type ListBranchesData = { * The name of the database the branch belongs to */ database: string; - }; - query?: { - /** - * Search branches by name - */ - q?: string; - /** - * Filter branches by production status - */ - production?: boolean; - /** - * Filter branches by safe migrations (DDL protection) - */ - safe_migrations?: boolean; - /** - * Order branches by created_at time - */ - order?: "asc" | "desc"; /** - * If provided, specifies the page offset of returned results + * The name of the branch */ - page?: number; + branch: string; /** - * If provided, specifies the number of returned results + * The name of the keyspace */ - per_page?: number; + keyspace: string; }; - url: "/organizations/{organization}/databases/{database}/branches"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/rollout-status"; }; -export type ListBranchesErrors = { +export type GetKeyspaceRolloutStatusErrors = { /** * Unauthorized */ @@ -7649,64 +10819,71 @@ export type ListBranchesErrors = { 500: GeneralError; }; -export type ListBranchesError = ListBranchesErrors[keyof ListBranchesErrors]; +export type GetKeyspaceRolloutStatusError = + GetKeyspaceRolloutStatusErrors[keyof GetKeyspaceRolloutStatusErrors]; -export type ListBranchesResponses = { +export type GetKeyspaceRolloutStatusResponses = { /** - * Returns database branches + * Returns information about a keyspace's rollout */ - 200: PaginatedDatabaseBranch; -}; - -export type ListBranchesResponse = - ListBranchesResponses[keyof ListBranchesResponses]; - -export type CreateBranchData = { - body?: { + 200: { /** - * The name of the branch + * The name of the keyspace */ name: string; /** - * Parent branch - */ - parent_branch: string; - /** - * If provided, restores the backup's schema and data to the new branch. Must have `restore_production_branch_backup(s)` or `restore_backup(s)` access to do this. - */ - backup_id?: string; - /** - * The region to create the branch in. If not provided, the branch will be created in the default region for its database. - */ - region?: string; - /** - * Restore from a point-in-time recovery timestamp (e.g. 2023-01-01T00:00:00Z). Available only for PostgreSQL databases. + * The current state of the rollout at the keyspace level */ - restore_point?: string; + state: string; + shards: Array<{ + /** + * The name of the shard + */ + name: string; + /** + * The time at which the rollout started + */ + last_rollout_started_at: string; + /** + * The time at which the rollout completed + */ + last_rollout_finished_at: string; + /** + * The current state of the rollout at the shard level + */ + state: string; + }>; + }; +}; + +export type GetKeyspaceRolloutStatusResponse = + GetKeyspaceRolloutStatusResponses[keyof GetKeyspaceRolloutStatusResponses]; + +export type GetKeyspaceVschemaData = { + body?: never; + path: { /** - * If provided, restores the last successful backup's schema and data to the new branch. Must have `restore_production_branch_backup(s)` or `restore_backup(s)` access to do this, in addition to Data Branching™ being enabled for the branch. + * The name of the organization the branch belongs to */ - seed_data?: "last_successful_backup"; + organization: string; /** - * The database cluster size is required if a backup_id is provided. Options: PS_10, PS_20, PS_40, ..., PS_2800 + * The name of the database the branch belongs to */ - cluster_size?: string; - }; - path: { + database: string; /** - * The name of the organization the branch belongs to + * The name of the branch */ - organization: string; + branch: string; /** - * The name of the database the branch belongs to + * The name of the keyspace */ - database: string; + keyspace: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema"; }; -export type CreateBranchErrors = { +export type GetKeyspaceVschemaErrors = { /** * Unauthorized */ @@ -7725,20 +10902,31 @@ export type CreateBranchErrors = { 500: GeneralError; }; -export type CreateBranchError = CreateBranchErrors[keyof CreateBranchErrors]; +export type GetKeyspaceVschemaError = + GetKeyspaceVschemaErrors[keyof GetKeyspaceVschemaErrors]; -export type CreateBranchResponses = { +export type GetKeyspaceVschemaResponses = { /** - * Returns the created branch + * Returns the VSchema for the keyspace */ - 201: DatabaseBranch; + 200: { + /** + * The keyspace's VSchema + */ + raw: string; + }; }; -export type CreateBranchResponse = - CreateBranchResponses[keyof CreateBranchResponses]; +export type GetKeyspaceVschemaResponse = + GetKeyspaceVschemaResponses[keyof GetKeyspaceVschemaResponses]; -export type ListBackupsData = { - body?: never; +export type UpdateKeyspaceVschemaData = { + body?: { + /** + * The new VSchema for the keyspace + */ + vschema: string; + }; path: { /** * The name of the organization the branch belongs to @@ -7752,55 +10940,16 @@ export type ListBackupsData = { * The name of the branch */ branch: string; - }; - query?: { - /** - * Whether to include all backups, including deleted ones - */ - all?: boolean; - /** - * Filter backups by state - */ - state?: - | "pending" - | "running" - | "success" - | "failed" - | "canceled" - | "ignored"; - /** - * Filter backups by backup policy ID - */ - policy?: string; - /** - * Filter backups started after this date (e.g. 2023-01-01T00:00:00Z) - */ - from?: string; - /** - * Filter backups started before this date (e.g. 2023-01-31T23:59:59Z) - */ - to?: string; - /** - * Filter backups that are running during a specific time (e.g. 2023-01-01T00:00:00Z..2023-01-01T23:59:59Z) - */ - running_at?: string; - /** - * Filter backups by production branch - */ - production?: boolean; - /** - * If provided, specifies the page offset of returned results - */ - page?: number; /** - * If provided, specifies the number of returned results + * The name of the keyspace */ - per_page?: number; + keyspace: string; }; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema"; }; -export type ListBackupsErrors = { +export type UpdateKeyspaceVschemaErrors = { /** * Unauthorized */ @@ -7813,62 +10962,55 @@ export type ListBackupsErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Content + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type ListBackupsError = ListBackupsErrors[keyof ListBackupsErrors]; +export type UpdateKeyspaceVschemaError = + UpdateKeyspaceVschemaErrors[keyof UpdateKeyspaceVschemaErrors]; -export type ListBackupsResponses = { +export type UpdateKeyspaceVschemaResponses = { /** - * Returns database branch backups + * Returns the VSchema for the keyspace */ - 200: PaginatedBackup; -}; - -export type ListBackupsResponse = - ListBackupsResponses[keyof ListBackupsResponses]; - -export type CreateBackupData = { - body?: { - /** - * Name for the backup - */ - name?: string; - /** - * Unit for the retention period of the backup - */ - retention_unit?: "hour" | "day" | "week" | "month" | "year"; - /** - * Value between `1`` and `1000`` for the retention period of the backup (i.e retention_value `6`` and retention_unit `hour` means 6 hours) - */ - retention_value?: number; + 200: { /** - * Whether the backup is an immediate backup that may affect database performance. Emergency backups are only supported for PostgreSQL databases. + * The keyspace's VSchema */ - emergency?: boolean; + raw: string; }; +}; + +export type UpdateKeyspaceVschemaResponse = + UpdateKeyspaceVschemaResponses[keyof UpdateKeyspaceVschemaResponses]; + +export type ListParametersData = { + body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch + * The name of the branch that owns this resource */ branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/parameters"; }; -export type CreateBackupErrors = { +export type ListParametersErrors = { /** * Unauthorized */ @@ -7887,43 +11029,53 @@ export type CreateBackupErrors = { 500: GeneralError; }; -export type CreateBackupError = CreateBackupErrors[keyof CreateBackupErrors]; +export type ListParametersError = + ListParametersErrors[keyof ListParametersErrors]; -export type CreateBackupResponses = { +export type ListParametersResponses = { /** - * Returns the created database branch backup + * Returns cluster parameters */ - 201: Backup; + 200: Array; }; -export type CreateBackupResponse = - CreateBackupResponses[keyof CreateBackupResponses]; +export type ListParametersResponse = + ListParametersResponses[keyof ListParametersResponses]; -export type DeleteBackupData = { +export type ListPasswordsData = { body?: never; path: { /** - * The ID of the backup - */ - id: string; - /** - * The name of the organization the branch belongs to + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database the password belongs to */ database: string; /** - * The name of the branch + * The name of the branch the password belongs to */ branch: string; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; + query?: { + /** + * A read-only region of the database branch. If present, the password results will be filtered to only those in the region + */ + read_only_region_id?: string; + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords"; }; -export type DeleteBackupErrors = { +export type ListPasswordsErrors = { /** * Unauthorized */ @@ -7942,40 +11094,64 @@ export type DeleteBackupErrors = { 500: GeneralError; }; -export type DeleteBackupError = DeleteBackupErrors[keyof DeleteBackupErrors]; +export type ListPasswordsError = ListPasswordsErrors[keyof ListPasswordsErrors]; -export type DeleteBackupResponses = { +export type ListPasswordsResponses = { /** - * Delete a backup + * Returns passwords for the branch */ - 204: unknown; + 200: PaginatedDatabaseBranchPassword; }; -export type GetBackupData = { - body?: never; - path: { +export type ListPasswordsResponse = + ListPasswordsResponses[keyof ListPasswordsResponses]; + +export type CreatePasswordData = { + body?: { /** - * The ID for the backup + * Optional name of the password */ - id: string; + name?: string; /** - * The name of the organization the branch belongs to + * The database role of the password (i.e. admin) + */ + role?: "reader" | "writer" | "admin" | "readwriter"; + /** + * Whether the password is for a read replica + */ + replica?: boolean; + /** + * Time to live (in seconds) for the password. The password will be invalid when TTL has passed + */ + ttl?: number; + /** + * List of IP addresses or CIDR ranges that can use this password + */ + cidrs?: Array; + /** + * Whether the password connects directly to a VTGate + */ + direct_vtgate?: boolean; + }; + path: { + /** + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database the password belongs to */ database: string; /** - * The name of the branch + * The name of the branch the password belongs to */ branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords"; }; -export type GetBackupErrors = { +export type CreatePasswordErrors = { /** * Unauthorized */ @@ -7988,53 +11164,54 @@ export type GetBackupErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Content + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type GetBackupError = GetBackupErrors[keyof GetBackupErrors]; +export type CreatePasswordError = + CreatePasswordErrors[keyof CreatePasswordErrors]; -export type GetBackupResponses = { +export type CreatePasswordResponses = { /** - * Returns a database branch backup + * Returns the new credentials */ - 200: Backup; + 201: DatabaseBranchPassword; }; -export type GetBackupResponse = GetBackupResponses[keyof GetBackupResponses]; +export type CreatePasswordResponse = + CreatePasswordResponses[keyof CreatePasswordResponses]; -export type UpdateBackupData = { - body?: { - /** - * Whether the backup is protected from deletion or not - */ - protected?: boolean; - }; +export type DeletePasswordData = { + body?: never; path: { /** - * The ID of the backup - */ - id: string; - /** - * The name of the organization the branch belongs to + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database the password belongs to */ database: string; /** - * The name of the branch + * The name of the branch the password belongs to */ branch: string; + /** + * The ID of the password + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; }; -export type UpdateBackupErrors = { +export type DeletePasswordErrors = { /** * Unauthorized */ @@ -8053,48 +11230,41 @@ export type UpdateBackupErrors = { 500: GeneralError; }; -export type UpdateBackupError = UpdateBackupErrors[keyof UpdateBackupErrors]; +export type DeletePasswordError = + DeletePasswordErrors[keyof DeletePasswordErrors]; -export type UpdateBackupResponses = { +export type DeletePasswordResponses = { /** - * Returns the backup + * Deletes the password */ - 200: Backup; + 204: unknown; }; -export type UpdateBackupResponse = - UpdateBackupResponses[keyof UpdateBackupResponses]; - -export type ListBranchChangeRequestsData = { +export type GetPasswordData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database the password belongs to */ database: string; /** - * The name of the branch that owns this resource + * The name of the branch the password belongs to */ branch: string; - }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; /** - * If provided, specifies the number of returned results + * The ID of the password */ - per_page?: number; + id: string; }; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; }; -export type ListBranchChangeRequestsErrors = { +export type GetPasswordErrors = { /** * Unauthorized */ @@ -8113,42 +11283,52 @@ export type ListBranchChangeRequestsErrors = { 500: GeneralError; }; -export type ListBranchChangeRequestsError = - ListBranchChangeRequestsErrors[keyof ListBranchChangeRequestsErrors]; +export type GetPasswordError = GetPasswordErrors[keyof GetPasswordErrors]; -export type ListBranchChangeRequestsResponses = { +export type GetPasswordResponses = { /** - * Returns branch change requests + * Returns a password */ - 200: PaginatedPostgresClusterResizeRequest; + 200: DatabaseBranchPassword; }; -export type ListBranchChangeRequestsResponse = - ListBranchChangeRequestsResponses[keyof ListBranchChangeRequestsResponses]; +export type GetPasswordResponse = + GetPasswordResponses[keyof GetPasswordResponses]; -export type UpdateBranchChangeRequestData = { - body: { - cluster_size: string; +export type UpdatePasswordData = { + body?: { + /** + * The name for the password + */ + name?: string; + /** + * List of IP addresses or CIDR ranges that can use this password + */ + cidrs?: Array; }; path: { /** - * The name of the organization that owns this resource + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database the password belongs to */ database: string; /** - * The name of the branch that owns this resource + * The name of the branch the password belongs to */ branch: string; + /** + * The ID of the password + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/changes"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; }; -export type UpdateBranchChangeRequestErrors = { +export type UpdatePasswordErrors = { /** * Unauthorized */ @@ -8167,40 +11347,44 @@ export type UpdateBranchChangeRequestErrors = { 500: GeneralError; }; -export type UpdateBranchChangeRequestError = - UpdateBranchChangeRequestErrors[keyof UpdateBranchChangeRequestErrors]; +export type UpdatePasswordError = + UpdatePasswordErrors[keyof UpdatePasswordErrors]; -export type UpdateBranchChangeRequestResponses = { +export type UpdatePasswordResponses = { /** - * Returns the branch change request + * Returns the updated password */ - 200: PostgresClusterResizeRequest; + 200: DatabaseBranchPassword; }; -export type UpdateBranchChangeRequestResponse = - UpdateBranchChangeRequestResponses[keyof UpdateBranchChangeRequestResponses]; +export type UpdatePasswordResponse = + UpdatePasswordResponses[keyof UpdatePasswordResponses]; -export type ListExtensionsData = { +export type RenewPasswordData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the password belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database the password belongs to */ database: string; /** - * The name of the branch that owns this resource + * The name of the branch the password belongs to */ branch: string; + /** + * The ID of the password + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/extensions"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}/renew"; }; -export type ListExtensionsErrors = { +export type RenewPasswordErrors = { /** * Unauthorized */ @@ -8219,20 +11403,19 @@ export type ListExtensionsErrors = { 500: GeneralError; }; -export type ListExtensionsError = - ListExtensionsErrors[keyof ListExtensionsErrors]; +export type RenewPasswordError = RenewPasswordErrors[keyof RenewPasswordErrors]; -export type ListExtensionsResponses = { +export type RenewPasswordResponses = { /** - * Returns cluster extensions + * Returns the renewed password */ - 200: Array; + 200: DatabaseBranchPassword; }; -export type ListExtensionsResponse = - ListExtensionsResponses[keyof ListExtensionsResponses]; +export type RenewPasswordResponse = + RenewPasswordResponses[keyof RenewPasswordResponses]; -export type ListKeyspacesData = { +export type PromoteBranchData = { body?: never; path: { /** @@ -8248,20 +11431,11 @@ export type ListKeyspacesData = { */ branch: string; }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; - /** - * If provided, specifies the number of returned results - */ - per_page?: number; - }; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/promote"; }; -export type ListKeyspacesErrors = { +export type PromoteBranchErrors = { /** * Unauthorized */ @@ -8280,25 +11454,20 @@ export type ListKeyspacesErrors = { 500: GeneralError; }; -export type ListKeyspacesError = ListKeyspacesErrors[keyof ListKeyspacesErrors]; +export type PromoteBranchError = PromoteBranchErrors[keyof PromoteBranchErrors]; -export type ListKeyspacesResponses = { +export type PromoteBranchResponses = { /** - * Returns keyspaces + * Returns a production branch */ - 200: PaginatedDatabaseBranchKeyspace; + 200: DatabaseBranch; }; -export type ListKeyspacesResponse = - ListKeyspacesResponses[keyof ListKeyspacesResponses]; +export type PromoteBranchResponse = + PromoteBranchResponses[keyof PromoteBranchResponses]; -export type CreateKeyspaceData = { - body?: { - /** - * The name of the keyspace - */ - name: string; - }; +export type ListGeneratedQueryPatternsReportsData = { + body?: never; path: { /** * The name of the organization the branch belongs to @@ -8314,10 +11483,10 @@ export type CreateKeyspaceData = { branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns"; }; -export type CreateKeyspaceErrors = { +export type ListGeneratedQueryPatternsReportsErrors = { /** * Unauthorized */ @@ -8336,20 +11505,20 @@ export type CreateKeyspaceErrors = { 500: GeneralError; }; -export type CreateKeyspaceError = - CreateKeyspaceErrors[keyof CreateKeyspaceErrors]; +export type ListGeneratedQueryPatternsReportsError = + ListGeneratedQueryPatternsReportsErrors[keyof ListGeneratedQueryPatternsReportsErrors]; -export type CreateKeyspaceResponses = { +export type ListGeneratedQueryPatternsReportsResponses = { /** - * Returns a created keyspace + * Returns the generated query patterns reports */ - 200: DatabaseBranchKeyspace; + 200: PaginatedQueryPatternsDownload; }; -export type CreateKeyspaceResponse = - CreateKeyspaceResponses[keyof CreateKeyspaceResponses]; +export type ListGeneratedQueryPatternsReportsResponse = + ListGeneratedQueryPatternsReportsResponses[keyof ListGeneratedQueryPatternsReportsResponses]; -export type GetKeyspaceVschemaData = { +export type CreateQueryPatternsReportData = { body?: never; path: { /** @@ -8364,16 +11533,12 @@ export type GetKeyspaceVschemaData = { * The name of the branch */ branch: string; - /** - * The name of the keyspace - */ - keyspace: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns"; }; -export type GetKeyspaceVschemaErrors = { +export type CreateQueryPatternsReportErrors = { /** * Unauthorized */ @@ -8392,31 +11557,21 @@ export type GetKeyspaceVschemaErrors = { 500: GeneralError; }; -export type GetKeyspaceVschemaError = - GetKeyspaceVschemaErrors[keyof GetKeyspaceVschemaErrors]; +export type CreateQueryPatternsReportError = + CreateQueryPatternsReportErrors[keyof CreateQueryPatternsReportErrors]; -export type GetKeyspaceVschemaResponses = { +export type CreateQueryPatternsReportResponses = { /** - * Returns the VSchema for the keyspace + * The created query patterns download */ - 200: { - /** - * The keyspace's VSchema - */ - raw: string; - }; + 201: QueryPatternsDownload; }; -export type GetKeyspaceVschemaResponse = - GetKeyspaceVschemaResponses[keyof GetKeyspaceVschemaResponses]; +export type CreateQueryPatternsReportResponse = + CreateQueryPatternsReportResponses[keyof CreateQueryPatternsReportResponses]; -export type UpdateKeyspaceVschemaData = { - body?: { - /** - * The new VSchema for the keyspace - */ - vschema: string; - }; +export type DeleteQueryPatternsReportData = { + body?: never; path: { /** * The name of the organization the branch belongs to @@ -8431,15 +11586,15 @@ export type UpdateKeyspaceVschemaData = { */ branch: string; /** - * The name of the keyspace + * The ID of the query patterns report */ - keyspace: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}/vschema"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}"; }; -export type UpdateKeyspaceVschemaErrors = { +export type DeleteQueryPatternsReportErrors = { /** * Unauthorized */ @@ -8452,35 +11607,23 @@ export type UpdateKeyspaceVschemaErrors = { * Not Found */ 404: GeneralError; - /** - * Unprocessable Content - */ - 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type UpdateKeyspaceVschemaError = - UpdateKeyspaceVschemaErrors[keyof UpdateKeyspaceVschemaErrors]; +export type DeleteQueryPatternsReportError = + DeleteQueryPatternsReportErrors[keyof DeleteQueryPatternsReportErrors]; -export type UpdateKeyspaceVschemaResponses = { +export type DeleteQueryPatternsReportResponses = { /** - * Returns the VSchema for the keyspace + * Delete a query patterns report */ - 200: { - /** - * The keyspace's VSchema - */ - raw: string; - }; + 204: unknown; }; -export type UpdateKeyspaceVschemaResponse = - UpdateKeyspaceVschemaResponses[keyof UpdateKeyspaceVschemaResponses]; - -export type DeleteKeyspaceData = { +export type GetQueryPatternsReportStatusData = { body?: never; path: { /** @@ -8496,15 +11639,15 @@ export type DeleteKeyspaceData = { */ branch: string; /** - * The name of the keyspace + * The ID of the query patterns report */ - name: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}"; }; -export type DeleteKeyspaceErrors = { +export type GetQueryPatternsReportStatusErrors = { /** * Unauthorized */ @@ -8523,17 +11666,20 @@ export type DeleteKeyspaceErrors = { 500: GeneralError; }; -export type DeleteKeyspaceError = - DeleteKeyspaceErrors[keyof DeleteKeyspaceErrors]; +export type GetQueryPatternsReportStatusError = + GetQueryPatternsReportStatusErrors[keyof GetQueryPatternsReportStatusErrors]; -export type DeleteKeyspaceResponses = { +export type GetQueryPatternsReportStatusResponses = { /** - * Delete a keyspace + * The retrieved query patterns download */ - 204: unknown; + 200: QueryPatternsDownload; }; -export type GetKeyspaceData = { +export type GetQueryPatternsReportStatusResponse = + GetQueryPatternsReportStatusResponses[keyof GetQueryPatternsReportStatusResponses]; + +export type GetQueryPatternsReportData = { body?: never; path: { /** @@ -8549,15 +11695,15 @@ export type GetKeyspaceData = { */ branch: string; /** - * The name of the keyspace + * The ID of the query patterns report */ - name: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}/download"; }; -export type GetKeyspaceErrors = { +export type GetQueryPatternsReportErrors = { /** * Unauthorized */ @@ -8576,43 +11722,30 @@ export type GetKeyspaceErrors = { 500: GeneralError; }; -export type GetKeyspaceError = GetKeyspaceErrors[keyof GetKeyspaceErrors]; - -export type GetKeyspaceResponses = { - /** - * Returns information about a keyspace - */ - 200: DatabaseBranchKeyspace; -}; - -export type GetKeyspaceResponse = - GetKeyspaceResponses[keyof GetKeyspaceResponses]; +export type GetQueryPatternsReportError = + GetQueryPatternsReportErrors[keyof GetQueryPatternsReportErrors]; -export type UpdateKeyspaceData = { +export type CancelBranchChangeRequestData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch + * The name of the branch that owns this resource */ branch: string; - /** - * The name of the keyspace - */ - name: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/resizes"; }; -export type UpdateKeyspaceErrors = { +export type CancelBranchChangeRequestErrors = { /** * Unauthorized */ @@ -8631,44 +11764,46 @@ export type UpdateKeyspaceErrors = { 500: GeneralError; }; -export type UpdateKeyspaceError = - UpdateKeyspaceErrors[keyof UpdateKeyspaceErrors]; +export type CancelBranchChangeRequestError = + CancelBranchChangeRequestErrors[keyof CancelBranchChangeRequestErrors]; -export type UpdateKeyspaceResponses = { +export type CancelBranchChangeRequestResponses = { /** - * Returns the keyspace + * Cancels a change request */ - 200: DatabaseBranchKeyspace; + 204: unknown; }; -export type UpdateKeyspaceResponse = - UpdateKeyspaceResponses[keyof UpdateKeyspaceResponses]; - -export type GetKeyspaceRolloutStatusData = { +export type ListRolesData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch + * The name of the branch that owns this resource */ branch: string; + }; + query?: { /** - * The name of the keyspace + * If provided, specifies the page offset of returned results */ - name: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}/rollout-status"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles"; }; -export type GetKeyspaceRolloutStatusErrors = { +export type ListRolesErrors = { /** * Unauthorized */ @@ -8687,48 +11822,42 @@ export type GetKeyspaceRolloutStatusErrors = { 500: GeneralError; }; -export type GetKeyspaceRolloutStatusError = - GetKeyspaceRolloutStatusErrors[keyof GetKeyspaceRolloutStatusErrors]; +export type ListRolesError = ListRolesErrors[keyof ListRolesErrors]; -export type GetKeyspaceRolloutStatusResponses = { +export type ListRolesResponses = { /** - * Returns information about a keyspace's rollout + * Returns roles */ - 200: { + 200: PaginatedPostgresRole; +}; + +export type ListRolesResponse = ListRolesResponses[keyof ListRolesResponses]; + +export type CreateRoleData = { + body?: { /** - * The name of the keyspace + * Time to live in seconds */ - name: string; + ttl?: number; /** - * The current state of the rollout at the keyspace level + * Roles to inherit from */ - state: string; - shards: Array<{ - /** - * The name of the shard - */ - name: string; - /** - * The time at which the rollout started - */ - last_rollout_started_at: string; - /** - * The time at which the rollout completed - */ - last_rollout_finished_at: string; - /** - * The current state of the rollout at the shard level - */ - state: string; - }>; + inherited_roles?: Array< + | "pscale_managed" + | "pg_checkpoint" + | "pg_create_subscription" + | "pg_maintain" + | "pg_monitor" + | "pg_read_all_data" + | "pg_read_all_settings" + | "pg_read_all_stats" + | "pg_signal_backend" + | "pg_stat_scan_tables" + | "pg_use_reserved_connections" + | "pg_write_all_data" + | "postgres" + >; }; -}; - -export type GetKeyspaceRolloutStatusResponse = - GetKeyspaceRolloutStatusResponses[keyof GetKeyspaceRolloutStatusResponses]; - -export type ListParametersData = { - body?: never; path: { /** * The name of the organization that owns this resource @@ -8744,10 +11873,10 @@ export type ListParametersData = { branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/parameters"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles"; }; -export type ListParametersErrors = { +export type CreateRoleErrors = { /** * Unauthorized */ @@ -8766,53 +11895,38 @@ export type ListParametersErrors = { 500: GeneralError; }; -export type ListParametersError = - ListParametersErrors[keyof ListParametersErrors]; +export type CreateRoleError = CreateRoleErrors[keyof CreateRoleErrors]; -export type ListParametersResponses = { +export type CreateRoleResponses = { /** - * Returns cluster parameters + * Returns the new credentials */ - 200: Array; + 200: PostgresRole; }; -export type ListParametersResponse = - ListParametersResponses[keyof ListParametersResponses]; +export type CreateRoleResponse = CreateRoleResponses[keyof CreateRoleResponses]; -export type ListPasswordsData = { +export type GetDefaultRoleData = { body?: never; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; }; - query?: { - /** - * A read-only region of the database branch. If present, the password results will be filtered to only those in the region - */ - read_only_region_id?: string; - /** - * If provided, specifies the page offset of returned results - */ - page?: number; - /** - * If provided, specifies the number of returned results - */ - per_page?: number; - }; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords"; + query?: never; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/default"; }; -export type ListPasswordsErrors = { +export type GetDefaultRoleErrors = { /** * Unauthorized */ @@ -8831,60 +11945,40 @@ export type ListPasswordsErrors = { 500: GeneralError; }; -export type ListPasswordsError = ListPasswordsErrors[keyof ListPasswordsErrors]; +export type GetDefaultRoleError = + GetDefaultRoleErrors[keyof GetDefaultRoleErrors]; -export type ListPasswordsResponses = { +export type GetDefaultRoleResponses = { /** - * Returns passwords for the branch + * Returns the default postgres role */ - 200: PaginatedDatabaseBranchPassword; + 200: PostgresRole; }; -export type ListPasswordsResponse = - ListPasswordsResponses[keyof ListPasswordsResponses]; +export type GetDefaultRoleResponse = + GetDefaultRoleResponses[keyof GetDefaultRoleResponses]; -export type CreatePasswordData = { - body?: { - /** - * Optional name of the password - */ - name?: string; - /** - * The database role of the password (i.e. admin) - */ - role?: "reader" | "writer" | "admin" | "readwriter"; - /** - * Whether the password is for a read replica - */ - replica?: boolean; - /** - * Time to live (in seconds) for the password. The password will be invalid when TTL has passed - */ - ttl?: number; - /** - * List of IP addresses or CIDR ranges that can use this password - */ - cidrs?: Array; - }; +export type ResetDefaultRoleData = { + body?: never; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/reset-default"; }; -export type CreatePasswordErrors = { +export type ResetDefaultRoleErrors = { /** * Unauthorized */ @@ -8897,54 +11991,55 @@ export type CreatePasswordErrors = { * Not Found */ 404: GeneralError; - /** - * Unprocessable Content - */ - 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type CreatePasswordError = - CreatePasswordErrors[keyof CreatePasswordErrors]; +export type ResetDefaultRoleError = + ResetDefaultRoleErrors[keyof ResetDefaultRoleErrors]; -export type CreatePasswordResponses = { +export type ResetDefaultRoleResponses = { /** * Returns the new credentials */ - 201: DatabaseBranchPassword; + 200: PostgresRole; }; -export type CreatePasswordResponse = - CreatePasswordResponses[keyof CreatePasswordResponses]; +export type ResetDefaultRoleResponse = + ResetDefaultRoleResponses[keyof ResetDefaultRoleResponses]; -export type DeletePasswordData = { - body?: never; +export type DeleteRoleData = { + body?: { + /** + * The optional role to reassign ownership to before dropping + */ + successor?: string; + }; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; /** - * The ID of the password + * The ID of the role */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; }; -export type DeletePasswordErrors = { +export type DeleteRoleErrors = { /** * Unauthorized */ @@ -8963,41 +12058,40 @@ export type DeletePasswordErrors = { 500: GeneralError; }; -export type DeletePasswordError = - DeletePasswordErrors[keyof DeletePasswordErrors]; +export type DeleteRoleError = DeleteRoleErrors[keyof DeleteRoleErrors]; -export type DeletePasswordResponses = { +export type DeleteRoleResponses = { /** - * Deletes the password + * Deletes the role credentials */ 204: unknown; }; -export type GetPasswordData = { +export type GetRoleData = { body?: never; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; /** - * The ID of the password + * The ID of the role */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; }; -export type GetPasswordErrors = { +export type GetRoleErrors = { /** * Unauthorized */ @@ -9016,52 +12110,47 @@ export type GetPasswordErrors = { 500: GeneralError; }; -export type GetPasswordError = GetPasswordErrors[keyof GetPasswordErrors]; +export type GetRoleError = GetRoleErrors[keyof GetRoleErrors]; -export type GetPasswordResponses = { +export type GetRoleResponses = { /** - * Returns a password + * Returns a role */ - 200: DatabaseBranchPassword; + 200: PostgresRole; }; -export type GetPasswordResponse = - GetPasswordResponses[keyof GetPasswordResponses]; +export type GetRoleResponse = GetRoleResponses[keyof GetRoleResponses]; -export type UpdatePasswordData = { +export type UpdateRoleData = { body?: { /** - * The name for the password + * The new name of the role */ name?: string; - /** - * List of IP addresses or CIDR ranges that can use this password - */ - cidrs?: Array; }; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; /** - * The ID of the password + * The ID of the role */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; }; -export type UpdatePasswordErrors = { +export type UpdateRoleErrors = { /** * Unauthorized */ @@ -9080,44 +12169,47 @@ export type UpdatePasswordErrors = { 500: GeneralError; }; -export type UpdatePasswordError = - UpdatePasswordErrors[keyof UpdatePasswordErrors]; +export type UpdateRoleError = UpdateRoleErrors[keyof UpdateRoleErrors]; -export type UpdatePasswordResponses = { +export type UpdateRoleResponses = { /** - * Returns the updated password + * Returns the updated role */ - 200: DatabaseBranchPassword; + 200: PostgresRole; }; -export type UpdatePasswordResponse = - UpdatePasswordResponses[keyof UpdatePasswordResponses]; +export type UpdateRoleResponse = UpdateRoleResponses[keyof UpdateRoleResponses]; -export type RenewPasswordData = { - body?: never; +export type ReassignRoleObjectsData = { + body?: { + /** + * The role to reassign ownership to + */ + successor: string; + }; path: { /** - * The name of the organization the password belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the password belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch the password belongs to + * The name of the branch that owns this resource */ branch: string; /** - * The ID of the password + * The ID of the role */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}/renew"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reassign"; }; -export type RenewPasswordErrors = { +export type ReassignRoleObjectsErrors = { /** * Unauthorized */ @@ -9136,39 +12228,41 @@ export type RenewPasswordErrors = { 500: GeneralError; }; -export type RenewPasswordError = RenewPasswordErrors[keyof RenewPasswordErrors]; +export type ReassignRoleObjectsError = + ReassignRoleObjectsErrors[keyof ReassignRoleObjectsErrors]; -export type RenewPasswordResponses = { +export type ReassignRoleObjectsResponses = { /** - * Returns the renewed password + * Objects reassigned successfully */ - 200: DatabaseBranchPassword; + 204: unknown; }; -export type RenewPasswordResponse = - RenewPasswordResponses[keyof RenewPasswordResponses]; - -export type ListGeneratedQueryPatternsReportsData = { +export type RenewRoleData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch + * The name of the branch that owns this resource */ branch: string; + /** + * The ID of the role + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/renew"; }; -export type ListGeneratedQueryPatternsReportsErrors = { +export type RenewRoleErrors = { /** * Unauthorized */ @@ -9187,40 +12281,42 @@ export type ListGeneratedQueryPatternsReportsErrors = { 500: GeneralError; }; -export type ListGeneratedQueryPatternsReportsError = - ListGeneratedQueryPatternsReportsErrors[keyof ListGeneratedQueryPatternsReportsErrors]; +export type RenewRoleError = RenewRoleErrors[keyof RenewRoleErrors]; -export type ListGeneratedQueryPatternsReportsResponses = { +export type RenewRoleResponses = { /** - * Returns the generated query patterns reports + * Returns the renewed role */ - 200: PaginatedQueryPatternsDownload; + 200: PostgresRole; }; -export type ListGeneratedQueryPatternsReportsResponse = - ListGeneratedQueryPatternsReportsResponses[keyof ListGeneratedQueryPatternsReportsResponses]; +export type RenewRoleResponse = RenewRoleResponses[keyof RenewRoleResponses]; -export type CreateQueryPatternsReportData = { +export type ResetRoleData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the organization that owns this resource */ organization: string; /** - * The name of the database the branch belongs to + * The name of the database that owns this resource */ database: string; /** - * The name of the branch + * The name of the branch that owns this resource */ branch: string; + /** + * The ID of the role + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reset"; }; -export type CreateQueryPatternsReportErrors = { +export type ResetRoleErrors = { /** * Unauthorized */ @@ -9239,20 +12335,18 @@ export type CreateQueryPatternsReportErrors = { 500: GeneralError; }; -export type CreateQueryPatternsReportError = - CreateQueryPatternsReportErrors[keyof CreateQueryPatternsReportErrors]; +export type ResetRoleError = ResetRoleErrors[keyof ResetRoleErrors]; -export type CreateQueryPatternsReportResponses = { +export type ResetRoleResponses = { /** - * The created query patterns download + * Returns the role with new password */ - 201: QueryPatternsDownload; + 200: PostgresRole; }; -export type CreateQueryPatternsReportResponse = - CreateQueryPatternsReportResponses[keyof CreateQueryPatternsReportResponses]; +export type ResetRoleResponse = ResetRoleResponses[keyof ResetRoleResponses]; -export type DeleteQueryPatternsReportData = { +export type DisableSafeMigrationsData = { body?: never; path: { /** @@ -9267,16 +12361,12 @@ export type DeleteQueryPatternsReportData = { * The name of the branch */ branch: string; - /** - * The ID of the query patterns report - */ - id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations"; }; -export type DeleteQueryPatternsReportErrors = { +export type DisableSafeMigrationsErrors = { /** * Unauthorized */ @@ -9295,17 +12385,20 @@ export type DeleteQueryPatternsReportErrors = { 500: GeneralError; }; -export type DeleteQueryPatternsReportError = - DeleteQueryPatternsReportErrors[keyof DeleteQueryPatternsReportErrors]; +export type DisableSafeMigrationsError = + DisableSafeMigrationsErrors[keyof DisableSafeMigrationsErrors]; -export type DeleteQueryPatternsReportResponses = { +export type DisableSafeMigrationsResponses = { /** - * Delete a query patterns report + * Returns the branch with safe migrations disabled */ - 204: unknown; + 200: DatabaseBranch; }; -export type GetQueryPatternsReportStatusData = { +export type DisableSafeMigrationsResponse = + DisableSafeMigrationsResponses[keyof DisableSafeMigrationsResponses]; + +export type EnableSafeMigrationsData = { body?: never; path: { /** @@ -9320,16 +12413,12 @@ export type GetQueryPatternsReportStatusData = { * The name of the branch */ branch: string; - /** - * The ID of the query patterns report - */ - id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations"; }; -export type GetQueryPatternsReportStatusErrors = { +export type EnableSafeMigrationsErrors = { /** * Unauthorized */ @@ -9348,20 +12437,20 @@ export type GetQueryPatternsReportStatusErrors = { 500: GeneralError; }; -export type GetQueryPatternsReportStatusError = - GetQueryPatternsReportStatusErrors[keyof GetQueryPatternsReportStatusErrors]; +export type EnableSafeMigrationsError = + EnableSafeMigrationsErrors[keyof EnableSafeMigrationsErrors]; -export type GetQueryPatternsReportStatusResponses = { +export type EnableSafeMigrationsResponses = { /** - * The retrieved query patterns download + * Returns the branch with safe migrations enabled */ - 200: QueryPatternsDownload; + 200: DatabaseBranch; }; -export type GetQueryPatternsReportStatusResponse = - GetQueryPatternsReportStatusResponses[keyof GetQueryPatternsReportStatusResponses]; +export type EnableSafeMigrationsResponse = + EnableSafeMigrationsResponses[keyof EnableSafeMigrationsResponses]; -export type GetQueryPatternsReportData = { +export type GetBranchSchemaData = { body?: never; path: { /** @@ -9376,16 +12465,21 @@ export type GetQueryPatternsReportData = { * The name of the branch */ branch: string; + }; + query?: { /** - * The ID of the query patterns report + * Return the schema for a single Vitess keyspace */ - id: string; + keyspace?: string; + /** + * Return the schema for a PostgreSQL catalog namespace in `.` format (e.g. public.schema1) + */ + namespace?: string; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}/download"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/schema"; }; -export type GetQueryPatternsReportErrors = { +export type GetBranchSchemaErrors = { /** * Unauthorized */ @@ -9404,30 +12498,64 @@ export type GetQueryPatternsReportErrors = { 500: GeneralError; }; -export type GetQueryPatternsReportError = - GetQueryPatternsReportErrors[keyof GetQueryPatternsReportErrors]; +export type GetBranchSchemaError = + GetBranchSchemaErrors[keyof GetBranchSchemaErrors]; -export type CancelBranchChangeRequestData = { +export type GetBranchSchemaResponses = { + /** + * Gets the schema for the branch + */ + 200: { + data: Array<{ + /** + * Name of the table + */ + name: string; + /** + * Syntax highlighted HTML for the table's schema + */ + html: string; + /** + * The table's schema + */ + raw: string; + }>; + }; +}; + +export type GetBranchSchemaResponse = + GetBranchSchemaResponses[keyof GetBranchSchemaResponses]; + +export type LintBranchSchemaData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the branch belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database the branch belongs to + */ + database: string; + /** + * The name of the branch + */ + branch: string; + }; + query?: { + /** + * If provided, specifies the page offset of returned results */ - database: string; + page?: number; /** - * The name of the branch that owns this resource + * If provided, specifies the number of returned results */ - branch: string; + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/resizes"; + url: "/organizations/{organization}/databases/{database}/branches/{branch}/schema/lint"; }; -export type CancelBranchChangeRequestErrors = { +export type LintBranchSchemaErrors = { /** * Unauthorized */ @@ -9446,31 +12574,30 @@ export type CancelBranchChangeRequestErrors = { 500: GeneralError; }; -export type CancelBranchChangeRequestError = - CancelBranchChangeRequestErrors[keyof CancelBranchChangeRequestErrors]; +export type LintBranchSchemaError = + LintBranchSchemaErrors[keyof LintBranchSchemaErrors]; -export type CancelBranchChangeRequestResponses = { +export type LintBranchSchemaResponses = { /** - * Cancels a change request + * Returns a list of schema errors for a branch */ - 204: unknown; + 200: PaginatedSchemaLintError; }; -export type ListRolesData = { +export type LintBranchSchemaResponse = + LintBranchSchemaResponses[keyof LintBranchSchemaResponses]; + +export type ListDatabasePostgresCidrsData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the database belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database */ database: string; - /** - * The name of the branch that owns this resource - */ - branch: string; }; query?: { /** @@ -9482,10 +12609,10 @@ export type ListRolesData = { */ per_page?: number; }; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles"; + url: "/organizations/{organization}/databases/{database}/cidrs"; }; -export type ListRolesErrors = { +export type ListDatabasePostgresCidrsErrors = { /** * Unauthorized */ @@ -9498,66 +12625,59 @@ export type ListRolesErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Invalid parameters or validation errors + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type ListRolesError = ListRolesErrors[keyof ListRolesErrors]; +export type ListDatabasePostgresCidrsError = + ListDatabasePostgresCidrsErrors[keyof ListDatabasePostgresCidrsErrors]; -export type ListRolesResponses = { +export type ListDatabasePostgresCidrsResponses = { /** - * Returns roles + * Returns IP restriction entries for the database */ - 200: PaginatedPostgresRole; + 200: PaginatedPostgresClusterCidr; }; -export type ListRolesResponse = ListRolesResponses[keyof ListRolesResponses]; +export type ListDatabasePostgresCidrsResponse = + ListDatabasePostgresCidrsResponses[keyof ListDatabasePostgresCidrsResponses]; -export type CreateRoleData = { +export type CreateDatabasePostgresCidrData = { body?: { /** - * Time to live in seconds + * The PostgreSQL schema to restrict access to. Leave empty or omit to allow access to all schemas. */ - ttl?: number; + schema?: string; /** - * Roles to inherit from + * The PostgreSQL role to restrict access to. Leave empty or omit to allow access for all roles. */ - inherited_roles?: Array< - | "pg_checkpoint" - | "pg_create_subscription" - | "pg_maintain" - | "pg_monitor" - | "pg_read_all_data" - | "pg_read_all_settings" - | "pg_read_all_stats" - | "pg_signal_backend" - | "pg_stat_scan_tables" - | "pg_use_reserved_connections" - | "pg_write_all_data" - | "postgres" - >; + role?: string; + /** + * List of IPv4 CIDR ranges (e.g., ['192.168.1.0/24', '192.168.1.1/32']). Must contain at least one valid IPv4 address or range. + */ + cidrs: Array; }; path: { /** - * The name of the organization that owns this resource + * The name of the organization the database belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database */ database: string; - /** - * The name of the branch that owns this resource - */ - branch: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles"; + url: "/organizations/{organization}/databases/{database}/cidrs"; }; -export type CreateRoleErrors = { +export type CreateDatabasePostgresCidrErrors = { /** * Unauthorized */ @@ -9570,53 +12690,50 @@ export type CreateRoleErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Invalid parameters or validation errors + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type CreateRoleError = CreateRoleErrors[keyof CreateRoleErrors]; +export type CreateDatabasePostgresCidrError = + CreateDatabasePostgresCidrErrors[keyof CreateDatabasePostgresCidrErrors]; -export type CreateRoleResponses = { +export type CreateDatabasePostgresCidrResponses = { /** - * Returns the new credentials + * Returns the created IP restriction entry */ - 200: PostgresRole; + 201: PostgresClusterCidr; }; -export type CreateRoleResponse = CreateRoleResponses[keyof CreateRoleResponses]; +export type CreateDatabasePostgresCidrResponse = + CreateDatabasePostgresCidrResponses[keyof CreateDatabasePostgresCidrResponses]; -export type DeleteRoleData = { - body?: { - /** - * The optional role to reassign ownership to before dropping - */ - successor?: string; - }; +export type DeleteDatabasePostgresCidrData = { + body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the database belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database */ database: string; /** - * The name of the branch that owns this resource - */ - branch: string; - /** - * The ID of the role + * The ID of the IP restriction entry */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; + url: "/organizations/{organization}/databases/{database}/cidrs/{id}"; }; -export type DeleteRoleErrors = { +export type DeleteDatabasePostgresCidrErrors = { /** * Unauthorized */ @@ -9629,46 +12746,47 @@ export type DeleteRoleErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Invalid parameters or validation errors + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type DeleteRoleError = DeleteRoleErrors[keyof DeleteRoleErrors]; +export type DeleteDatabasePostgresCidrError = + DeleteDatabasePostgresCidrErrors[keyof DeleteDatabasePostgresCidrErrors]; -export type DeleteRoleResponses = { +export type DeleteDatabasePostgresCidrResponses = { /** - * Deletes the role credentials + * IP restriction entry deleted successfully. Note: This will also remove the restriction from all database branches. */ 204: unknown; }; -export type GetRoleData = { +export type GetDatabasePostgresCidrData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the organization the database belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database */ database: string; /** - * The name of the branch that owns this resource - */ - branch: string; - /** - * The ID of the role + * The ID of the IP restriction entry */ id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; + url: "/organizations/{organization}/databases/{database}/cidrs/{id}"; }; -export type GetRoleErrors = { +export type GetDatabasePostgresCidrErrors = { /** * Unauthorized */ @@ -9681,53 +12799,115 @@ export type GetRoleErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Invalid parameters or validation errors + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type GetRoleError = GetRoleErrors[keyof GetRoleErrors]; +export type GetDatabasePostgresCidrError = + GetDatabasePostgresCidrErrors[keyof GetDatabasePostgresCidrErrors]; -export type GetRoleResponses = { +export type GetDatabasePostgresCidrResponses = { /** - * Returns a role + * Returns an IP restriction entry */ - 200: PostgresRole; + 200: PostgresClusterCidr; }; -export type GetRoleResponse = GetRoleResponses[keyof GetRoleResponses]; +export type GetDatabasePostgresCidrResponse = + GetDatabasePostgresCidrResponses[keyof GetDatabasePostgresCidrResponses]; -export type UpdateRoleData = { +export type UpdateDatabasePostgresCidrData = { body?: { /** - * The new name of the role + * The PostgreSQL schema to restrict access to. Leave empty to allow access to all schemas. */ - name?: string; + schema?: string; + /** + * The PostgreSQL role to restrict access to. Leave empty to allow access for all roles. + */ + role?: string; + /** + * List of IPv4 CIDR ranges (e.g., ['192.168.1.0/24', '192.168.1.1/32']). Only provided fields will be updated. + */ + cidrs?: Array; }; path: { /** - * The name of the organization that owns this resource + * The name of the organization the database belongs to */ organization: string; /** - * The name of the database that owns this resource + * The name of the database */ database: string; /** - * The name of the branch that owns this resource + * The ID of the IP restriction entry */ - branch: string; + id: string; + }; + query?: never; + url: "/organizations/{organization}/databases/{database}/cidrs/{id}"; +}; + +export type UpdateDatabasePostgresCidrErrors = { + /** + * Unauthorized + */ + 401: GeneralError; + /** + * Forbidden + */ + 403: GeneralError; + /** + * Not Found + */ + 404: GeneralError; + /** + * Unprocessable Entity - Invalid parameters or validation errors + */ + 422: GeneralError; + /** + * Internal Server Error + */ + 500: GeneralError; +}; + +export type UpdateDatabasePostgresCidrError = + UpdateDatabasePostgresCidrErrors[keyof UpdateDatabasePostgresCidrErrors]; + +export type UpdateDatabasePostgresCidrResponses = { + /** + * Returns the updated IP restriction entry + */ + 200: PostgresClusterCidr; +}; + +export type UpdateDatabasePostgresCidrResponse = + UpdateDatabasePostgresCidrResponses[keyof UpdateDatabasePostgresCidrResponses]; + +export type GetDeployQueueData = { + body?: never; + path: { /** - * The ID of the role + * The name of the deploy request's organization */ - id: string; + organization: string; + /** + * The name of the deploy request's database + */ + database: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}"; + url: "/organizations/{organization}/databases/{database}/deploy-queue"; }; -export type UpdateRoleErrors = { +export type GetDeployQueueErrors = { /** * Unauthorized */ @@ -9746,42 +12926,65 @@ export type UpdateRoleErrors = { 500: GeneralError; }; -export type UpdateRoleError = UpdateRoleErrors[keyof UpdateRoleErrors]; +export type GetDeployQueueError = + GetDeployQueueErrors[keyof GetDeployQueueErrors]; -export type UpdateRoleResponses = { +export type GetDeployQueueResponses = { /** - * Returns the updated role + * Returns the deploy queue for a database */ - 200: PostgresRole; + 200: PaginatedDeployment; }; -export type UpdateRoleResponse = UpdateRoleResponses[keyof UpdateRoleResponses]; +export type GetDeployQueueResponse = + GetDeployQueueResponses[keyof GetDeployQueueResponses]; -export type RenewRoleData = { +export type ListDeployRequestsData = { body?: never; path: { /** - * The name of the organization that owns this resource + * The name of the deploy request's organization */ organization: string; /** - * The name of the database that owns this resource + * The name of the deploy request's database */ database: string; + }; + query?: { /** - * The name of the branch that owns this resource + * Filter by state of the deploy request (open, closed, deployed) */ - branch: string; + state?: string; /** - * The ID of the role + * Filter by the name of the branch the deploy request is created from */ - id: string; + branch?: string; + /** + * Filter by the name of the branch the deploy request will be merged into + */ + into_branch?: string; + /** + * Filter deploy requests by the date they were deployed. (e.g. 2023-01-01T00:00:00Z..2023-01-31T23:59:59Z) + */ + deployed_at?: string; + /** + * Filter deploy requests by the date they were running. (e.g. 2023-01-01T00:00:00Z..2023-01-31T23:59:59Z) + */ + running_at?: string; + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/renew"; + url: "/organizations/{organization}/databases/{database}/deploy-requests"; }; -export type RenewRoleErrors = { +export type ListDeployRequestsErrors = { /** * Unauthorized */ @@ -9800,38 +13003,57 @@ export type RenewRoleErrors = { 500: GeneralError; }; -export type RenewRoleError = RenewRoleErrors[keyof RenewRoleErrors]; +export type ListDeployRequestsError = + ListDeployRequestsErrors[keyof ListDeployRequestsErrors]; -export type RenewRoleResponses = { +export type ListDeployRequestsResponses = { /** - * Returns the renewed role + * Returns a list of deploy requests */ - 200: PostgresRole; + 200: PaginatedDatabaseDeployRequest; }; -export type RenewRoleResponse = RenewRoleResponses[keyof RenewRoleResponses]; +export type ListDeployRequestsResponse = + ListDeployRequestsResponses[keyof ListDeployRequestsResponses]; -export type DeleteBranchData = { - body?: never; +export type CreateDeployRequestData = { + body?: { + /** + * The name of the branch the deploy request is created from + */ + branch: string; + /** + * The name of the branch the deploy request will be merged into + */ + into_branch: string; + /** + * Notes about the deploy request + */ + notes?: string; + /** + * Whether or not to enable auto_cutover for the deploy request. When enabled, will auto cutover to the new schema as soon as it is ready. + */ + auto_cutover?: boolean; + /** + * Whether or not to enable auto_delete_branch for the deploy request. When enabled, will delete the branch once the DR successfully completes. + */ + auto_delete_branch?: boolean; + }; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; - /** - * The name of the branch - */ - name: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}"; + url: "/organizations/{organization}/databases/{database}/deploy-requests"; }; -export type DeleteBranchErrors = { +export type CreateDeployRequestErrors = { /** * Unauthorized */ @@ -9850,36 +13072,40 @@ export type DeleteBranchErrors = { 500: GeneralError; }; -export type DeleteBranchError = DeleteBranchErrors[keyof DeleteBranchErrors]; +export type CreateDeployRequestError = + CreateDeployRequestErrors[keyof CreateDeployRequestErrors]; -export type DeleteBranchResponses = { +export type CreateDeployRequestResponses = { /** - * Delete a branch + * Returns the created deploy request */ - 204: unknown; + 201: DatabaseDeployRequest; }; -export type GetBranchData = { +export type CreateDeployRequestResponse = + CreateDeployRequestResponses[keyof CreateDeployRequestResponses]; + +export type GetDeployRequestData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}"; }; -export type GetBranchErrors = { +export type GetDeployRequestErrors = { /** * Unauthorized */ @@ -9898,43 +13124,45 @@ export type GetBranchErrors = { 500: GeneralError; }; -export type GetBranchError = GetBranchErrors[keyof GetBranchErrors]; +export type GetDeployRequestError = + GetDeployRequestErrors[keyof GetDeployRequestErrors]; -export type GetBranchResponses = { +export type GetDeployRequestResponses = { /** - * Returns information about a branch + * Returns information about a deploy request */ - 200: DatabaseBranch; + 200: DatabaseDeployRequest; }; -export type GetBranchResponse = GetBranchResponses[keyof GetBranchResponses]; +export type GetDeployRequestResponse = + GetDeployRequestResponses[keyof GetDeployRequestResponses]; -export type UpdateBranchClusterConfigData = { +export type CloseDeployRequestData = { body?: { /** - * The new size of the database cluster: PS_10, PS_20,… + * The deploy request will be updated to this state */ - cluster_size: string; + state?: "closed"; }; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch to configure + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}/cluster"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}"; }; -export type UpdateBranchClusterConfigErrors = { +export type CloseDeployRequestErrors = { /** * Unauthorized */ @@ -9953,37 +13181,40 @@ export type UpdateBranchClusterConfigErrors = { 500: GeneralError; }; -export type UpdateBranchClusterConfigError = - UpdateBranchClusterConfigErrors[keyof UpdateBranchClusterConfigErrors]; +export type CloseDeployRequestError = + CloseDeployRequestErrors[keyof CloseDeployRequestErrors]; -export type UpdateBranchClusterConfigResponses = { +export type CloseDeployRequestResponses = { /** - * Returns an empty response body + * Returns the updated deploy request */ - 204: unknown; + 200: DatabaseDeployRequest; }; -export type DemoteBranchData = { +export type CloseDeployRequestResponse = + CloseDeployRequestResponses[keyof CloseDeployRequestResponses]; + +export type CompleteGatedDeployRequestData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}/demote"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/apply-deploy"; }; -export type DemoteBranchErrors = { +export type CompleteGatedDeployRequestErrors = { /** * Unauthorized */ @@ -10002,39 +13233,45 @@ export type DemoteBranchErrors = { 500: GeneralError; }; -export type DemoteBranchError = DemoteBranchErrors[keyof DemoteBranchErrors]; +export type CompleteGatedDeployRequestError = + CompleteGatedDeployRequestErrors[keyof CompleteGatedDeployRequestErrors]; -export type DemoteBranchResponses = { +export type CompleteGatedDeployRequestResponses = { /** - * Returns a development branch + * Returns the deploy request whose deployment has been completed */ - 200: DatabaseBranch; + 200: DatabaseDeployRequest; }; -export type DemoteBranchResponse = - DemoteBranchResponses[keyof DemoteBranchResponses]; +export type CompleteGatedDeployRequestResponse = + CompleteGatedDeployRequestResponses[keyof CompleteGatedDeployRequestResponses]; -export type PromoteBranchData = { - body?: never; +export type UpdateAutoApplyData = { + body?: { + /** + * Whether or not to enable auto-apply for the deploy request + */ + enable?: boolean; + }; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}/promote"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-apply"; }; -export type PromoteBranchErrors = { +export type UpdateAutoApplyErrors = { /** * Unauthorized */ @@ -10053,39 +13290,45 @@ export type PromoteBranchErrors = { 500: GeneralError; }; -export type PromoteBranchError = PromoteBranchErrors[keyof PromoteBranchErrors]; +export type UpdateAutoApplyError = + UpdateAutoApplyErrors[keyof UpdateAutoApplyErrors]; -export type PromoteBranchResponses = { +export type UpdateAutoApplyResponses = { /** - * Returns a production branch + * Returns the deploy request whose auto-apply setting was updated */ - 200: DatabaseBranch; + 200: DatabaseDeployRequest; }; -export type PromoteBranchResponse = - PromoteBranchResponses[keyof PromoteBranchResponses]; +export type UpdateAutoApplyResponse = + UpdateAutoApplyResponses[keyof UpdateAutoApplyResponses]; -export type DisableSafeMigrationsData = { - body?: never; +export type UpdateAutoDeleteBranchData = { + body?: { + /** + * Whether or not to enable auto-delete branch for the deploy request + */ + enable?: boolean; + }; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}/safe-migrations"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-delete-branch"; }; -export type DisableSafeMigrationsErrors = { +export type UpdateAutoDeleteBranchErrors = { /** * Unauthorized */ @@ -10104,40 +13347,40 @@ export type DisableSafeMigrationsErrors = { 500: GeneralError; }; -export type DisableSafeMigrationsError = - DisableSafeMigrationsErrors[keyof DisableSafeMigrationsErrors]; +export type UpdateAutoDeleteBranchError = + UpdateAutoDeleteBranchErrors[keyof UpdateAutoDeleteBranchErrors]; -export type DisableSafeMigrationsResponses = { +export type UpdateAutoDeleteBranchResponses = { /** - * Returns the branch with safe migrations disabled + * Returns the deploy request whose auto-delete branch setting was updated */ - 200: DatabaseBranch; + 200: DatabaseDeployRequest; }; -export type DisableSafeMigrationsResponse = - DisableSafeMigrationsResponses[keyof DisableSafeMigrationsResponses]; +export type UpdateAutoDeleteBranchResponse = + UpdateAutoDeleteBranchResponses[keyof UpdateAutoDeleteBranchResponses]; -export type EnableSafeMigrationsData = { +export type CancelDeployRequestData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch + * The number of the deploy request */ - name: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/branches/{name}/safe-migrations"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/cancel"; }; -export type EnableSafeMigrationsErrors = { +export type CancelDeployRequestErrors = { /** * Unauthorized */ @@ -10156,49 +13399,40 @@ export type EnableSafeMigrationsErrors = { 500: GeneralError; }; -export type EnableSafeMigrationsError = - EnableSafeMigrationsErrors[keyof EnableSafeMigrationsErrors]; +export type CancelDeployRequestError = + CancelDeployRequestErrors[keyof CancelDeployRequestErrors]; -export type EnableSafeMigrationsResponses = { +export type CancelDeployRequestResponses = { /** - * Returns the branch with safe migrations enabled + * Returns the deploy request whose deployment was canceled */ - 200: DatabaseBranch; + 200: DatabaseDeployRequest; }; -export type EnableSafeMigrationsResponse = - EnableSafeMigrationsResponses[keyof EnableSafeMigrationsResponses]; +export type CancelDeployRequestResponse = + CancelDeployRequestResponses[keyof CancelDeployRequestResponses]; -export type GetBranchSchemaData = { +export type CompleteErroredDeployData = { body?: never; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch - */ - name: string; - }; - query?: { - /** - * Return the schema for a single Vitess keyspace - */ - keyspace?: string; - /** - * Return the schema for a PostgreSQL catalog namespace in `.` format (e.g. public.schema1) + * The number of the deploy request */ - namespace?: string; + number: number; }; - url: "/organizations/{organization}/databases/{database}/branches/{name}/schema"; + query?: never; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/complete-deploy"; }; -export type GetBranchSchemaErrors = { +export type CompleteErroredDeployErrors = { /** * Unauthorized */ @@ -10217,64 +13451,45 @@ export type GetBranchSchemaErrors = { 500: GeneralError; }; -export type GetBranchSchemaError = - GetBranchSchemaErrors[keyof GetBranchSchemaErrors]; - -export type GetBranchSchemaResponses = { - /** - * Gets the schema for the branch - */ - 200: { - data: Array<{ - /** - * Name of the table - */ - name: string; - /** - * Syntax highlighted HTML for the table's schema - */ - html: string; - /** - * The table's schema - */ - raw: string; - }>; - }; +export type CompleteErroredDeployError = + CompleteErroredDeployErrors[keyof CompleteErroredDeployErrors]; + +export type CompleteErroredDeployResponses = { + /** + * Returns the completed deploy request + */ + 200: DatabaseDeployRequest; }; -export type GetBranchSchemaResponse = - GetBranchSchemaResponses[keyof GetBranchSchemaResponses]; +export type CompleteErroredDeployResponse = + CompleteErroredDeployResponses[keyof CompleteErroredDeployResponses]; -export type LintBranchSchemaData = { - body?: never; +export type QueueDeployRequestData = { + body?: { + /** + * Whether or not to deploy the request with instant DDL. Defaults to false. + */ + instant_ddl?: boolean; + }; path: { /** - * The name of the organization the branch belongs to + * The name of the deploy request's organization */ organization: string; /** - * The name of the database the branch belongs to + * The name of the deploy request's database */ database: string; /** - * The name of the branch - */ - name: string; - }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; - /** - * If provided, specifies the number of returned results + * The number of the deploy request */ - per_page?: number; + number: number; }; - url: "/organizations/{organization}/databases/{database}/branches/{name}/schema/lint"; + query?: never; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deploy"; }; -export type LintBranchSchemaErrors = { +export type QueueDeployRequestErrors = { /** * Unauthorized */ @@ -10293,20 +13508,20 @@ export type LintBranchSchemaErrors = { 500: GeneralError; }; -export type LintBranchSchemaError = - LintBranchSchemaErrors[keyof LintBranchSchemaErrors]; +export type QueueDeployRequestError = + QueueDeployRequestErrors[keyof QueueDeployRequestErrors]; -export type LintBranchSchemaResponses = { +export type QueueDeployRequestResponses = { /** - * Returns a list of schema errors for a branch + * Returns the deployed deploy request */ - 200: PaginatedSchemaLintError; + 200: DatabaseDeployRequest; }; -export type LintBranchSchemaResponse = - LintBranchSchemaResponses[keyof LintBranchSchemaResponses]; +export type QueueDeployRequestResponse = + QueueDeployRequestResponses[keyof QueueDeployRequestResponses]; -export type GetDeployQueueData = { +export type GetDeploymentData = { body?: never; path: { /** @@ -10317,12 +13532,16 @@ export type GetDeployQueueData = { * The name of the deploy request's database */ database: string; + /** + * The number of the deploy request + */ + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-queue"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deployment"; }; -export type GetDeployQueueErrors = { +export type GetDeploymentErrors = { /** * Unauthorized */ @@ -10341,22 +13560,25 @@ export type GetDeployQueueErrors = { 500: GeneralError; }; -export type GetDeployQueueError = - GetDeployQueueErrors[keyof GetDeployQueueErrors]; +export type GetDeploymentError = GetDeploymentErrors[keyof GetDeploymentErrors]; -export type GetDeployQueueResponses = { +export type GetDeploymentResponses = { /** - * Returns the deploy queue for a database + * Returns the deployment for a deploy request */ - 200: PaginatedDeployment; + 200: Deployment; }; -export type GetDeployQueueResponse = - GetDeployQueueResponses[keyof GetDeployQueueResponses]; +export type GetDeploymentResponse = + GetDeploymentResponses[keyof GetDeploymentResponses]; -export type ListDeployRequestsData = { +export type ListDeployOperationsData = { body?: never; path: { + /** + * The number of the deploy request + */ + number: number; /** * The name of the deploy request's organization */ @@ -10367,26 +13589,6 @@ export type ListDeployRequestsData = { database: string; }; query?: { - /** - * Filter by state of the deploy request (open, closed, deployed) - */ - state?: string; - /** - * Filter by the name of the branch the deploy request is created from - */ - branch?: string; - /** - * Filter by the name of the branch the deploy request will be merged into - */ - into_branch?: string; - /** - * Filter deploy requests by the date they were deployed. (e.g. 2023-01-01T00:00:00Z..2023-01-31T23:59:59Z) - */ - deployed_at?: string; - /** - * Filter deploy requests by the date they were running. (e.g. 2023-01-01T00:00:00Z..2023-01-31T23:59:59Z) - */ - running_at?: string; /** * If provided, specifies the page offset of returned results */ @@ -10396,10 +13598,10 @@ export type ListDeployRequestsData = { */ per_page?: number; }; - url: "/organizations/{organization}/databases/{database}/deploy-requests"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/operations"; }; -export type ListDeployRequestsErrors = { +export type ListDeployOperationsErrors = { /** * Unauthorized */ @@ -10418,42 +13620,21 @@ export type ListDeployRequestsErrors = { 500: GeneralError; }; -export type ListDeployRequestsError = - ListDeployRequestsErrors[keyof ListDeployRequestsErrors]; +export type ListDeployOperationsError = + ListDeployOperationsErrors[keyof ListDeployOperationsErrors]; -export type ListDeployRequestsResponses = { +export type ListDeployOperationsResponses = { /** - * Returns a list of deploy requests + * Returns deploy operations for the deploy request */ - 200: PaginatedDatabaseDeployRequest; + 200: PaginatedDeployOperation; }; -export type ListDeployRequestsResponse = - ListDeployRequestsResponses[keyof ListDeployRequestsResponses]; +export type ListDeployOperationsResponse = + ListDeployOperationsResponses[keyof ListDeployOperationsResponses]; -export type CreateDeployRequestData = { - body?: { - /** - * The name of the branch the deploy request is created from - */ - branch: string; - /** - * The name of the branch the deploy request will be merged into - */ - into_branch: string; - /** - * Notes about the deploy request - */ - notes?: string; - /** - * Whether or not to enable auto_cutover for the deploy request. When enabled, will auto cutover to the new schema as soon as it is ready. - */ - auto_cutover?: boolean; - /** - * Whether or not to enable auto_delete_branch for the deploy request. When enabled, will delete the branch once the DR successfully completes. - */ - auto_delete_branch?: boolean; - }; +export type CompleteRevertData = { + body?: never; path: { /** * The name of the deploy request's organization @@ -10463,12 +13644,16 @@ export type CreateDeployRequestData = { * The name of the deploy request's database */ database: string; + /** + * The number of the deploy request + */ + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/revert"; }; -export type CreateDeployRequestErrors = { +export type CompleteRevertErrors = { /** * Unauthorized */ @@ -10487,40 +13672,40 @@ export type CreateDeployRequestErrors = { 500: GeneralError; }; -export type CreateDeployRequestError = - CreateDeployRequestErrors[keyof CreateDeployRequestErrors]; +export type CompleteRevertError = + CompleteRevertErrors[keyof CompleteRevertErrors]; -export type CreateDeployRequestResponses = { +export type CompleteRevertResponses = { /** - * Returns the created deploy request + * Returns the deploy request that was reverted */ - 201: DatabaseDeployRequest; + 200: DatabaseDeployRequest; }; -export type CreateDeployRequestResponse = - CreateDeployRequestResponses[keyof CreateDeployRequestResponses]; +export type CompleteRevertResponse = + CompleteRevertResponses[keyof CompleteRevertResponses]; -export type GetDeployRequestData = { +export type ListDeployRequestReviewsData = { body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization the deploy request belongs to */ organization: string; /** - * The name of the deploy request's database + * The name of the database the deploy request belongs to */ database: string; /** * The number of the deploy request */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews"; }; -export type GetDeployRequestErrors = { +export type ListDeployRequestReviewsErrors = { /** * Unauthorized */ @@ -10539,45 +13724,49 @@ export type GetDeployRequestErrors = { 500: GeneralError; }; -export type GetDeployRequestError = - GetDeployRequestErrors[keyof GetDeployRequestErrors]; +export type ListDeployRequestReviewsError = + ListDeployRequestReviewsErrors[keyof ListDeployRequestReviewsErrors]; -export type GetDeployRequestResponses = { +export type ListDeployRequestReviewsResponses = { /** - * Returns information about a deploy request + * Returns an array of deploy request reviews */ - 200: DatabaseDeployRequest; + 200: PaginatedDeployRequestReview; }; -export type GetDeployRequestResponse = - GetDeployRequestResponses[keyof GetDeployRequestResponses]; +export type ListDeployRequestReviewsResponse = + ListDeployRequestReviewsResponses[keyof ListDeployRequestReviewsResponses]; -export type CloseDeployRequestData = { +export type ReviewDeployRequestData = { body?: { /** - * The deploy request will be updated to this state + * Whether the review is a comment or approval. Service tokens must have corresponding access (either `approve_deploy_request` or `review_deploy_request`) */ - state?: "closed"; + state?: "commented" | "approved"; + /** + * Deploy request review comments + */ + body?: string; }; path: { /** - * The name of the deploy request's organization + * The name of the organization the deploy request belongs to */ organization: string; /** - * The name of the deploy request's database + * The name of the database the deploy request belongs to */ database: string; /** * The number of the deploy request */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews"; }; -export type CloseDeployRequestErrors = { +export type ReviewDeployRequestErrors = { /** * Unauthorized */ @@ -10596,20 +13785,20 @@ export type CloseDeployRequestErrors = { 500: GeneralError; }; -export type CloseDeployRequestError = - CloseDeployRequestErrors[keyof CloseDeployRequestErrors]; +export type ReviewDeployRequestError = + ReviewDeployRequestErrors[keyof ReviewDeployRequestErrors]; -export type CloseDeployRequestResponses = { +export type ReviewDeployRequestResponses = { /** - * Returns the updated deploy request + * Returns the created deploy request review */ - 200: DatabaseDeployRequest; + 201: DeployRequestReview; }; -export type CloseDeployRequestResponse = - CloseDeployRequestResponses[keyof CloseDeployRequestResponses]; +export type ReviewDeployRequestResponse = + ReviewDeployRequestResponses[keyof ReviewDeployRequestResponses]; -export type CompleteGatedDeployRequestData = { +export type SkipRevertPeriodData = { body?: never; path: { /** @@ -10623,13 +13812,13 @@ export type CompleteGatedDeployRequestData = { /** * The number of the deploy request */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/apply-deploy"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/skip-revert"; }; -export type CompleteGatedDeployRequestErrors = { +export type SkipRevertPeriodErrors = { /** * Unauthorized */ @@ -10648,26 +13837,21 @@ export type CompleteGatedDeployRequestErrors = { 500: GeneralError; }; -export type CompleteGatedDeployRequestError = - CompleteGatedDeployRequestErrors[keyof CompleteGatedDeployRequestErrors]; +export type SkipRevertPeriodError = + SkipRevertPeriodErrors[keyof SkipRevertPeriodErrors]; -export type CompleteGatedDeployRequestResponses = { +export type SkipRevertPeriodResponses = { /** - * Returns the deploy request whose deployment has been completed + * Returns the deploy request whose deploy revert was skipped */ 200: DatabaseDeployRequest; }; -export type CompleteGatedDeployRequestResponse = - CompleteGatedDeployRequestResponses[keyof CompleteGatedDeployRequestResponses]; - -export type UpdateAutoApplyData = { - body?: { - /** - * Whether or not to enable auto-apply for the deploy request - */ - enable?: boolean; - }; +export type SkipRevertPeriodResponse = + SkipRevertPeriodResponses[keyof SkipRevertPeriodResponses]; + +export type GetDeployRequestThrottlerData = { + body?: never; path: { /** * The name of the deploy request's organization @@ -10680,13 +13864,13 @@ export type UpdateAutoApplyData = { /** * The number of the deploy request */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-apply"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler"; }; -export type UpdateAutoApplyErrors = { +export type GetDeployRequestThrottlerErrors = { /** * Unauthorized */ @@ -10705,21 +13889,30 @@ export type UpdateAutoApplyErrors = { 500: GeneralError; }; -export type UpdateAutoApplyError = - UpdateAutoApplyErrors[keyof UpdateAutoApplyErrors]; +export type GetDeployRequestThrottlerError = + GetDeployRequestThrottlerErrors[keyof GetDeployRequestThrottlerErrors]; -export type UpdateAutoApplyResponses = { +export type GetDeployRequestThrottlerResponses = { /** - * Returns the deploy request whose auto-apply setting was updated + * Deploy request throttler configurations */ - 200: DatabaseDeployRequest; + 200: ThrottlerConfigurations; }; -export type UpdateAutoApplyResponse = - UpdateAutoApplyResponses[keyof UpdateAutoApplyResponses]; +export type GetDeployRequestThrottlerResponse = + GetDeployRequestThrottlerResponses[keyof GetDeployRequestThrottlerResponses]; -export type CancelDeployRequestData = { - body?: never; +export type UpdateDeployRequestThrottlerData = { + body?: { + /** + * A throttler ratio between 0 and 95 that will apply to all keyspaces affected by the deploy request. 0 effectively disables throttler, while 95 drastically slows down migrations in the deploy request + */ + ratio?: number; + /** + * If specifying throttler ratios per keyspace, an array of { "keyspace_name": "mykeyspace", "ratio": 10 }, one for each eligible keyspace + */ + configurations?: Array; + }; path: { /** * The name of the deploy request's organization @@ -10732,13 +13925,13 @@ export type CancelDeployRequestData = { /** * The number of the deploy request */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/cancel"; + url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler"; }; -export type CancelDeployRequestErrors = { +export type UpdateDeployRequestThrottlerErrors = { /** * Unauthorized */ @@ -10757,40 +13950,45 @@ export type CancelDeployRequestErrors = { 500: GeneralError; }; -export type CancelDeployRequestError = - CancelDeployRequestErrors[keyof CancelDeployRequestErrors]; +export type UpdateDeployRequestThrottlerError = + UpdateDeployRequestThrottlerErrors[keyof UpdateDeployRequestThrottlerErrors]; -export type CancelDeployRequestResponses = { +export type UpdateDeployRequestThrottlerResponses = { /** - * Returns the deploy request whose deployment was canceled + * Deploy request throttler configurations */ - 200: DatabaseDeployRequest; + 200: ThrottlerConfigurations; }; -export type CancelDeployRequestResponse = - CancelDeployRequestResponses[keyof CancelDeployRequestResponses]; +export type UpdateDeployRequestThrottlerResponse = + UpdateDeployRequestThrottlerResponses[keyof UpdateDeployRequestThrottlerResponses]; -export type CompleteErroredDeployData = { +export type ListReadOnlyRegionsData = { body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization the database belongs to */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; + }; + query?: { /** - * The number of the deploy request + * If provided, specifies the page offset of returned results */ - number: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/complete-deploy"; + url: "/organizations/{organization}/databases/{database}/read-only-regions"; }; -export type CompleteErroredDeployErrors = { +export type ListReadOnlyRegionsErrors = { /** * Unauthorized */ @@ -10809,45 +14007,45 @@ export type CompleteErroredDeployErrors = { 500: GeneralError; }; -export type CompleteErroredDeployError = - CompleteErroredDeployErrors[keyof CompleteErroredDeployErrors]; +export type ListReadOnlyRegionsError = + ListReadOnlyRegionsErrors[keyof ListReadOnlyRegionsErrors]; -export type CompleteErroredDeployResponses = { +export type ListReadOnlyRegionsResponses = { /** - * Returns the completed deploy request + * List of the database's read-only regions */ - 200: DatabaseDeployRequest; + 200: PaginatedDatabaseBranchReadOnlyRegion; }; -export type CompleteErroredDeployResponse = - CompleteErroredDeployResponses[keyof CompleteErroredDeployResponses]; +export type ListReadOnlyRegionsResponse = + ListReadOnlyRegionsResponses[keyof ListReadOnlyRegionsResponses]; -export type QueueDeployRequestData = { - body?: { - /** - * Whether or not to deploy the request with instant DDL. Defaults to false. - */ - instant_ddl?: boolean; - }; +export type ListDatabaseRegionsData = { + body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization the database belongs to */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; + }; + query?: { /** - * The number of the deploy request + * If provided, specifies the page offset of returned results */ - number: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deploy"; + url: "/organizations/{organization}/databases/{database}/regions"; }; -export type QueueDeployRequestErrors = { +export type ListDatabaseRegionsErrors = { /** * Unauthorized */ @@ -10866,40 +14064,36 @@ export type QueueDeployRequestErrors = { 500: GeneralError; }; -export type QueueDeployRequestError = - QueueDeployRequestErrors[keyof QueueDeployRequestErrors]; +export type ListDatabaseRegionsError = + ListDatabaseRegionsErrors[keyof ListDatabaseRegionsErrors]; -export type QueueDeployRequestResponses = { +export type ListDatabaseRegionsResponses = { /** - * Returns the deployed deploy request + * Returns the available regions for a database */ - 200: DatabaseDeployRequest; + 200: PaginatedPlanetscaleRegion; }; -export type QueueDeployRequestResponse = - QueueDeployRequestResponses[keyof QueueDeployRequestResponses]; +export type ListDatabaseRegionsResponse = + ListDatabaseRegionsResponses[keyof ListDatabaseRegionsResponses]; -export type GetDeploymentData = { +export type GetDatabaseThrottlerData = { body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization that the throttled deploy requests belong to */ organization: string; /** - * The name of the deploy request's database + * The name of the database that the throttled deploy requests belong to */ database: string; - /** - * The number of the deploy request - */ - number: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deployment"; + url: "/organizations/{organization}/databases/{database}/throttler"; }; -export type GetDeploymentErrors = { +export type GetDatabaseThrottlerErrors = { /** * Unauthorized */ @@ -10918,48 +14112,45 @@ export type GetDeploymentErrors = { 500: GeneralError; }; -export type GetDeploymentError = GetDeploymentErrors[keyof GetDeploymentErrors]; +export type GetDatabaseThrottlerError = + GetDatabaseThrottlerErrors[keyof GetDatabaseThrottlerErrors]; -export type GetDeploymentResponses = { +export type GetDatabaseThrottlerResponses = { /** - * Returns the deployment for a deploy request + * Database throttler configurations */ - 200: Deployment; + 200: ThrottlerConfigurations; }; -export type GetDeploymentResponse = - GetDeploymentResponses[keyof GetDeploymentResponses]; +export type GetDatabaseThrottlerResponse = + GetDatabaseThrottlerResponses[keyof GetDatabaseThrottlerResponses]; -export type ListDeployOperationsData = { - body?: never; - path: { - /** - * The number of the deploy request - */ - number: string; +export type UpdateDatabaseThrottlerData = { + body?: { /** - * The name of the deploy request's organization + * A throttler ratio between 0 and 95 that will apply to all keyspaces in the database. 0 effectively disables throttler, while 95 drastically slows down deploy request migrations */ - organization: string; + ratio?: number; /** - * The name of the deploy request's database + * If specifying throttler ratios per keyspace, an array of { "keyspace_name": "mykeyspace", "ratio": 10 }, one for each eligible keyspace */ - database: string; + configurations?: Array; }; - query?: { + path: { /** - * If provided, specifies the page offset of returned results + * The name of the organization that the throttled deploy requests belong to */ - page?: number; + organization: string; /** - * If provided, specifies the number of returned results + * The name of the database that the throttled deploy requests belong to */ - per_page?: number; + database: string; }; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/operations"; + query?: never; + url: "/organizations/{organization}/databases/{database}/throttler"; }; -export type ListDeployOperationsErrors = { +export type UpdateDatabaseThrottlerErrors = { /** * Unauthorized */ @@ -10978,40 +14169,45 @@ export type ListDeployOperationsErrors = { 500: GeneralError; }; -export type ListDeployOperationsError = - ListDeployOperationsErrors[keyof ListDeployOperationsErrors]; +export type UpdateDatabaseThrottlerError = + UpdateDatabaseThrottlerErrors[keyof UpdateDatabaseThrottlerErrors]; -export type ListDeployOperationsResponses = { +export type UpdateDatabaseThrottlerResponses = { /** - * Returns deploy operations for the deploy request + * Database throttler configurations */ - 200: PaginatedDeployOperation; + 200: ThrottlerConfigurations; }; -export type ListDeployOperationsResponse = - ListDeployOperationsResponses[keyof ListDeployOperationsResponses]; +export type UpdateDatabaseThrottlerResponse = + UpdateDatabaseThrottlerResponses[keyof UpdateDatabaseThrottlerResponses]; -export type CompleteRevertData = { +export type ListWebhooksData = { body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; + }; + query?: { /** - * The number of the deploy request + * If provided, specifies the page offset of returned results */ - number: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/revert"; + url: "/organizations/{organization}/databases/{database}/webhooks"; }; -export type CompleteRevertErrors = { +export type ListWebhooksErrors = { /** * Unauthorized */ @@ -11030,40 +14226,48 @@ export type CompleteRevertErrors = { 500: GeneralError; }; -export type CompleteRevertError = - CompleteRevertErrors[keyof CompleteRevertErrors]; +export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors]; -export type CompleteRevertResponses = { +export type ListWebhooksResponses = { /** - * Returns the deploy request that was reverted + * Returns a list of webhooks for a database */ - 200: DatabaseDeployRequest; + 200: PaginatedDatabaseWebhook; }; -export type CompleteRevertResponse = - CompleteRevertResponses[keyof CompleteRevertResponses]; +export type ListWebhooksResponse = + ListWebhooksResponses[keyof ListWebhooksResponses]; -export type ListDeployRequestReviewsData = { - body?: never; - path: { +export type CreateWebhookData = { + body?: { /** - * The name of the organization the deploy request belongs to + * The URL the webhook will send events to */ - organization: string; + url: string; /** - * The name of the database the deploy request belongs to + * Whether the webhook should be enabled */ - database: string; + enabled?: boolean; /** - * The number of the deploy request + * The events this webhook should subscribe to + */ + events?: Array; + }; + path: { + /** + * The name of the organization + */ + organization: string; + /** + * The name of the database */ - number: string; + database: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews"; + url: "/organizations/{organization}/databases/{database}/webhooks"; }; -export type ListDeployRequestReviewsErrors = { +export type CreateWebhookErrors = { /** * Unauthorized */ @@ -11082,49 +14286,39 @@ export type ListDeployRequestReviewsErrors = { 500: GeneralError; }; -export type ListDeployRequestReviewsError = - ListDeployRequestReviewsErrors[keyof ListDeployRequestReviewsErrors]; +export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors]; -export type ListDeployRequestReviewsResponses = { +export type CreateWebhookResponses = { /** - * Returns an array of deploy request reviews + * Returns the created webhook */ - 200: PaginatedDeployRequestReview; + 201: DatabaseWebhook; }; -export type ListDeployRequestReviewsResponse = - ListDeployRequestReviewsResponses[keyof ListDeployRequestReviewsResponses]; +export type CreateWebhookResponse = + CreateWebhookResponses[keyof CreateWebhookResponses]; -export type ReviewDeployRequestData = { - body?: { - /** - * Whether the review is a comment or approval. Service tokens must have corresponding access (either `approve_deploy_request` or `review_deploy_request`) - */ - state?: "commented" | "approved"; - /** - * Deploy request review comments - */ - body?: string; - }; +export type DeleteWebhookData = { + body?: never; path: { /** - * The name of the organization the deploy request belongs to + * The name of the organization */ organization: string; /** - * The name of the database the deploy request belongs to + * The name of the database */ database: string; /** - * The number of the deploy request + * The ID of the webhook */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews"; + url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; }; -export type ReviewDeployRequestErrors = { +export type DeleteWebhookErrors = { /** * Unauthorized */ @@ -11143,40 +14337,36 @@ export type ReviewDeployRequestErrors = { 500: GeneralError; }; -export type ReviewDeployRequestError = - ReviewDeployRequestErrors[keyof ReviewDeployRequestErrors]; +export type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors]; -export type ReviewDeployRequestResponses = { +export type DeleteWebhookResponses = { /** - * Returns the created deploy request review + * Webhook successfully deleted */ - 201: DeployRequestReview; + 204: unknown; }; -export type ReviewDeployRequestResponse = - ReviewDeployRequestResponses[keyof ReviewDeployRequestResponses]; - -export type SkipRevertPeriodData = { +export type GetWebhookData = { body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; /** - * The number of the deploy request + * The ID of the webhook */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/skip-revert"; + url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; }; -export type SkipRevertPeriodErrors = { +export type GetWebhookErrors = { /** * Unauthorized */ @@ -11195,40 +14385,51 @@ export type SkipRevertPeriodErrors = { 500: GeneralError; }; -export type SkipRevertPeriodError = - SkipRevertPeriodErrors[keyof SkipRevertPeriodErrors]; +export type GetWebhookError = GetWebhookErrors[keyof GetWebhookErrors]; -export type SkipRevertPeriodResponses = { +export type GetWebhookResponses = { /** - * Returns the deploy request whose deploy revert was skipped + * Returns the webhook */ - 200: DatabaseDeployRequest; + 200: DatabaseWebhook; }; -export type SkipRevertPeriodResponse = - SkipRevertPeriodResponses[keyof SkipRevertPeriodResponses]; +export type GetWebhookResponse = GetWebhookResponses[keyof GetWebhookResponses]; -export type GetDeployRequestThrottlerData = { - body?: never; +export type UpdateWebhookData = { + body?: { + /** + * The URL the webhook will send events to + */ + url?: string; + /** + * Whether the webhook should be enabled + */ + enabled?: boolean; + /** + * The events this webhook should subscribe to + */ + events?: Array; + }; path: { /** - * The name of the deploy request's organization + * The name of the organization */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; /** - * The number of the deploy request + * The ID of the webhook */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler"; + url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; }; -export type GetDeployRequestThrottlerErrors = { +export type UpdateWebhookErrors = { /** * Unauthorized */ @@ -11247,49 +14448,39 @@ export type GetDeployRequestThrottlerErrors = { 500: GeneralError; }; -export type GetDeployRequestThrottlerError = - GetDeployRequestThrottlerErrors[keyof GetDeployRequestThrottlerErrors]; +export type UpdateWebhookError = UpdateWebhookErrors[keyof UpdateWebhookErrors]; -export type GetDeployRequestThrottlerResponses = { +export type UpdateWebhookResponses = { /** - * Deploy request throttler configurations + * Returns the updated webhook */ - 200: ThrottlerConfigurations; + 200: DatabaseWebhook; }; -export type GetDeployRequestThrottlerResponse = - GetDeployRequestThrottlerResponses[keyof GetDeployRequestThrottlerResponses]; +export type UpdateWebhookResponse = + UpdateWebhookResponses[keyof UpdateWebhookResponses]; -export type UpdateDeployRequestThrottlerData = { - body?: { - /** - * A throttler ratio between 0 and 95 that will apply to all keyspaces affected by the deploy request. 0 effectively disables throttler, while 95 drastically slows down migrations in the deploy request - */ - ratio?: number; - /** - * If specifying throttler ratios per keyspace, an array of { "keyspace_name": "mykeyspace", "ratio": 10 }, one for each eligible keyspace - */ - configurations?: Array; - }; +export type TestWebhookData = { + body?: never; path: { /** - * The name of the deploy request's organization + * The name of the organization */ organization: string; /** - * The name of the deploy request's database + * The name of the database */ database: string; /** - * The number of the deploy request + * The ID of the webhook */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/throttler"; + url: "/organizations/{organization}/databases/{database}/webhooks/{id}/test"; }; -export type UpdateDeployRequestThrottlerErrors = { +export type TestWebhookErrors = { /** * Unauthorized */ @@ -11308,36 +14499,45 @@ export type UpdateDeployRequestThrottlerErrors = { 500: GeneralError; }; -export type UpdateDeployRequestThrottlerError = - UpdateDeployRequestThrottlerErrors[keyof UpdateDeployRequestThrottlerErrors]; +export type TestWebhookError = TestWebhookErrors[keyof TestWebhookErrors]; -export type UpdateDeployRequestThrottlerResponses = { +export type TestWebhookResponses = { /** - * Deploy request throttler configurations + * Webhook test event successfully triggered */ - 200: ThrottlerConfigurations; + 204: unknown; }; -export type UpdateDeployRequestThrottlerResponse = - UpdateDeployRequestThrottlerResponses[keyof UpdateDeployRequestThrottlerResponses]; - -export type GetDatabaseThrottlerData = { +export type ListWorkflowsData = { body?: never; path: { /** - * The name of the organization that the throttled deploy requests belong to + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database that the throttled deploy requests belong to + * The name of the database the workflow belongs to */ database: string; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/throttler"; + query?: { + /** + * Filter workflows to those active during a time range (e.g. 2025-01-01T00:00:00Z..2025-01-01T23:59:59) + */ + between?: string; + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations/{organization}/databases/{database}/workflows"; }; -export type GetDatabaseThrottlerErrors = { +export type ListWorkflowsErrors = { /** * Unauthorized */ @@ -11356,45 +14556,64 @@ export type GetDatabaseThrottlerErrors = { 500: GeneralError; }; -export type GetDatabaseThrottlerError = - GetDatabaseThrottlerErrors[keyof GetDatabaseThrottlerErrors]; +export type ListWorkflowsError = ListWorkflowsErrors[keyof ListWorkflowsErrors]; -export type GetDatabaseThrottlerResponses = { +export type ListWorkflowsResponses = { /** - * Database throttler configurations + * Returns workflows */ - 200: ThrottlerConfigurations; + 200: PaginatedWorkflow; }; -export type GetDatabaseThrottlerResponse = - GetDatabaseThrottlerResponses[keyof GetDatabaseThrottlerResponses]; +export type ListWorkflowsResponse = + ListWorkflowsResponses[keyof ListWorkflowsResponses]; -export type UpdateDatabaseThrottlerData = { +export type CreateWorkflowData = { body?: { /** - * A throttler ratio between 0 and 95 that will apply to all keyspaces in the database. 0 effectively disables throttler, while 95 drastically slows down deploy request migrations + * Name the workflow */ - ratio?: number; + name: string; /** - * If specifying throttler ratios per keyspace, an array of { "keyspace_name": "mykeyspace", "ratio": 10 }, one for each eligible keyspace + * Name of the source keyspace */ - configurations?: Array; + source_keyspace: string; + /** + * Name of the target keyspace + */ + target_keyspace: string; + /** + * Name of the global sequence keyspace + */ + global_keyspace?: string; + /** + * Defer secondary keys + */ + defer_secondary_keys?: boolean; + /** + * The behavior when DDL changes during the workflow + */ + on_ddl?: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; + /** + * List of tables to move + */ + tables: Array; }; path: { /** - * The name of the organization that the throttled deploy requests belong to + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database that the throttled deploy requests belong to + * The name of the database the workflow belongs to */ database: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/throttler"; + url: "/organizations/{organization}/databases/{database}/workflows"; }; -export type UpdateDatabaseThrottlerErrors = { +export type CreateWorkflowErrors = { /** * Unauthorized */ @@ -11413,45 +14632,40 @@ export type UpdateDatabaseThrottlerErrors = { 500: GeneralError; }; -export type UpdateDatabaseThrottlerError = - UpdateDatabaseThrottlerErrors[keyof UpdateDatabaseThrottlerErrors]; +export type CreateWorkflowError = + CreateWorkflowErrors[keyof CreateWorkflowErrors]; -export type UpdateDatabaseThrottlerResponses = { +export type CreateWorkflowResponses = { /** - * Database throttler configurations + * Returns the workflow */ - 200: ThrottlerConfigurations; + 201: Workflow; }; -export type UpdateDatabaseThrottlerResponse = - UpdateDatabaseThrottlerResponses[keyof UpdateDatabaseThrottlerResponses]; +export type CreateWorkflowResponse = + CreateWorkflowResponses[keyof CreateWorkflowResponses]; -export type ListWebhooksData = { +export type WorkflowCancelData = { body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database - */ - database: string; - }; - query?: { - /** - * If provided, specifies the page offset of returned results + * The name of the database the workflow belongs to */ - page?: number; + database: string; /** - * If provided, specifies the number of returned results + * The sequence number of the workflow */ - per_page?: number; + number: number; }; - url: "/organizations/{organization}/databases/{database}/webhooks"; + query?: never; + url: "/organizations/{organization}/databases/{database}/workflows/{number}"; }; -export type ListWebhooksErrors = { +export type WorkflowCancelErrors = { /** * Unauthorized */ @@ -11470,48 +14684,40 @@ export type ListWebhooksErrors = { 500: GeneralError; }; -export type ListWebhooksError = ListWebhooksErrors[keyof ListWebhooksErrors]; +export type WorkflowCancelError = + WorkflowCancelErrors[keyof WorkflowCancelErrors]; -export type ListWebhooksResponses = { +export type WorkflowCancelResponses = { /** - * Returns a list of webhooks for a database + * Returns a workflow */ - 200: PaginatedDatabaseWebhook; + 200: Workflow; }; -export type ListWebhooksResponse = - ListWebhooksResponses[keyof ListWebhooksResponses]; +export type WorkflowCancelResponse = + WorkflowCancelResponses[keyof WorkflowCancelResponses]; -export type CreateWebhookData = { - body?: { - /** - * The URL the webhook will send events to - */ - url: string; - /** - * Whether the webhook should be enabled - */ - enabled?: boolean; - /** - * The events this webhook should subscribe to - */ - events?: Array; - }; +export type GetWorkflowData = { + body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database + * The name of the database the workflow belongs to */ database: string; + /** + * The sequence number of the workflow + */ + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/webhooks"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}"; }; -export type CreateWebhookErrors = { +export type GetWorkflowErrors = { /** * Unauthorized */ @@ -11530,39 +14736,39 @@ export type CreateWebhookErrors = { 500: GeneralError; }; -export type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors]; +export type GetWorkflowError = GetWorkflowErrors[keyof GetWorkflowErrors]; -export type CreateWebhookResponses = { +export type GetWorkflowResponses = { /** - * Returns the created webhook + * Returns a workflow */ - 201: DatabaseWebhook; + 200: Workflow; }; -export type CreateWebhookResponse = - CreateWebhookResponses[keyof CreateWebhookResponses]; +export type GetWorkflowResponse = + GetWorkflowResponses[keyof GetWorkflowResponses]; -export type DeleteWebhookData = { +export type WorkflowCompleteData = { body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database + * The name of the database the workflow belongs to */ database: string; /** - * The ID of the webhook + * The sequence number of the workflow */ - id: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/complete"; }; -export type DeleteWebhookErrors = { +export type WorkflowCompleteErrors = { /** * Unauthorized */ @@ -11581,36 +14787,40 @@ export type DeleteWebhookErrors = { 500: GeneralError; }; -export type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors]; +export type WorkflowCompleteError = + WorkflowCompleteErrors[keyof WorkflowCompleteErrors]; -export type DeleteWebhookResponses = { +export type WorkflowCompleteResponses = { /** - * Webhook successfully deleted + * Returns a workflow */ - 204: unknown; + 200: Workflow; }; -export type GetWebhookData = { +export type WorkflowCompleteResponse = + WorkflowCompleteResponses[keyof WorkflowCompleteResponses]; + +export type WorkflowCutoverData = { body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database + * The name of the database the workflow belongs to */ database: string; /** - * The ID of the webhook + * The sequence number of the workflow */ - id: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/cutover"; }; -export type GetWebhookErrors = { +export type WorkflowCutoverErrors = { /** * Unauthorized */ @@ -11629,51 +14839,40 @@ export type GetWebhookErrors = { 500: GeneralError; }; -export type GetWebhookError = GetWebhookErrors[keyof GetWebhookErrors]; +export type WorkflowCutoverError = + WorkflowCutoverErrors[keyof WorkflowCutoverErrors]; -export type GetWebhookResponses = { +export type WorkflowCutoverResponses = { /** - * Returns the webhook + * Returns a workflow */ - 200: DatabaseWebhook; + 200: Workflow; }; -export type GetWebhookResponse = GetWebhookResponses[keyof GetWebhookResponses]; +export type WorkflowCutoverResponse = + WorkflowCutoverResponses[keyof WorkflowCutoverResponses]; -export type UpdateWebhookData = { - body?: { - /** - * The URL the webhook will send events to - */ - url?: string; - /** - * Whether the webhook should be enabled - */ - enabled?: boolean; - /** - * The events this webhook should subscribe to - */ - events?: Array; - }; +export type WorkflowRetryData = { + body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database + * The name of the database the workflow belongs to */ database: string; /** - * The ID of the webhook + * The sequence number of the workflow */ - id: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/webhooks/{id}"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/retry"; }; -export type UpdateWebhookErrors = { +export type WorkflowRetryErrors = { /** * Unauthorized */ @@ -11692,39 +14891,39 @@ export type UpdateWebhookErrors = { 500: GeneralError; }; -export type UpdateWebhookError = UpdateWebhookErrors[keyof UpdateWebhookErrors]; +export type WorkflowRetryError = WorkflowRetryErrors[keyof WorkflowRetryErrors]; -export type UpdateWebhookResponses = { +export type WorkflowRetryResponses = { /** - * Returns the updated webhook + * Returns a workflow */ - 200: DatabaseWebhook; + 200: Workflow; }; -export type UpdateWebhookResponse = - UpdateWebhookResponses[keyof UpdateWebhookResponses]; +export type WorkflowRetryResponse = + WorkflowRetryResponses[keyof WorkflowRetryResponses]; -export type TestWebhookData = { +export type WorkflowReverseCutoverData = { body?: never; path: { /** - * The name of the organization + * The name of the organization the workflow belongs to */ organization: string; /** - * The name of the database + * The name of the database the workflow belongs to */ database: string; /** - * The ID of the webhook + * The sequence number of the workflow */ - id: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/webhooks/{id}/test"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-cutover"; }; -export type TestWebhookErrors = { +export type WorkflowReverseCutoverErrors = { /** * Unauthorized */ @@ -11743,16 +14942,20 @@ export type TestWebhookErrors = { 500: GeneralError; }; -export type TestWebhookError = TestWebhookErrors[keyof TestWebhookErrors]; +export type WorkflowReverseCutoverError = + WorkflowReverseCutoverErrors[keyof WorkflowReverseCutoverErrors]; -export type TestWebhookResponses = { +export type WorkflowReverseCutoverResponses = { /** - * Webhook test event successfully triggered + * Returns a workflow */ - 204: unknown; + 200: Workflow; }; -export type ListWorkflowsData = { +export type WorkflowReverseCutoverResponse = + WorkflowReverseCutoverResponses[keyof WorkflowReverseCutoverResponses]; + +export type WorkflowReverseTrafficData = { body?: never; path: { /** @@ -11763,25 +14966,16 @@ export type ListWorkflowsData = { * The name of the database the workflow belongs to */ database: string; - }; - query?: { - /** - * Filter workflows to those active during a time range (e.g. 2025-01-01T00:00:00Z..2025-01-01T23:59:59) - */ - between?: string; - /** - * If provided, specifies the page offset of returned results - */ - page?: number; /** - * If provided, specifies the number of returned results + * The sequence number of the workflow */ - per_page?: number; + number: number; }; - url: "/organizations/{organization}/databases/{database}/workflows"; + query?: never; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-traffic"; }; -export type ListWorkflowsErrors = { +export type WorkflowReverseTrafficErrors = { /** * Unauthorized */ @@ -11800,49 +14994,21 @@ export type ListWorkflowsErrors = { 500: GeneralError; }; -export type ListWorkflowsError = ListWorkflowsErrors[keyof ListWorkflowsErrors]; +export type WorkflowReverseTrafficError = + WorkflowReverseTrafficErrors[keyof WorkflowReverseTrafficErrors]; -export type ListWorkflowsResponses = { +export type WorkflowReverseTrafficResponses = { /** - * Returns workflows + * Returns a workflow */ - 200: PaginatedWorkflow; + 200: Workflow; }; -export type ListWorkflowsResponse = - ListWorkflowsResponses[keyof ListWorkflowsResponses]; +export type WorkflowReverseTrafficResponse = + WorkflowReverseTrafficResponses[keyof WorkflowReverseTrafficResponses]; -export type CreateWorkflowData = { - body?: { - /** - * Name the workflow - */ - name: string; - /** - * Name of the source keyspace - */ - source_keyspace: string; - /** - * Name of the target keyspace - */ - target_keyspace: string; - /** - * Name of the global sequence keyspace - */ - global_keyspace?: string; - /** - * Defer secondary keys - */ - defer_secondary_keys?: boolean; - /** - * The behavior when DDL changes during the workflow - */ - on_ddl?: "IGNORE" | "STOP" | "EXEC" | "EXEC_IGNORE"; - /** - * List of tables to move - */ - tables: Array; - }; +export type WorkflowSwitchPrimariesData = { + body?: never; path: { /** * The name of the organization the workflow belongs to @@ -11852,12 +15018,16 @@ export type CreateWorkflowData = { * The name of the database the workflow belongs to */ database: string; + /** + * The sequence number of the workflow + */ + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-primaries"; }; -export type CreateWorkflowErrors = { +export type WorkflowSwitchPrimariesErrors = { /** * Unauthorized */ @@ -11876,20 +15046,20 @@ export type CreateWorkflowErrors = { 500: GeneralError; }; -export type CreateWorkflowError = - CreateWorkflowErrors[keyof CreateWorkflowErrors]; +export type WorkflowSwitchPrimariesError = + WorkflowSwitchPrimariesErrors[keyof WorkflowSwitchPrimariesErrors]; -export type CreateWorkflowResponses = { +export type WorkflowSwitchPrimariesResponses = { /** - * Returns the workflow + * Returns a workflow */ - 201: Workflow; + 200: Workflow; }; -export type CreateWorkflowResponse = - CreateWorkflowResponses[keyof CreateWorkflowResponses]; +export type WorkflowSwitchPrimariesResponse = + WorkflowSwitchPrimariesResponses[keyof WorkflowSwitchPrimariesResponses]; -export type WorkflowCancelData = { +export type WorkflowSwitchReplicasData = { body?: never; path: { /** @@ -11903,13 +15073,13 @@ export type WorkflowCancelData = { /** * The sequence number of the workflow */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-replicas"; }; -export type WorkflowCancelErrors = { +export type WorkflowSwitchReplicasErrors = { /** * Unauthorized */ @@ -11928,20 +15098,20 @@ export type WorkflowCancelErrors = { 500: GeneralError; }; -export type WorkflowCancelError = - WorkflowCancelErrors[keyof WorkflowCancelErrors]; +export type WorkflowSwitchReplicasError = + WorkflowSwitchReplicasErrors[keyof WorkflowSwitchReplicasErrors]; -export type WorkflowCancelResponses = { +export type WorkflowSwitchReplicasResponses = { /** * Returns a workflow */ 200: Workflow; }; -export type WorkflowCancelResponse = - WorkflowCancelResponses[keyof WorkflowCancelResponses]; +export type WorkflowSwitchReplicasResponse = + WorkflowSwitchReplicasResponses[keyof WorkflowSwitchReplicasResponses]; -export type GetWorkflowData = { +export type VerifyWorkflowData = { body?: never; path: { /** @@ -11955,13 +15125,13 @@ export type GetWorkflowData = { /** * The sequence number of the workflow */ - number: string; + number: number; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}"; + url: "/organizations/{organization}/databases/{database}/workflows/{number}/verify-data"; }; -export type GetWorkflowErrors = { +export type VerifyWorkflowErrors = { /** * Unauthorized */ @@ -11980,39 +15150,41 @@ export type GetWorkflowErrors = { 500: GeneralError; }; -export type GetWorkflowError = GetWorkflowErrors[keyof GetWorkflowErrors]; +export type VerifyWorkflowError = + VerifyWorkflowErrors[keyof VerifyWorkflowErrors]; -export type GetWorkflowResponses = { +export type VerifyWorkflowResponses = { /** * Returns a workflow */ 200: Workflow; }; -export type GetWorkflowResponse = - GetWorkflowResponses[keyof GetWorkflowResponses]; +export type VerifyWorkflowResponse = + VerifyWorkflowResponses[keyof VerifyWorkflowResponses]; -export type WorkflowCompleteData = { +export type ListInvoicesData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization */ organization: string; + }; + query?: { /** - * The name of the database the workflow belongs to + * If provided, specifies the page offset of returned results */ - database: string; + page?: number; /** - * The sequence number of the workflow + * If provided, specifies the number of returned results */ - number: string; + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/complete"; + url: "/organizations/{organization}/invoices"; }; -export type WorkflowCompleteErrors = { +export type ListInvoicesErrors = { /** * Unauthorized */ @@ -12031,40 +15203,35 @@ export type WorkflowCompleteErrors = { 500: GeneralError; }; -export type WorkflowCompleteError = - WorkflowCompleteErrors[keyof WorkflowCompleteErrors]; +export type ListInvoicesError = ListInvoicesErrors[keyof ListInvoicesErrors]; -export type WorkflowCompleteResponses = { +export type ListInvoicesResponses = { /** - * Returns a workflow + * Gets the invoices for an organization */ - 200: Workflow; + 200: PaginatedInvoice; }; -export type WorkflowCompleteResponse = - WorkflowCompleteResponses[keyof WorkflowCompleteResponses]; +export type ListInvoicesResponse = + ListInvoicesResponses[keyof ListInvoicesResponses]; -export type WorkflowCutoverData = { +export type GetInvoiceData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization */ organization: string; /** - * The name of the database the workflow belongs to - */ - database: string; - /** - * The sequence number of the workflow + * The ID of the invoice */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/cutover"; + url: "/organizations/{organization}/invoices/{id}"; }; -export type WorkflowCutoverErrors = { +export type GetInvoiceErrors = { /** * Unauthorized */ @@ -12083,40 +15250,43 @@ export type WorkflowCutoverErrors = { 500: GeneralError; }; -export type WorkflowCutoverError = - WorkflowCutoverErrors[keyof WorkflowCutoverErrors]; +export type GetInvoiceError = GetInvoiceErrors[keyof GetInvoiceErrors]; -export type WorkflowCutoverResponses = { +export type GetInvoiceResponses = { /** - * Returns a workflow + * Returns an invoice */ - 200: Workflow; + 200: Invoice; }; -export type WorkflowCutoverResponse = - WorkflowCutoverResponses[keyof WorkflowCutoverResponses]; +export type GetInvoiceResponse = GetInvoiceResponses[keyof GetInvoiceResponses]; -export type WorkflowRetryData = { +export type GetInvoiceLineItemsData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization */ organization: string; /** - * The name of the database the workflow belongs to + * The ID of the invoice */ - database: string; + id: string; + }; + query?: { /** - * The sequence number of the workflow + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results */ - number: string; + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/retry"; + url: "/organizations/{organization}/invoices/{id}/line-items"; }; -export type WorkflowRetryErrors = { +export type GetInvoiceLineItemsErrors = { /** * Unauthorized */ @@ -12135,39 +15305,45 @@ export type WorkflowRetryErrors = { 500: GeneralError; }; -export type WorkflowRetryError = WorkflowRetryErrors[keyof WorkflowRetryErrors]; +export type GetInvoiceLineItemsError = + GetInvoiceLineItemsErrors[keyof GetInvoiceLineItemsErrors]; -export type WorkflowRetryResponses = { +export type GetInvoiceLineItemsResponses = { /** - * Returns a workflow + * Gets the line items for an invoice */ - 200: Workflow; + 200: PaginatedLineItem; }; -export type WorkflowRetryResponse = - WorkflowRetryResponses[keyof WorkflowRetryResponses]; +export type GetInvoiceLineItemsResponse = + GetInvoiceLineItemsResponses[keyof GetInvoiceLineItemsResponses]; -export type WorkflowReverseCutoverData = { +export type ListOrganizationMembersData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization */ organization: string; + }; + query?: { /** - * The name of the database the workflow belongs to + * Search term to filter members by name or email */ - database: string; + q?: string; /** - * The sequence number of the workflow + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results */ - number: string; + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-cutover"; + url: "/organizations/{organization}/members"; }; -export type WorkflowReverseCutoverErrors = { +export type ListOrganizationMembersErrors = { /** * Unauthorized */ @@ -12186,40 +15362,45 @@ export type WorkflowReverseCutoverErrors = { 500: GeneralError; }; -export type WorkflowReverseCutoverError = - WorkflowReverseCutoverErrors[keyof WorkflowReverseCutoverErrors]; +export type ListOrganizationMembersError = + ListOrganizationMembersErrors[keyof ListOrganizationMembersErrors]; -export type WorkflowReverseCutoverResponses = { +export type ListOrganizationMembersResponses = { /** - * Returns a workflow + * Returns members of the organization */ - 200: Workflow; + 200: PaginatedOrganizationMembership; }; -export type WorkflowReverseCutoverResponse = - WorkflowReverseCutoverResponses[keyof WorkflowReverseCutoverResponses]; +export type ListOrganizationMembersResponse = + ListOrganizationMembersResponses[keyof ListOrganizationMembersResponses]; -export type WorkflowReverseTrafficData = { - body?: never; - path: { +export type RemoveOrganizationMemberData = { + body?: { /** - * The name of the organization the workflow belongs to + * Whether to delete all passwords associated with the member. Only available when removing other members (not yourself). */ - organization: string; + delete_passwords?: boolean; /** - * The name of the database the workflow belongs to + * Whether to delete all service tokens associated with the member. Only available when removing other members (not yourself). */ - database: string; + delete_service_tokens?: boolean; + }; + path: { /** - * The sequence number of the workflow + * The name of the organization */ - number: string; + organization: string; + /** + * The ID of the user + */ + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-traffic"; + url: "/organizations/{organization}/members/{id}"; }; -export type WorkflowReverseTrafficErrors = { +export type RemoveOrganizationMemberErrors = { /** * Unauthorized */ @@ -12238,40 +15419,33 @@ export type WorkflowReverseTrafficErrors = { 500: GeneralError; }; -export type WorkflowReverseTrafficError = - WorkflowReverseTrafficErrors[keyof WorkflowReverseTrafficErrors]; +export type RemoveOrganizationMemberError = + RemoveOrganizationMemberErrors[keyof RemoveOrganizationMemberErrors]; -export type WorkflowReverseTrafficResponses = { +export type RemoveOrganizationMemberResponses = { /** - * Returns a workflow + * Member removed successfully. Note: Cannot remove the last admin or leave your only organization. */ - 200: Workflow; + 204: unknown; }; -export type WorkflowReverseTrafficResponse = - WorkflowReverseTrafficResponses[keyof WorkflowReverseTrafficResponses]; - -export type WorkflowSwitchPrimariesData = { +export type GetOrganizationMembershipData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization */ organization: string; /** - * The name of the database the workflow belongs to - */ - database: string; - /** - * The sequence number of the workflow + * The ID of the user */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-primaries"; + url: "/organizations/{organization}/members/{id}"; }; -export type WorkflowSwitchPrimariesErrors = { +export type GetOrganizationMembershipErrors = { /** * Unauthorized */ @@ -12290,40 +15464,41 @@ export type WorkflowSwitchPrimariesErrors = { 500: GeneralError; }; -export type WorkflowSwitchPrimariesError = - WorkflowSwitchPrimariesErrors[keyof WorkflowSwitchPrimariesErrors]; +export type GetOrganizationMembershipError = + GetOrganizationMembershipErrors[keyof GetOrganizationMembershipErrors]; -export type WorkflowSwitchPrimariesResponses = { +export type GetOrganizationMembershipResponses = { /** - * Returns a workflow + * Returns the membership of the user in the organization */ - 200: Workflow; + 200: OrganizationMembership; }; -export type WorkflowSwitchPrimariesResponse = - WorkflowSwitchPrimariesResponses[keyof WorkflowSwitchPrimariesResponses]; +export type GetOrganizationMembershipResponse = + GetOrganizationMembershipResponses[keyof GetOrganizationMembershipResponses]; -export type WorkflowSwitchReplicasData = { - body?: never; - path: { +export type UpdateOrganizationMembershipData = { + body?: { /** - * The name of the organization the workflow belongs to + * The role to assign to the member (e.g., 'admin', 'member'). Note: Cannot update your own role. Roles managed by IdP cannot be updated via API. */ - organization: string; + role: string; + }; + path: { /** - * The name of the database the workflow belongs to + * The name of the organization */ - database: string; + organization: string; /** - * The sequence number of the workflow + * The ID of the user */ - number: string; + id: string; }; query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-replicas"; + url: "/organizations/{organization}/members/{id}"; }; -export type WorkflowSwitchReplicasErrors = { +export type UpdateOrganizationMembershipErrors = { /** * Unauthorized */ @@ -12342,40 +15517,41 @@ export type WorkflowSwitchReplicasErrors = { 500: GeneralError; }; -export type WorkflowSwitchReplicasError = - WorkflowSwitchReplicasErrors[keyof WorkflowSwitchReplicasErrors]; +export type UpdateOrganizationMembershipError = + UpdateOrganizationMembershipErrors[keyof UpdateOrganizationMembershipErrors]; -export type WorkflowSwitchReplicasResponses = { +export type UpdateOrganizationMembershipResponses = { /** - * Returns a workflow + * Returns the updated membership */ - 200: Workflow; + 200: OrganizationMembership; }; -export type WorkflowSwitchReplicasResponse = - WorkflowSwitchReplicasResponses[keyof WorkflowSwitchReplicasResponses]; +export type UpdateOrganizationMembershipResponse = + UpdateOrganizationMembershipResponses[keyof UpdateOrganizationMembershipResponses]; -export type VerifyWorkflowData = { +export type ListOauthApplicationsData = { body?: never; path: { /** - * The name of the organization the workflow belongs to + * The name of the organization the OAuth applications belong to */ organization: string; + }; + query?: { /** - * The name of the database the workflow belongs to + * If provided, specifies the page offset of returned results */ - database: string; + page?: number; /** - * The sequence number of the workflow + * If provided, specifies the number of returned results */ - number: string; + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/databases/{database}/workflows/{number}/verify-data"; + url: "/organizations/{organization}/oauth-applications"; }; -export type VerifyWorkflowErrors = { +export type ListOauthApplicationsErrors = { /** * Unauthorized */ @@ -12394,36 +15570,36 @@ export type VerifyWorkflowErrors = { 500: GeneralError; }; -export type VerifyWorkflowError = - VerifyWorkflowErrors[keyof VerifyWorkflowErrors]; +export type ListOauthApplicationsError = + ListOauthApplicationsErrors[keyof ListOauthApplicationsErrors]; -export type VerifyWorkflowResponses = { +export type ListOauthApplicationsResponses = { /** - * Returns a workflow + * Returns a list of the organization's oauth applications */ - 200: Workflow; + 200: PaginatedOauthApplication; }; -export type VerifyWorkflowResponse = - VerifyWorkflowResponses[keyof VerifyWorkflowResponses]; +export type ListOauthApplicationsResponse = + ListOauthApplicationsResponses[keyof ListOauthApplicationsResponses]; -export type DeleteDatabaseData = { +export type GetOauthApplicationData = { body?: never; path: { /** - * The name of the organization the database belongs to + * The name of the organization the OAuth application belongs to */ organization: string; /** - * The name of the database + * The ID of the OAuth application */ - name: string; + application_id: string; }; query?: never; - url: "/organizations/{organization}/databases/{name}"; + url: "/organizations/{organization}/oauth-applications/{application_id}"; }; -export type DeleteDatabaseErrors = { +export type GetOauthApplicationErrors = { /** * Unauthorized */ @@ -12442,33 +15618,45 @@ export type DeleteDatabaseErrors = { 500: GeneralError; }; -export type DeleteDatabaseError = - DeleteDatabaseErrors[keyof DeleteDatabaseErrors]; +export type GetOauthApplicationError = + GetOauthApplicationErrors[keyof GetOauthApplicationErrors]; -export type DeleteDatabaseResponses = { +export type GetOauthApplicationResponses = { /** - * Deletes a database + * Returns information abuot an OAuth application */ - 204: unknown; + 200: OauthApplication; }; -export type GetDatabaseData = { +export type GetOauthApplicationResponse = + GetOauthApplicationResponses[keyof GetOauthApplicationResponses]; + +export type ListOauthTokensData = { body?: never; path: { /** - * The name of the organization the database belongs to + * The name of the organization the OAuth application belongs to */ organization: string; /** - * The name of the database + * The ID of the OAuth application */ - name: string; + application_id: string; }; - query?: never; - url: "/organizations/{organization}/databases/{name}"; + query?: { + /** + * If provided, specifies the page offset of returned results + */ + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; + }; + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens"; }; -export type GetDatabaseErrors = { +export type ListOauthTokensErrors = { /** * Unauthorized */ @@ -12487,80 +15675,40 @@ export type GetDatabaseErrors = { 500: GeneralError; }; -export type GetDatabaseError = GetDatabaseErrors[keyof GetDatabaseErrors]; +export type ListOauthTokensError = + ListOauthTokensErrors[keyof ListOauthTokensErrors]; -export type GetDatabaseResponses = { +export type ListOauthTokensResponses = { /** - * Returns a database + * Returns the OAuth tokens issued on behalf of the OAuth application */ - 200: Database; + 200: PaginatedServiceToken; }; -export type GetDatabaseResponse = - GetDatabaseResponses[keyof GetDatabaseResponses]; +export type ListOauthTokensResponse = + ListOauthTokensResponses[keyof ListOauthTokensResponses]; -export type UpdateDatabaseSettingsData = { - body?: { - /** - * The name to update the database to - */ - new_name?: string; - /** - * Whether or not to copy migration data to new branches and in deploy requests. - */ - automatic_migrations?: boolean; - /** - * A migration framework to use on the database - */ - migration_framework?: string; - /** - * Name of table to use as migration table for the database - */ - migration_table_name?: string; - /** - * Whether or not deploy requests must be approved by a database administrator other than the request creator - */ - require_approval_for_deploy?: boolean; - /** - * Whether or not to limit branch creation to the same region as the one selected during database creation. - */ - restrict_branch_region?: boolean; - /** - * Whether or not data branching is allowed on the database - */ - allow_data_branching?: boolean; - /** - * Whether or not foreign key constraints are allowed on the database - */ - allow_foreign_key_constraints?: boolean; - /** - * Whether or not full queries should be collected from the database - */ - insights_raw_queries?: boolean; - /** - * Whether or not the web console can be used on the production branch of the database - */ - production_branch_web_console?: boolean; - /** - * The default branch of the database - */ - default_branch?: string; - }; +export type DeleteOauthTokenData = { + body?: never; path: { /** - * The name of the organization the database belongs to + * The name of the organization the OAuth application belongs to */ organization: string; /** - * The name of the database + * The ID of the OAuth application */ - name: string; + application_id: string; + /** + * The ID of the OAuth application token + */ + token_id: string; }; query?: never; - url: "/organizations/{organization}/databases/{name}"; + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}"; }; -export type UpdateDatabaseSettingsErrors = { +export type DeleteOauthTokenErrors = { /** * Unauthorized */ @@ -12579,45 +15727,37 @@ export type UpdateDatabaseSettingsErrors = { 500: GeneralError; }; -export type UpdateDatabaseSettingsError = - UpdateDatabaseSettingsErrors[keyof UpdateDatabaseSettingsErrors]; +export type DeleteOauthTokenError = + DeleteOauthTokenErrors[keyof DeleteOauthTokenErrors]; -export type UpdateDatabaseSettingsResponses = { +export type DeleteOauthTokenResponses = { /** - * Returns the updated database + * Deletes an OAuth application's OAuth token */ - 200: Database; + 204: unknown; }; -export type UpdateDatabaseSettingsResponse = - UpdateDatabaseSettingsResponses[keyof UpdateDatabaseSettingsResponses]; - -export type ListReadOnlyRegionsData = { +export type GetOauthTokenData = { body?: never; path: { /** - * The name of the organization the database belongs to + * The name of the organization the OAuth application belongs to */ organization: string; /** - * The name of the database - */ - name: string; - }; - query?: { - /** - * If provided, specifies the page offset of returned results + * The ID of the OAuth application */ - page?: number; + application_id: string; /** - * If provided, specifies the number of returned results + * The ID of the OAuth application token */ - per_page?: number; + token_id: string; }; - url: "/organizations/{organization}/databases/{name}/read-only-regions"; + query?: never; + url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}"; }; -export type ListReadOnlyRegionsErrors = { +export type GetOauthTokenErrors = { /** * Unauthorized */ @@ -12636,49 +15776,60 @@ export type ListReadOnlyRegionsErrors = { 500: GeneralError; }; -export type ListReadOnlyRegionsError = - ListReadOnlyRegionsErrors[keyof ListReadOnlyRegionsErrors]; +export type GetOauthTokenError = GetOauthTokenErrors[keyof GetOauthTokenErrors]; -export type ListReadOnlyRegionsResponses = { +export type GetOauthTokenResponses = { /** - * List of the database's read-only regions + * Returns an OAuth token that was issued on behalf of the OAuth application */ - 200: PaginatedDatabaseBranchReadOnlyRegion; + 200: ServiceToken; }; -export type ListReadOnlyRegionsResponse = - ListReadOnlyRegionsResponses[keyof ListReadOnlyRegionsResponses]; +export type GetOauthTokenResponse = + GetOauthTokenResponses[keyof GetOauthTokenResponses]; -export type ListDatabaseRegionsData = { - body?: never; - path: { +export type CreateOauthTokenData = { + body?: { /** - * The name of the organization the database belongs to + * The OAuth application's client ID */ - organization: string; + client_id: string; /** - * The name of the database + * The OAuth application's client secret */ - name: string; + client_secret: string; + /** + * Whether an OAuth grant code or a refresh token is being exchanged for an OAuth token + */ + grant_type: "authorization_code" | "refresh_token"; + /** + * The OAuth grant code provided to your OAuth application's redirect URI. Required when grant_type is authorization_code + */ + code?: string; + /** + * The OAuth application's redirect URI. Required when grant_type is authorization_code + */ + redirect_uri?: string; + /** + * The refresh token from the original OAuth token grant. Required when grant_type is refresh_token + */ + refresh_token?: string; }; - query?: { + path: { /** - * If provided, specifies the page offset of returned results + * The name of the organization the OAuth application belongs to */ - page?: number; + organization: string; /** - * If provided, specifies the number of returned results + * The ID of the OAuth application */ - per_page?: number; + id: string; }; - url: "/organizations/{organization}/databases/{name}/regions"; + query?: never; + url: "/organizations/{organization}/oauth-applications/{id}/token"; }; -export type ListDatabaseRegionsErrors = { - /** - * Unauthorized - */ - 401: GeneralError; +export type CreateOauthTokenErrors = { /** * Forbidden */ @@ -12687,26 +15838,30 @@ export type ListDatabaseRegionsErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type ListDatabaseRegionsError = - ListDatabaseRegionsErrors[keyof ListDatabaseRegionsErrors]; +export type CreateOauthTokenError = + CreateOauthTokenErrors[keyof CreateOauthTokenErrors]; -export type ListDatabaseRegionsResponses = { +export type CreateOauthTokenResponses = { /** - * Returns the available regions for a database + * Returns the created OAuth token */ - 200: PaginatedPlanetscaleRegion; + 200: ServiceToken; }; -export type ListDatabaseRegionsResponse = - ListDatabaseRegionsResponses[keyof ListDatabaseRegionsResponses]; +export type CreateOauthTokenResponse = + CreateOauthTokenResponses[keyof CreateOauthTokenResponses]; -export type ListInvoicesData = { +export type ListRegionsForOrganizationData = { body?: never; path: { /** @@ -12724,10 +15879,10 @@ export type ListInvoicesData = { */ per_page?: number; }; - url: "/organizations/{organization}/invoices"; + url: "/organizations/{organization}/regions"; }; -export type ListInvoicesErrors = { +export type ListRegionsForOrganizationErrors = { /** * Unauthorized */ @@ -12746,35 +15901,41 @@ export type ListInvoicesErrors = { 500: GeneralError; }; -export type ListInvoicesError = ListInvoicesErrors[keyof ListInvoicesErrors]; +export type ListRegionsForOrganizationError = + ListRegionsForOrganizationErrors[keyof ListRegionsForOrganizationErrors]; -export type ListInvoicesResponses = { +export type ListRegionsForOrganizationResponses = { /** - * Gets the invoices for an organization + * Returns the organization's regions */ - 200: PaginatedInvoice; + 200: PaginatedPlanetscaleRegion; }; -export type ListInvoicesResponse = - ListInvoicesResponses[keyof ListInvoicesResponses]; +export type ListRegionsForOrganizationResponse = + ListRegionsForOrganizationResponses[keyof ListRegionsForOrganizationResponses]; -export type GetInvoiceData = { +export type ListServiceTokensData = { body?: never; path: { /** * The name of the organization */ organization: string; + }; + query?: { /** - * The ID of the invoice + * If provided, specifies the page offset of returned results */ - id: string; + page?: number; + /** + * If provided, specifies the number of returned results + */ + per_page?: number; }; - query?: never; - url: "/organizations/{organization}/invoices/{id}"; + url: "/organizations/{organization}/service-tokens"; }; -export type GetInvoiceErrors = { +export type ListServiceTokensErrors = { /** * Unauthorized */ @@ -12793,43 +15954,37 @@ export type GetInvoiceErrors = { 500: GeneralError; }; -export type GetInvoiceError = GetInvoiceErrors[keyof GetInvoiceErrors]; +export type ListServiceTokensError = + ListServiceTokensErrors[keyof ListServiceTokensErrors]; -export type GetInvoiceResponses = { +export type ListServiceTokensResponses = { /** - * Returns an invoice + * Returns the organization's service tokens */ - 200: Invoice; + 200: PaginatedServiceToken; }; -export type GetInvoiceResponse = GetInvoiceResponses[keyof GetInvoiceResponses]; +export type ListServiceTokensResponse = + ListServiceTokensResponses[keyof ListServiceTokensResponses]; -export type GetInvoiceLineItemsData = { - body?: never; - path: { - /** - * The name of the organization - */ - organization: string; +export type CreateServiceTokenData = { + body?: { /** - * The ID of the invoice + * The name of the service token */ - id: string; + name?: string; }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; + path: { /** - * If provided, specifies the number of returned results + * The name of the organization */ - per_page?: number; + organization: string; }; - url: "/organizations/{organization}/invoices/{id}/line-items"; + query?: never; + url: "/organizations/{organization}/service-tokens"; }; -export type GetInvoiceLineItemsErrors = { +export type CreateServiceTokenErrors = { /** * Unauthorized */ @@ -12848,41 +16003,36 @@ export type GetInvoiceLineItemsErrors = { 500: GeneralError; }; -export type GetInvoiceLineItemsError = - GetInvoiceLineItemsErrors[keyof GetInvoiceLineItemsErrors]; +export type CreateServiceTokenError = + CreateServiceTokenErrors[keyof CreateServiceTokenErrors]; -export type GetInvoiceLineItemsResponses = { +export type CreateServiceTokenResponses = { /** - * Gets the line items for an invoice + * Returns the created service token with the plaintext token */ - 200: PaginatedLineItem; + 200: ServiceToken; }; -export type GetInvoiceLineItemsResponse = - GetInvoiceLineItemsResponses[keyof GetInvoiceLineItemsResponses]; +export type CreateServiceTokenResponse = + CreateServiceTokenResponses[keyof CreateServiceTokenResponses]; -export type ListOrganizationMembersData = { +export type DeleteServiceTokenData = { body?: never; path: { /** * The name of the organization */ organization: string; - }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; /** - * If provided, specifies the number of returned results + * The ID of the service token */ - per_page?: number; + id: string; }; - url: "/organizations/{organization}/members"; + query?: never; + url: "/organizations/{organization}/service-tokens/{id}"; }; -export type ListOrganizationMembersErrors = { +export type DeleteServiceTokenErrors = { /** * Unauthorized */ @@ -12901,41 +16051,33 @@ export type ListOrganizationMembersErrors = { 500: GeneralError; }; -export type ListOrganizationMembersError = - ListOrganizationMembersErrors[keyof ListOrganizationMembersErrors]; +export type DeleteServiceTokenError = + DeleteServiceTokenErrors[keyof DeleteServiceTokenErrors]; -export type ListOrganizationMembersResponses = { +export type DeleteServiceTokenResponses = { /** - * Returns members of the organization + * Service token deleted successfully */ - 200: PaginatedOrganizationMembership; + 204: unknown; }; -export type ListOrganizationMembersResponse = - ListOrganizationMembersResponses[keyof ListOrganizationMembersResponses]; - -export type ListOauthApplicationsData = { +export type GetServiceTokenData = { body?: never; path: { /** - * The name of the organization the OAuth applications belong to + * The name of the organization */ organization: string; - }; - query?: { /** - * If provided, specifies the page offset of returned results - */ - page?: number; - /** - * If provided, specifies the number of returned results + * The ID of the service token */ - per_page?: number; + id: string; }; - url: "/organizations/{organization}/oauth-applications"; + query?: never; + url: "/organizations/{organization}/service-tokens/{id}"; }; -export type ListOauthApplicationsErrors = { +export type GetServiceTokenErrors = { /** * Unauthorized */ @@ -12954,36 +16096,41 @@ export type ListOauthApplicationsErrors = { 500: GeneralError; }; -export type ListOauthApplicationsError = - ListOauthApplicationsErrors[keyof ListOauthApplicationsErrors]; +export type GetServiceTokenError = + GetServiceTokenErrors[keyof GetServiceTokenErrors]; -export type ListOauthApplicationsResponses = { +export type GetServiceTokenResponses = { /** - * Returns a list of the organization's oauth applications + * Returns the service token */ - 200: PaginatedOauthApplication; + 200: ServiceToken; }; -export type ListOauthApplicationsResponse = - ListOauthApplicationsResponses[keyof ListOauthApplicationsResponses]; +export type GetServiceTokenResponse = + GetServiceTokenResponses[keyof GetServiceTokenResponses]; -export type GetOauthApplicationData = { +export type ListOrganizationTeamsData = { body?: never; path: { /** - * The name of the organization the OAuth application belongs to + * The name of the organization */ organization: string; + }; + query?: { /** - * The ID of the OAuth application + * Search term to filter teams by name */ - application_id: string; + q?: string; }; - query?: never; - url: "/organizations/{organization}/oauth-applications/{application_id}"; + url: "/organizations/{organization}/teams"; }; -export type GetOauthApplicationErrors = { +export type ListOrganizationTeamsErrors = { + /** + * Bad Request - Invalid operation or parameters + */ + 400: GeneralError; /** * Unauthorized */ @@ -12996,51 +16143,55 @@ export type GetOauthApplicationErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Validation errors or SSO-managed teams + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type GetOauthApplicationError = - GetOauthApplicationErrors[keyof GetOauthApplicationErrors]; +export type ListOrganizationTeamsError = + ListOrganizationTeamsErrors[keyof ListOrganizationTeamsErrors]; -export type GetOauthApplicationResponses = { +export type ListOrganizationTeamsResponses = { /** - * Returns information abuot an OAuth application + * Returns teams in the organization */ - 200: OauthApplication; + 200: PaginatedOrganizationTeam; }; -export type GetOauthApplicationResponse = - GetOauthApplicationResponses[keyof GetOauthApplicationResponses]; +export type ListOrganizationTeamsResponse = + ListOrganizationTeamsResponses[keyof ListOrganizationTeamsResponses]; -export type ListOauthTokensData = { - body?: never; - path: { +export type CreateOrganizationTeamData = { + body?: { /** - * The name of the organization the OAuth application belongs to + * The name of the team */ - organization: string; + name: string; /** - * The ID of the OAuth application + * A description of the team's purpose */ - application_id: string; + description?: string; }; - query?: { - /** - * If provided, specifies the page offset of returned results - */ - page?: number; + path: { /** - * If provided, specifies the number of returned results + * The name of the organization */ - per_page?: number; + organization: string; }; - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens"; + query?: never; + url: "/organizations/{organization}/teams"; }; -export type ListOauthTokensErrors = { +export type CreateOrganizationTeamErrors = { + /** + * Bad Request - Invalid operation or parameters + */ + 400: GeneralError; /** * Unauthorized */ @@ -13053,46 +16204,50 @@ export type ListOauthTokensErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Validation errors or SSO-managed teams + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type ListOauthTokensError = - ListOauthTokensErrors[keyof ListOauthTokensErrors]; +export type CreateOrganizationTeamError = + CreateOrganizationTeamErrors[keyof CreateOrganizationTeamErrors]; -export type ListOauthTokensResponses = { +export type CreateOrganizationTeamResponses = { /** - * Returns the OAuth tokens issued on behalf of the OAuth application + * Returns the created team */ - 200: PaginatedServiceToken; + 200: OrganizationTeam; }; -export type ListOauthTokensResponse = - ListOauthTokensResponses[keyof ListOauthTokensResponses]; +export type CreateOrganizationTeamResponse = + CreateOrganizationTeamResponses[keyof CreateOrganizationTeamResponses]; -export type DeleteOauthTokenData = { +export type DeleteOrganizationTeamData = { body?: never; path: { /** - * The name of the organization the OAuth application belongs to + * The name of the organization */ organization: string; /** - * The ID of the OAuth application - */ - application_id: string; - /** - * The ID of the OAuth application token + * The slug of the team */ - token_id: string; + team: string; }; query?: never; - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}"; + url: "/organizations/{organization}/teams/{team}"; }; -export type DeleteOauthTokenErrors = { +export type DeleteOrganizationTeamErrors = { + /** + * Bad Request - Invalid operation or parameters + */ + 400: GeneralError; /** * Unauthorized */ @@ -13105,43 +16260,47 @@ export type DeleteOauthTokenErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Validation errors or SSO-managed teams + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type DeleteOauthTokenError = - DeleteOauthTokenErrors[keyof DeleteOauthTokenErrors]; +export type DeleteOrganizationTeamError = + DeleteOrganizationTeamErrors[keyof DeleteOrganizationTeamErrors]; -export type DeleteOauthTokenResponses = { +export type DeleteOrganizationTeamResponses = { /** - * Deletes an OAuth application's OAuth token + * Team deleted successfully. Note: SSO-managed teams cannot be deleted. */ 204: unknown; }; -export type GetOauthTokenData = { +export type GetOrganizationTeamData = { body?: never; path: { /** - * The name of the organization the OAuth application belongs to + * The name of the organization */ organization: string; /** - * The ID of the OAuth application - */ - application_id: string; - /** - * The ID of the OAuth application token + * The slug of the team */ - token_id: string; + team: string; }; query?: never; - url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}"; + url: "/organizations/{organization}/teams/{team}"; }; -export type GetOauthTokenErrors = { +export type GetOrganizationTeamErrors = { + /** + * Bad Request - Invalid operation or parameters + */ + 400: GeneralError; /** * Unauthorized */ @@ -13154,66 +16313,63 @@ export type GetOauthTokenErrors = { * Not Found */ 404: GeneralError; + /** + * Unprocessable Entity - Validation errors or SSO-managed teams + */ + 422: GeneralError; /** * Internal Server Error */ 500: GeneralError; }; -export type GetOauthTokenError = GetOauthTokenErrors[keyof GetOauthTokenErrors]; +export type GetOrganizationTeamError = + GetOrganizationTeamErrors[keyof GetOrganizationTeamErrors]; -export type GetOauthTokenResponses = { +export type GetOrganizationTeamResponses = { /** - * Returns an OAuth token that was issued on behalf of the OAuth application + * Returns the team details including members and databases */ - 200: ServiceToken; + 200: OrganizationTeam; }; -export type GetOauthTokenResponse = - GetOauthTokenResponses[keyof GetOauthTokenResponses]; +export type GetOrganizationTeamResponse = + GetOrganizationTeamResponses[keyof GetOrganizationTeamResponses]; -export type CreateOauthTokenData = { +export type UpdateOrganizationTeamData = { body?: { /** - * The OAuth application's client ID - */ - client_id: string; - /** - * The OAuth application's client secret - */ - client_secret: string; - /** - * Whether an OAuth grant code or a refresh token is being exchanged for an OAuth token - */ - grant_type: "authorization_code" | "refresh_token"; - /** - * The OAuth grant code provided to your OAuth application's redirect URI. Required when grant_type is authorization_code - */ - code?: string; - /** - * The OAuth application's redirect URI. Required when grant_type is authorization_code + * The new name for the team */ - redirect_uri?: string; + name?: string; /** - * The refresh token from the original OAuth token grant. Required when grant_type is refresh_token + * The new description for the team */ - refresh_token?: string; + description?: string; }; path: { /** - * The name of the organization the OAuth application belongs to + * The name of the organization */ organization: string; /** - * The ID of the OAuth application + * The slug of the team */ - id: string; + team: string; }; query?: never; - url: "/organizations/{organization}/oauth-applications/{id}/token"; + url: "/organizations/{organization}/teams/{team}"; }; -export type CreateOauthTokenErrors = { +export type UpdateOrganizationTeamErrors = { + /** + * Bad Request - Invalid operation or parameters + */ + 400: GeneralError; + /** + * Unauthorized + */ + 401: GeneralError; /** * Forbidden */ @@ -13223,7 +16379,7 @@ export type CreateOauthTokenErrors = { */ 404: GeneralError; /** - * Unprocessable Entity + * Unprocessable Entity - Validation errors or SSO-managed teams */ 422: GeneralError; /** @@ -13232,18 +16388,18 @@ export type CreateOauthTokenErrors = { 500: GeneralError; }; -export type CreateOauthTokenError = - CreateOauthTokenErrors[keyof CreateOauthTokenErrors]; +export type UpdateOrganizationTeamError = + UpdateOrganizationTeamErrors[keyof UpdateOrganizationTeamErrors]; -export type CreateOauthTokenResponses = { +export type UpdateOrganizationTeamResponses = { /** - * Returns the created OAuth token + * Returns the updated team. Note: SSO-managed teams cannot be updated. */ - 200: ServiceToken; + 200: OrganizationTeam; }; -export type CreateOauthTokenResponse = - CreateOauthTokenResponses[keyof CreateOauthTokenResponses]; +export type UpdateOrganizationTeamResponse = + UpdateOrganizationTeamResponses[keyof UpdateOrganizationTeamResponses]; export type ListPublicRegionsData = { body?: never; diff --git a/alchemy/src/planetscale/branch.ts b/alchemy/src/planetscale/branch.ts index a6e7b4efd..61a8831da 100644 --- a/alchemy/src/planetscale/branch.ts +++ b/alchemy/src/planetscale/branch.ts @@ -205,7 +205,7 @@ export const Branch = Resource( path: { organization, database, - name: this.output.name, + branch: this.output.name, }, throwOnError: false, }); @@ -236,7 +236,7 @@ export const Branch = Resource( path: { organization, database, - name: branchName, + branch: branchName, }, throwOnError: false, }); @@ -287,7 +287,7 @@ export const Branch = Resource( path: { organization, database, - name: branchName, + branch: branchName, }, }); } @@ -367,7 +367,7 @@ export const Branch = Resource( path: { organization, database, - name: branchName, + branch: branchName, }, }); } diff --git a/alchemy/src/planetscale/database.ts b/alchemy/src/planetscale/database.ts index 25020b853..d08314fcd 100644 --- a/alchemy/src/planetscale/database.ts +++ b/alchemy/src/planetscale/database.ts @@ -46,65 +46,76 @@ interface BaseDatabaseProps extends PlanetScaleProps { }; /** - * Whether to require approval for deployments + * The number of replicas for the database. 0 for non-HA, 2+ for HA. (create only) */ - requireApprovalForDeploy?: boolean; + replicas?: number; /** - * Whether to allow data branching + * The database cluster size (required) */ - allowDataBranching?: boolean; + clusterSize: PlanetScaleClusterSize; + + /** + * The PostgreSQL major version to use for the database. Defaults to the latest available major version. (PostgreSQL only) + */ + majorVersion?: string; + + /** + * The engine kind for the database (create only) + * @default "mysql" + */ + kind?: "mysql" | "postgresql"; /** - * Whether to enable automatic migrations + * Whether or not to copy migration data to new branches and in deploy requests. (Vitess only) */ automaticMigrations?: boolean; /** - * Whether to restrict branch creation to the same region as database + * A migration framework to use on the database. (Vitess only) */ - restrictBranchRegion?: boolean; + migrationFramework?: string; /** - * Whether to collect full queries from the database + * Name of table to use as migration table for the database. (Vitess only) */ - insightsRawQueries?: boolean; + migrationTableName?: string; /** - * Whether web console can be used on production branch + * Whether or not deploy requests must be approved by a database administrator other than the request creator */ - productionBranchWebConsole?: boolean; + requireApprovalForDeploy?: boolean; /** - * The default branch of the database + * Whether or not to limit branch creation to the same region as the one selected during database creation. */ - defaultBranch?: string; + restrictBranchRegion?: boolean; /** - * Migration framework to use on the database + * Whether or not data branching is allowed on the database. (Vitess only) */ - migrationFramework?: string; + allowDataBranching?: boolean; /** - * Name of table to use as migration table + * Whether or not foreign key constraints are allowed on the database. (Vitess only) */ - migrationTableName?: string; + allowForeignKeyConstraints?: boolean; /** - * The database cluster size (required) + * Whether or not full queries should be collected from the database */ - clusterSize: PlanetScaleClusterSize; + insightsRawQueries?: boolean; /** - * The engine kind for the database - * @default "mysql" + * Whether or not the web console can be used on the production branch of the database */ - kind?: "mysql" | "postgresql"; + productionBranchWebConsole?: boolean; /** - * The CPU architecture for the database. Only available for PostgreSQL databases. + * The default branch of the database + * @default "main" */ - arch?: "x86" | "arm"; + defaultBranch?: string; } /** @@ -115,10 +126,16 @@ export type DatabaseProps = BaseDatabaseProps & | { kind?: "mysql"; arch?: undefined; + majorVersion?: undefined; } | { kind: "postgresql"; arch?: "x86" | "arm"; + automaticMigrations?: undefined; + migrationFramework?: undefined; + migrationTableName?: undefined; + allowDataBranching?: undefined; + allowForeignKeyConstraints?: undefined; } ); @@ -240,7 +257,7 @@ export const Database = Resource( await api.updateDatabaseSettings({ path: { organization, - name: this.output.name, + database: this.output.name, }, body: { new_name: databaseName }, }); @@ -251,7 +268,7 @@ export const Database = Resource( const response = await api.deleteDatabase({ path: { organization, - name: this.output.name, + database: this.output.name, }, throwOnError: false, }); @@ -269,7 +286,7 @@ export const Database = Resource( const getResponse = await api.getDatabase({ path: { organization, - name: databaseName, + database: databaseName, }, throwOnError: false, }); @@ -286,7 +303,7 @@ export const Database = Resource( path: { organization, database: databaseName, - name: props.defaultBranch, + branch: props.defaultBranch, }, throwOnError: false, }); @@ -311,7 +328,7 @@ export const Database = Resource( const { data } = await api.updateDatabaseSettings({ path: { organization, - name: databaseName, + database: databaseName, }, body: { automatic_migrations: props.automaticMigrations, @@ -319,10 +336,10 @@ export const Database = Resource( migration_table_name: props.migrationTableName, require_approval_for_deploy: props.requireApprovalForDeploy, restrict_branch_region: props.restrictBranchRegion, + allow_foreign_key_constraints: props.allowForeignKeyConstraints, allow_data_branching: props.allowDataBranching, insights_raw_queries: props.insightsRawQueries, production_branch_web_console: props.productionBranchWebConsole, - default_branch: props.defaultBranch, }, }); @@ -363,6 +380,8 @@ export const Database = Resource( region: props.region?.slug, kind: props.kind, cluster_size: clusterSize, + replicas: props.replicas, + major_version: props.majorVersion, }, }); @@ -370,17 +389,18 @@ export const Database = Resource( const { data } = await api.updateDatabaseSettings({ path: { organization, - name: databaseName, + database: databaseName, }, body: { - require_approval_for_deploy: props.requireApprovalForDeploy, - allow_data_branching: props.allowDataBranching, automatic_migrations: props.automaticMigrations, + migration_framework: props.migrationFramework, + migration_table_name: props.migrationTableName, + require_approval_for_deploy: props.requireApprovalForDeploy, restrict_branch_region: props.restrictBranchRegion, + allow_foreign_key_constraints: props.allowForeignKeyConstraints, + allow_data_branching: props.allowDataBranching, insights_raw_queries: props.insightsRawQueries, production_branch_web_console: props.productionBranchWebConsole, - migration_framework: props.migrationFramework, - migration_table_name: props.migrationTableName, }, }); @@ -393,7 +413,7 @@ export const Database = Resource( path: { organization, database: databaseName, - name: props.defaultBranch, + branch: props.defaultBranch, }, throwOnError: false, }); @@ -424,7 +444,7 @@ export const Database = Resource( const { data: updatedData } = await api.updateDatabaseSettings({ path: { organization, - name: databaseName, + database: databaseName, }, body: { default_branch: props.defaultBranch, diff --git a/alchemy/src/planetscale/default-role.ts b/alchemy/src/planetscale/default-role.ts new file mode 100644 index 000000000..21c9875fe --- /dev/null +++ b/alchemy/src/planetscale/default-role.ts @@ -0,0 +1,138 @@ +import { alchemy } from "../alchemy.ts"; +import type { Context } from "../context.ts"; +import { Resource } from "../resource.ts"; +import { createPlanetScaleClient, type PlanetScaleProps } from "./api.ts"; +import type { Branch } from "./branch.ts"; +import type { Database } from "./database.ts"; +import type { Role } from "./role.ts"; +import { waitForBranchReady } from "./utils.ts"; + +export interface DefaultRoleProps extends PlanetScaleProps { + /** + * The organization where the role will be created + * Required when using string database name, optional when using Database resource + * @default process.env.PLANETSCALE_ORGANIZATION + */ + organization?: string; + + /** + * The database where the role will be created + * Can be either a database name (string) or Database resource + */ + database: string | Database; + + /** + * The branch where the role will be created + * Can be either a branch name (string) or Branch resource + * @default "main" + */ + branch?: string | Branch; + + /** + * Whether to force reset the default role if it already exists. + * This will delete the existing role and create a new one. + * + * Note: Adopting an existing role is not supported because the password is only returned after create. + * + * @default false + */ + forceReset?: boolean; +} + +export type DefaultRole = Omit; + +export const DefaultRole = Resource( + "planetscale::DefaultRole", + async function ( + this: Context, + _id: string, + props: DefaultRoleProps, + ): Promise { + const api = createPlanetScaleClient(props); + const organization = + props.organization ?? + (typeof props.database !== "string" + ? props.database.organization + : (process.env.PLANETSCALE_ORGANIZATION ?? + process.env.PLANETSCALE_ORG_ID)); + if (!organization) { + throw new Error( + "PlanetScale organization is required. Please set the `organization` property or the `PLANETSCALE_ORGANIZATION` environment variable.", + ); + } + + const database = + typeof props.database === "string" ? props.database : props.database.name; + const branch = + typeof props.branch === "string" + ? props.branch + : (props.branch?.name ?? "main"); + + switch (this.phase) { + case "create": { + if (!props.forceReset) { + const existing = await api.getDefaultRole({ + path: { + organization, + database, + branch, + }, + throwOnError: false, + }); + if (existing.data) { + throw new Error( + `Default role already exists for database "${database}" branch "${branch}". Use forceReset to reset the role.`, + ); + } else if (existing.error && existing.response.status !== 404) { + throw new Error( + `Failed to check for default role in database "${database}" branch "${branch}".`, + { + cause: existing.error, + }, + ); + } + } + await waitForBranchReady(api, organization, database, branch); + const { data } = await api.resetDefaultRole({ + path: { + organization, + database, + branch, + }, + }); + return { + id: data.id, + name: data.name, + expiresAt: data.expires_at, + host: data.access_host_url, + username: data.username, + ttl: data.ttl, + password: alchemy.secret(data.password), + databaseName: data.database_name, + connectionUrl: alchemy.secret( + `postgresql://${data.username}:${data.password}@${data.access_host_url}:5432/${data.database_name}?sslmode=verify-full`, + ), + connectionUrlPooled: alchemy.secret( + `postgresql://${data.username}:${data.password}@${data.access_host_url}:6432/${data.database_name}?sslmode=verify-full`, + ), + inheritedRoles: data.inherited_roles, + database, + branch, + organization, + }; + } + case "update": { + if ( + database !== this.output.database || + branch !== this.output.branch + ) { + return this.replace(); + } + return this.output; + } + case "delete": { + return this.destroy(); + } + } + }, +); diff --git a/alchemy/src/planetscale/index.ts b/alchemy/src/planetscale/index.ts index e14fb0282..bba3986b4 100644 --- a/alchemy/src/planetscale/index.ts +++ b/alchemy/src/planetscale/index.ts @@ -1,6 +1,7 @@ export * from "./api.ts"; export * from "./branch.ts"; export * from "./database.ts"; +export * from "./default-role.ts"; export * from "./organization.ts"; export * from "./password.ts"; export * from "./role.ts"; diff --git a/alchemy/src/planetscale/organization.ts b/alchemy/src/planetscale/organization.ts index 70cb3f743..c6e3a3a19 100644 --- a/alchemy/src/planetscale/organization.ts +++ b/alchemy/src/planetscale/organization.ts @@ -10,7 +10,7 @@ export async function OrganizationRef( const api = createPlanetScaleClient(options); const organization = await api.getOrganization({ path: { - name: typeof name === "string" ? name : name.id, + organization: typeof name === "string" ? name : name.id, }, }); return organization.data; diff --git a/alchemy/src/planetscale/role.ts b/alchemy/src/planetscale/role.ts index 9f204405f..a7ed106e1 100644 --- a/alchemy/src/planetscale/role.ts +++ b/alchemy/src/planetscale/role.ts @@ -261,7 +261,7 @@ export const Role = Resource( path: { organization, database, - name: branch, + branch, }, }); if (kind !== "postgresql") { diff --git a/alchemy/src/planetscale/utils.ts b/alchemy/src/planetscale/utils.ts index d3eb93412..cccacf5e0 100644 --- a/alchemy/src/planetscale/utils.ts +++ b/alchemy/src/planetscale/utils.ts @@ -4,6 +4,7 @@ import type { DatabaseBranch } from "./api/types.gen.ts"; export type PlanetScaleClusterSize = | "PS_DEV" + | "PS_5" | "PS_10" | "PS_20" | "PS_40" @@ -59,7 +60,7 @@ export async function waitForBranchReady( description: `branch "${branch}" ready`, fn: () => api.getBranch({ - path: { organization, database, name: branch }, + path: { organization, database, branch }, }), predicate: ({ data }) => data.ready, }); @@ -78,7 +79,7 @@ export async function waitForDatabaseReady( description: `database "${database}" ready`, fn: () => api.getDatabase({ - path: { organization, name: database }, + path: { organization, database }, }), predicate: ({ data }) => data.ready, }); @@ -134,7 +135,7 @@ export async function ensureProductionBranchClusterSize( break; } case "postgresql": { - // Postgres databases must be resized first before promoting, otherwise 500 error + // Postgres databases do not need to be promoted; PS_DEV is development and all others are production await ensurePostgresClusterSize( api, organization, @@ -142,7 +143,6 @@ export async function ensureProductionBranchClusterSize( branch, expectedClusterSize, ); - await ensureProductionBranch(api, organization, database, branch); break; } } @@ -155,21 +155,21 @@ async function ensureProductionBranch( api: PlanetScaleClient, organization: string, database: string, - name: string, + branch: string, ): Promise { const { data } = await api.getBranch({ path: { organization, database, - name, + branch, }, }); if (!data.production) { if (!data.ready) { - await waitForBranchReady(api, organization, database, name); + await waitForBranchReady(api, organization, database, branch); } await api.promoteBranch({ - path: { organization, database, name }, + path: { organization, database, branch }, }); } } @@ -213,7 +213,7 @@ async function ensureMySQLClusterSize( path: { organization, database, - name: branch, + branch, }, body: { cluster_size: expectedClusterSize }, }); @@ -243,7 +243,7 @@ async function ensurePostgresClusterSize( path: { organization, database, - name: branch, + branch, }, }); if (data.cluster_name === expectedClusterSize) { diff --git a/alchemy/test/planetscale/branch.test.ts b/alchemy/test/planetscale/branch.test.ts index 7e1824af8..e9cbfe115 100644 --- a/alchemy/test/planetscale/branch.test.ts +++ b/alchemy/test/planetscale/branch.test.ts @@ -36,6 +36,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( organization: organizationName, clusterSize: "PS_10", kind, + delete: true, } as DatabaseProps; database = await Database("branch-test", props); await waitForDatabaseReady(api, organizationName, database.name); @@ -57,6 +58,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( organization: organizationName, database: database.name, isProduction: false, + delete: true, }); // Try to create the same branch with adopt=true @@ -66,6 +68,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( database: database.name, adopt: true, isProduction: false, + delete: true, }); expect(branch).toMatchObject({ @@ -78,7 +81,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -94,7 +97,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -113,6 +116,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( database: database.name, isProduction: false, parentBranch: "main", + delete: true, }); // Then try to create it again without adopt flag @@ -124,6 +128,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( parentBranch: "main", isProduction: false, adopt: false, + delete: true, }), ).rejects.toThrow("Branch"); @@ -132,7 +137,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -148,7 +153,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -201,6 +206,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( backupId: backup.id, clusterSize: "PS_10", isProduction: true, + delete: true, }); expect(branch).toMatchObject({ @@ -214,7 +220,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -230,7 +236,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -254,6 +260,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( parentBranch: "main", safeMigrations: true, isProduction: true, + delete: true, }); expect(branch).toMatchObject({ @@ -265,7 +272,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, }); expect(response.data.safe_migrations).toBe(true); @@ -279,13 +286,14 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( safeMigrations: false, adopt: true, isProduction: true, + delete: true, }); response = await api.getBranch({ path: { organization: organizationName, database: database.name, - name, + branch: name, }, }); expect(response.data.safe_migrations).toBe(false); @@ -310,6 +318,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( parentBranch: "main", isProduction: true, clusterSize: "PS_10", + delete: true, }); expect(branch).toMatchObject({ @@ -320,7 +329,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, }); expect(data1.cluster_name).toEqual(expectedClusterSizes.ps10); @@ -334,6 +343,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( clusterSize: "PS_20", isProduction: true, adopt: true, + delete: true, }); // Verify cluster size was updated @@ -341,7 +351,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, }); expect(data2.cluster_name).toEqual(expectedClusterSizes.ps20); @@ -365,6 +375,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( database: database.name, parentBranch: "main", isProduction: false, + delete: true, }); expect(parentBranch).toMatchObject({ @@ -379,6 +390,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( database: database.name, parentBranch, // Using Branch object instead of string isProduction: false, + delete: true, }); expect(childBranch).toMatchObject({ @@ -391,7 +403,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name: parentBranchName, + branch: parentBranchName, }, throwOnError: false, }); @@ -402,7 +414,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name: childBranchName, + branch: childBranchName, }, throwOnError: false, }); @@ -419,7 +431,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name: parentBranchName, + branch: parentBranchName, }, throwOnError: false, }); @@ -429,7 +441,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name: childBranchName, + branch: childBranchName, }, throwOnError: false, }); @@ -460,7 +472,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, }); expect(data.name).toBe(name); @@ -476,7 +488,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -487,7 +499,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); @@ -497,7 +509,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization: organizationName, database: database.name, - name, + branch: name, }, throwOnError: false, }); diff --git a/alchemy/test/planetscale/database.test.ts b/alchemy/test/planetscale/database.test.ts index a5e2cc1cf..dee128e4c 100644 --- a/alchemy/test/planetscale/database.test.ts +++ b/alchemy/test/planetscale/database.test.ts @@ -37,6 +37,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( name, clusterSize: "PS_10", kind, + delete: true, }); expect(database).toMatchObject({ @@ -60,7 +61,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization, database: name, - name: "main", + branch: "main", }, }); @@ -84,7 +85,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( }, clusterSize: "PS_10", allowDataBranching: true, - automaticMigrations: true, + automaticMigrations: kind === "mysql", requireApprovalForDeploy: false, restrictBranchRegion: true, insightsRawQueries: true, @@ -93,6 +94,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( migrationFramework: "rails", migrationTableName: "schema_migrations", kind, + delete: true, }); expect(database).toMatchObject({ @@ -131,6 +133,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( migrationFramework: "django", migrationTableName: "django_migrations", kind, + delete: true, }); expect(database).toMatchObject({ @@ -151,7 +154,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization, database: name, - name: "main", + branch: "main", }, }); expect(mainBranchData.cluster_name).toEqual(expectedClusterSizes.ps20); @@ -177,6 +180,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( clusterSize: "PS_10", defaultBranch, kind, + delete: true, }); expect(database).toMatchObject({ @@ -193,7 +197,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization, database: name, - name: defaultBranch, + branch: defaultBranch, }, }); expect(branchData.parent_branch).toEqual("main"); @@ -206,6 +210,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( clusterSize: "PS_20", defaultBranch, kind, + delete: true, }); // Verify branch cluster size was updated @@ -219,7 +224,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization, database: name, - name: defaultBranch, + branch: defaultBranch, }, }); expect(newBranchData.cluster_name).toEqual(expectedClusterSizes.ps20); @@ -245,6 +250,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( clusterSize: "PS_10", kind: "postgresql", arch: "arm", + delete: true, }); expect(database).toMatchObject({ id: expect.any(String), @@ -257,7 +263,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( path: { organization, database: name, - name: "main", + branch: "main", }, }); expect(branchData.cluster_name).toEqual("PS_10_AWS_ARM"); @@ -295,7 +301,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( const { data } = await api.getDatabase({ path: { organization, - name, + database: name, }, }); expect(data.name).toBe(name); @@ -310,7 +316,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( const { response } = await api.getDatabase({ path: { organization, - name, + database: name, }, throwOnError: false, }); @@ -320,7 +326,7 @@ describe.skipIf(!process.env.PLANETSCALE_TEST).concurrent.each(kinds)( await api.deleteDatabase({ path: { organization, - name, + database: name, }, throwOnError: false, }); @@ -348,7 +354,7 @@ async function assertDatabaseDeleted( const { response } = await api.getDatabase({ path: { organization: organizationName, - name: databaseName, + database: databaseName, }, throwOnError: false, }); diff --git a/scripts/clients/planetscale.ts b/scripts/clients/planetscale.ts index 0fefd9a28..080ec0beb 100644 --- a/scripts/clients/planetscale.ts +++ b/scripts/clients/planetscale.ts @@ -8,29 +8,6 @@ export const patchMissingProperties: Patch = { // You can't add new endpoints here (hence the patchMissingEndpoints function), // but you can add missing properties to existing endpoints. - operations: { - "PATCH /organizations/{organization}/databases/{database}/branches/{branch}/changes": - (operation) => { - // @ts-expect-error - operation.parameters = [ - ...(operation.parameters ?? []), - { - name: "body", - in: "body", - required: true, - schema: { - type: "object", - properties: { - cluster_size: { - type: "string", - }, - }, - required: ["cluster_size"], - }, - }, - ]; - }, - }, schemas: { DatabaseBranch: (schema) => { schema.properties = {