// This file is auto-generated by @hey-api/openapi-ts import type { Client, Options as Options2, TDataShape, } from "../../util/api/client/index.ts"; import { client } from "./client.gen.ts"; import type { AddOrganizationTeamMemberData, AddOrganizationTeamMemberErrors, AddOrganizationTeamMemberResponses, CancelBouncerResizeRequestData, CancelBouncerResizeRequestErrors, CancelBouncerResizeRequestResponses, CancelBranchChangeRequestData, CancelBranchChangeRequestErrors, CancelBranchChangeRequestResponses, CancelDeployRequestData, CancelDeployRequestErrors, CancelDeployRequestResponses, CloseDeployRequestData, CloseDeployRequestErrors, CloseDeployRequestResponses, CompleteErroredDeployData, CompleteErroredDeployErrors, CompleteErroredDeployResponses, CompleteGatedDeployRequestData, CompleteGatedDeployRequestErrors, CompleteGatedDeployRequestResponses, CompleteRevertData, CompleteRevertErrors, CompleteRevertResponses, CreateBackupData, CreateBackupErrors, CreateBackupResponses, CreateBouncerData, CreateBouncerErrors, CreateBouncerResponses, CreateBranchData, CreateBranchErrors, CreateBranchResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabasePostgresCidrData, CreateDatabasePostgresCidrErrors, CreateDatabasePostgresCidrResponses, CreateDatabaseResponses, CreateDeployRequestData, CreateDeployRequestErrors, CreateDeployRequestResponses, CreateKeyspaceData, CreateKeyspaceErrors, CreateKeyspaceResponses, CreateOauthTokenData, CreateOauthTokenErrors, CreateOauthTokenResponses, CreateOrganizationTeamData, CreateOrganizationTeamErrors, CreateOrganizationTeamResponses, CreatePasswordData, CreatePasswordErrors, CreatePasswordResponses, CreateQueryPatternsReportData, CreateQueryPatternsReportErrors, CreateQueryPatternsReportResponses, CreateRoleData, CreateRoleErrors, CreateRoleResponses, CreateServiceTokenData, CreateServiceTokenErrors, CreateServiceTokenResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, CreateWorkflowData, CreateWorkflowErrors, CreateWorkflowResponses, DeleteBackupData, DeleteBackupErrors, DeleteBackupResponses, DeleteBouncerData, DeleteBouncerErrors, DeleteBouncerResponses, DeleteBranchData, DeleteBranchErrors, DeleteBranchResponses, DeleteDatabaseData, DeleteDatabaseErrors, DeleteDatabasePostgresCidrData, DeleteDatabasePostgresCidrErrors, DeleteDatabasePostgresCidrResponses, DeleteDatabaseResponses, DeleteKeyspaceData, DeleteKeyspaceErrors, DeleteKeyspaceResponses, DeleteOauthTokenData, DeleteOauthTokenErrors, DeleteOauthTokenResponses, DeleteOrganizationTeamData, DeleteOrganizationTeamErrors, DeleteOrganizationTeamResponses, DeletePasswordData, DeletePasswordErrors, DeletePasswordResponses, DeleteQueryPatternsReportData, DeleteQueryPatternsReportErrors, DeleteQueryPatternsReportResponses, DeleteRoleData, DeleteRoleErrors, DeleteRoleResponses, DeleteServiceTokenData, DeleteServiceTokenErrors, DeleteServiceTokenResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, DemoteBranchData, DemoteBranchErrors, DemoteBranchResponses, DisableSafeMigrationsData, DisableSafeMigrationsErrors, DisableSafeMigrationsResponses, DismissSchemaRecommendationData, DismissSchemaRecommendationErrors, DismissSchemaRecommendationResponses, EnableSafeMigrationsData, EnableSafeMigrationsErrors, EnableSafeMigrationsResponses, GetBackupData, GetBackupErrors, GetBackupResponses, GetBouncerData, GetBouncerErrors, GetBouncerResponses, GetBranchChangeRequestData, GetBranchChangeRequestErrors, GetBranchChangeRequestResponses, GetBranchData, GetBranchErrors, GetBranchResponses, GetBranchSchemaData, GetBranchSchemaErrors, GetBranchSchemaResponses, GetCurrentUserData, GetCurrentUserErrors, GetCurrentUserResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePostgresCidrData, GetDatabasePostgresCidrErrors, GetDatabasePostgresCidrResponses, GetDatabaseResponses, GetDatabaseThrottlerData, GetDatabaseThrottlerErrors, GetDatabaseThrottlerResponses, GetDefaultRoleData, GetDefaultRoleErrors, GetDefaultRoleResponses, GetDeploymentData, GetDeploymentErrors, GetDeploymentResponses, GetDeployQueueData, GetDeployQueueErrors, GetDeployQueueResponses, GetDeployRequestData, GetDeployRequestErrors, GetDeployRequestResponses, GetDeployRequestThrottlerData, GetDeployRequestThrottlerErrors, GetDeployRequestThrottlerResponses, GetInvoiceData, GetInvoiceErrors, GetInvoiceLineItemsData, GetInvoiceLineItemsErrors, GetInvoiceLineItemsResponses, GetInvoiceResponses, GetKeyspaceData, GetKeyspaceErrors, GetKeyspaceResponses, GetKeyspaceRolloutStatusData, GetKeyspaceRolloutStatusErrors, GetKeyspaceRolloutStatusResponses, GetKeyspaceVschemaData, GetKeyspaceVschemaErrors, GetKeyspaceVschemaResponses, GetOauthApplicationData, GetOauthApplicationErrors, GetOauthApplicationResponses, GetOauthTokenData, GetOauthTokenErrors, GetOauthTokenResponses, GetOrganizationData, GetOrganizationErrors, GetOrganizationMembershipData, GetOrganizationMembershipErrors, GetOrganizationMembershipResponses, GetOrganizationResponses, GetOrganizationTeamData, GetOrganizationTeamErrors, GetOrganizationTeamMemberData, GetOrganizationTeamMemberErrors, GetOrganizationTeamMemberResponses, GetOrganizationTeamResponses, GetPasswordData, GetPasswordErrors, GetPasswordResponses, GetQueryPatternsReportData, GetQueryPatternsReportErrors, GetQueryPatternsReportStatusData, GetQueryPatternsReportStatusErrors, GetQueryPatternsReportStatusResponses, GetRoleData, GetRoleErrors, GetRoleResponses, GetSchemaRecommendationData, GetSchemaRecommendationErrors, GetSchemaRecommendationResponses, GetServiceTokenData, GetServiceTokenErrors, GetServiceTokenResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, GetWorkflowData, GetWorkflowErrors, GetWorkflowResponses, LintBranchSchemaData, LintBranchSchemaErrors, LintBranchSchemaResponses, ListAuditLogsData, ListAuditLogsErrors, ListAuditLogsResponses, 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, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListDeployOperationsData, ListDeployOperationsErrors, ListDeployOperationsResponses, ListDeployRequestReviewsData, ListDeployRequestReviewsErrors, ListDeployRequestReviewsResponses, ListDeployRequestsData, ListDeployRequestsErrors, ListDeployRequestsResponses, ListExtensionsData, ListExtensionsErrors, ListExtensionsResponses, ListGeneratedQueryPatternsReportsData, ListGeneratedQueryPatternsReportsErrors, ListGeneratedQueryPatternsReportsResponses, ListInvoicesData, ListInvoicesErrors, ListInvoicesResponses, ListKeyspaceResizesData, ListKeyspaceResizesErrors, ListKeyspaceResizesResponses, ListKeyspacesData, ListKeyspacesErrors, ListKeyspacesResponses, ListOauthApplicationsData, ListOauthApplicationsErrors, ListOauthApplicationsResponses, ListOauthTokensData, ListOauthTokensErrors, ListOauthTokensResponses, ListOrganizationMembersData, ListOrganizationMembersErrors, ListOrganizationMembersResponses, ListOrganizationsData, ListOrganizationsErrors, ListOrganizationsResponses, ListOrganizationTeamMembersData, ListOrganizationTeamMembersErrors, ListOrganizationTeamMembersResponses, ListOrganizationTeamsData, ListOrganizationTeamsErrors, ListOrganizationTeamsResponses, ListParametersData, ListParametersErrors, ListParametersResponses, ListPasswordsData, ListPasswordsErrors, ListPasswordsResponses, ListPublicRegionsData, ListPublicRegionsErrors, ListPublicRegionsResponses, ListReadOnlyRegionsData, ListReadOnlyRegionsErrors, ListReadOnlyRegionsResponses, ListRegionsForOrganizationData, ListRegionsForOrganizationErrors, ListRegionsForOrganizationResponses, ListRolesData, ListRolesErrors, ListRolesResponses, ListSchemaRecommendationsData, ListSchemaRecommendationsErrors, ListSchemaRecommendationsResponses, ListServiceTokensData, ListServiceTokensErrors, ListServiceTokensResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, ListWorkflowsData, ListWorkflowsErrors, ListWorkflowsResponses, PromoteBranchData, PromoteBranchErrors, PromoteBranchResponses, QueueDeployRequestData, QueueDeployRequestErrors, QueueDeployRequestResponses, ReassignRoleObjectsData, ReassignRoleObjectsErrors, ReassignRoleObjectsResponses, RemoveOrganizationMemberData, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponses, RemoveOrganizationTeamMemberData, RemoveOrganizationTeamMemberErrors, RemoveOrganizationTeamMemberResponses, RenewPasswordData, RenewPasswordErrors, RenewPasswordResponses, RenewRoleData, RenewRoleErrors, RenewRoleResponses, ResetDefaultRoleData, ResetDefaultRoleErrors, ResetDefaultRoleResponses, ResetRoleData, ResetRoleErrors, ResetRoleResponses, ReviewDeployRequestData, ReviewDeployRequestErrors, ReviewDeployRequestResponses, SkipRevertPeriodData, SkipRevertPeriodErrors, SkipRevertPeriodResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UpdateAutoApplyData, UpdateAutoApplyErrors, UpdateAutoApplyResponses, UpdateAutoDeleteBranchData, UpdateAutoDeleteBranchErrors, UpdateAutoDeleteBranchResponses, UpdateBackupData, UpdateBackupErrors, UpdateBackupResponses, UpdateBouncerResizeRequestData, UpdateBouncerResizeRequestErrors, UpdateBouncerResizeRequestResponses, UpdateBranchChangeRequestData, UpdateBranchChangeRequestErrors, UpdateBranchChangeRequestResponses, UpdateBranchClusterConfigData, UpdateBranchClusterConfigErrors, UpdateBranchClusterConfigResponses, UpdateBranchData, UpdateBranchErrors, UpdateBranchResponses, UpdateDatabasePostgresCidrData, UpdateDatabasePostgresCidrErrors, UpdateDatabasePostgresCidrResponses, UpdateDatabaseSettingsData, UpdateDatabaseSettingsErrors, UpdateDatabaseSettingsResponses, UpdateDatabaseThrottlerData, UpdateDatabaseThrottlerErrors, UpdateDatabaseThrottlerResponses, UpdateDeployRequestThrottlerData, UpdateDeployRequestThrottlerErrors, UpdateDeployRequestThrottlerResponses, UpdateKeyspaceData, UpdateKeyspaceErrors, UpdateKeyspaceResponses, UpdateKeyspaceVschemaData, UpdateKeyspaceVschemaErrors, UpdateKeyspaceVschemaResponses, UpdateOrganizationData, UpdateOrganizationErrors, UpdateOrganizationMembershipData, UpdateOrganizationMembershipErrors, UpdateOrganizationMembershipResponses, UpdateOrganizationResponses, UpdateOrganizationTeamData, UpdateOrganizationTeamErrors, UpdateOrganizationTeamResponses, UpdatePasswordData, UpdatePasswordErrors, UpdatePasswordResponses, UpdateRoleData, UpdateRoleErrors, UpdateRoleResponses, UpdateWebhookData, UpdateWebhookErrors, UpdateWebhookResponses, VerifyWorkflowData, VerifyWorkflowErrors, VerifyWorkflowResponses, WorkflowCancelData, WorkflowCancelErrors, WorkflowCancelResponses, WorkflowCompleteData, WorkflowCompleteErrors, WorkflowCompleteResponses, WorkflowCutoverData, WorkflowCutoverErrors, WorkflowCutoverResponses, WorkflowRetryData, WorkflowRetryErrors, WorkflowRetryResponses, WorkflowReverseCutoverData, WorkflowReverseCutoverErrors, WorkflowReverseCutoverResponses, WorkflowReverseTrafficData, WorkflowReverseTrafficErrors, WorkflowReverseTrafficResponses, WorkflowSwitchPrimariesData, WorkflowSwitchPrimariesErrors, WorkflowSwitchPrimariesResponses, WorkflowSwitchReplicasData, WorkflowSwitchReplicasErrors, WorkflowSwitchReplicasResponses, } from "./types.gen.ts"; export type Options< TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, > = Options2 & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; class _HeyApiClient { protected _client: Client = client; constructor(args?: { client?: Client }) { if (args?.client) { this._client = args.client; } } } export class PlanetScaleClient extends _HeyApiClient { /** * List organizations * When using a service token, returns the list of organizations the service token has access to. When using an OAuth token, returns the list of organizations the user has access to. * ### Authorization * A OAuth token must have at least one of the following scopes in order to use this API endpoint: * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | User | `read_organizations` | */ public listOrganizations( options?: Options, ) { return (options?.client ?? this._client).get< ListOrganizationsResponses, ListOrganizationsErrors, ThrowOnError >({ url: "/organizations", ...options, }); } /** * Get 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_organization` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | User | `read_organizations` | * | Organization | `read_organization` | */ public getOrganization( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationResponses, GetOrganizationErrors, ThrowOnError >({ url: "/organizations/{organization}", ...options, }); } /** * Update an organization * * ### 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_organization` | */ public updateOrganization( options: Options, ) { return (options.client ?? this._client).patch< UpdateOrganizationResponses, UpdateOrganizationErrors, ThrowOnError >({ url: "/organizations/{organization}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List audit logs * * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** * `read_audit_logs` * * */ public listAuditLogs( options: Options, ) { return (options.client ?? this._client).get< ListAuditLogsResponses, ListAuditLogsErrors, ThrowOnError >({ url: "/organizations/{organization}/audit-log", ...options, }); } /** * 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: * * **Service Token Accesses** * `read_organization` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | User | `read_organizations` | * | Organization | `read_organization` | */ public listClusterSizeSkus( options: Options, ) { return (options.client ?? this._client).get< ListClusterSizeSkusResponses, ListClusterSizeSkusErrors, ThrowOnError >({ url: "/organizations/{organization}/cluster-size-skus", ...options, }); } /** * List databases * * ### 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`, `connect_production_read_only_branch`, `delete_branch_password`, `delete_production_branch_password`, `delete_production_read_only_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `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` | */ public listDatabases( options: Options, ) { return (options.client ?? this._client).get< ListDatabasesResponses, ListDatabasesErrors, ThrowOnError >({ url: "/organizations/{organization}/databases", ...options, }); } /** * Create 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** * `create_databases` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `create_databases` | */ public createDatabase( options: Options, ) { return (options.client ?? this._client).post< CreateDatabaseResponses, CreateDatabaseErrors, ThrowOnError >({ url: "/organizations/{organization}/databases", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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`, `connect_production_read_only_branch`, `delete_branch_password`, `delete_production_branch_password`, `delete_production_read_only_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `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 * * ### 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 listBranches( options: Options, ) { return (options.client ?? this._client).get< ListBranchesResponses, ListBranchesErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches", ...options, }); } /** * Create 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** * `create_branch`, `restore_production_branch_backup`, `restore_backup` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_branches`, `restore_production_branch_backups`, `restore_backups` | * | Database | `write_branches`, `restore_production_branch_backups`, `restore_backups` | * | Branch | `restore_backups` | */ public createBranch( options: Options, ) { return (options.client ?? this._client).post< CreateBranchResponses, CreateBranchErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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, }); } /** * Update 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** * `write_database` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_branches` | * | Database | `write_branches` | * | Branch | `write_branch` | */ public updateBranch( options: Options, ) { return (options.client ?? this._client).patch< UpdateBranchResponses, UpdateBranchErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List backups * * ### 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_backups` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_backups` | * | Database | `read_backups` | * | Branch | `read_backups` | */ public listBackups( options: Options, ) { return (options.client ?? this._client).get< ListBackupsResponses, ListBackupsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups", ...options, }); } /** * Create a backup * * ### 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_backups` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_backups` | * | Database | `write_backups` | * | Branch | `write_backups` | */ public createBackup( options: Options, ) { return (options.client ?? this._client).post< CreateBackupResponses, CreateBackupErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete a backup * * ### 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_backups`, `delete_production_branch_backups` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `delete_backups`, `delete_production_branch_backups` | * | Database | `delete_backups`, `delete_production_branch_backups` | * | Branch | `delete_backups` | */ public deleteBackup( options: Options, ) { return (options.client ?? this._client).delete< DeleteBackupResponses, DeleteBackupErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}", ...options, }); } /** * Get a backup * * ### 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_backups` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_backups` | * | Database | `read_backups` | * | Branch | `read_backups` | */ public getBackup( options: Options, ) { return (options.client ?? this._client).get< GetBackupResponses, GetBackupErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}", ...options, }); } /** * Update a backup * * ### 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_backups` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_backups` | * | Database | `write_backups` | * | Branch | `write_backups` | */ public updateBackup( options: Options, ) { return (options.client ?? this._client).patch< UpdateBackupResponses, UpdateBackupErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/backups/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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: * * **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 listBranchBouncerResizeRequests( options: Options, ) { return (options.client ?? this._client).get< ListBranchBouncerResizeRequestsResponses, ListBranchBouncerResizeRequestsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncer-resizes", ...options, }); } /** * 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: * * **Service Token Accesses** * `write_database` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_databases` | * | Database | `write_database` | */ public createBouncer( options: Options, ) { return (options.client ?? this._client).post< CreateBouncerResponses, CreateBouncerErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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** * `write_database` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_databases` | * | Database | `write_database` | */ public deleteBouncer( options: Options, ) { return (options.client ?? this._client).delete< DeleteBouncerResponses, DeleteBouncerErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}", ...options, }); } /** * 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 getBouncer( options: Options, ) { return (options.client ?? this._client).get< GetBouncerResponses, GetBouncerErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}", ...options, }); } /** * 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 cancelBouncerResizeRequest( options: Options, ) { return (options.client ?? this._client).delete< CancelBouncerResizeRequestResponses, CancelBouncerResizeRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes", ...options, }); } /** * 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: * * **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 listBouncerResizeRequests( options: Options, ) { return (options.client ?? this._client).get< ListBouncerResizeRequestsResponses, ListBouncerResizeRequestsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/bouncers/{bouncer}/resizes", ...options, }); } /** * 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_database` * * */ public updateBranchClusterConfig( options: Options, ) { return (options.client ?? this._client).patch< UpdateBranchClusterConfigResponses, UpdateBranchClusterConfigErrors, ThrowOnError >({ 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", ...options.headers, }, }); } /** * 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( options: Options, ) { return (options.client ?? this._client).delete< DeleteKeyspaceResponses, DeleteKeyspaceErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } /** * 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( options: Options, ) { return (options.client ?? this._client).get< GetKeyspaceResponses, GetKeyspaceErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } /** * 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( options: Options, ) { return (options.client ?? this._client).patch< UpdateKeyspaceResponses, UpdateKeyspaceErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{keyspace}", ...options, }); } /** * 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( options: Options, ) { return (options.client ?? this._client).get< GetKeyspaceRolloutStatusResponses, GetKeyspaceRolloutStatusErrors, ThrowOnError >({ 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: * * **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 listParameters( options: Options, ) { return (options.client ?? this._client).get< ListParametersResponses, ListParametersErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/parameters", ...options, }); } /** * List passwords * * ### 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_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public listPasswords( options: Options, ) { return (options.client ?? this._client).get< ListPasswordsResponses, ListPasswordsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords", ...options, }); } /** * Create a 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`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public createPassword( options: Options, ) { return (options.client ?? this._client).post< CreatePasswordResponses, CreatePasswordErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete a 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** * `delete_production_branch_password`, `delete_production_read_only_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public deletePassword( options: Options, ) { return (options.client ?? this._client).delete< DeletePasswordResponses, DeletePasswordErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}", ...options, }); } /** * Get a 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** * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public getPassword( options: Options, ) { return (options.client ?? this._client).get< GetPasswordResponses, GetPasswordErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}", ...options, }); } /** * Update a 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`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public updatePassword( options: Options, ) { return (options.client ?? this._client).patch< UpdatePasswordResponses, UpdatePasswordErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Renew a 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`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public renewPassword( options: Options, ) { return (options.client ?? this._client).post< RenewPasswordResponses, RenewPasswordErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/passwords/{id}/renew", ...options, }); } /** * 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 * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_branches` | * | Database | `read_branches` | * | Branch | `read_branch` | */ public listGeneratedQueryPatternsReports( options: Options, ) { return (options.client ?? this._client).get< ListGeneratedQueryPatternsReportsResponses, ListGeneratedQueryPatternsReportsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns", ...options, }); } /** * Create a new query patterns report * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_branches` | * | Database | `read_branches` | * | Branch | `read_branch` | */ public createQueryPatternsReport( options: Options, ) { return (options.client ?? this._client).post< CreateQueryPatternsReportResponses, CreateQueryPatternsReportErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns", ...options, }); } /** * Delete a query patterns report * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_branches` | * | Database | `read_branches` | * | Branch | `read_branch` | */ public deleteQueryPatternsReport( options: Options, ) { return (options.client ?? this._client).delete< DeleteQueryPatternsReportResponses, DeleteQueryPatternsReportErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}", ...options, }); } /** * Show the status of a query patterns report * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_branches` | * | Database | `read_branches` | * | Branch | `read_branch` | */ public getQueryPatternsReportStatus( options: Options, ) { return (options.client ?? this._client).get< GetQueryPatternsReportStatusResponses, GetQueryPatternsReportStatusErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}", ...options, }); } /** * Download a finished query patterns report * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_branches` | * | Database | `read_branches` | * | Branch | `read_branch` | */ public getQueryPatternsReport( options: Options, ) { return (options.client ?? this._client).get< unknown, GetQueryPatternsReportErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/query-patterns/{id}/download", ...options, }); } /** * Cancel 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 cancelBranchChangeRequest( options: Options, ) { return (options.client ?? this._client).delete< CancelBranchChangeRequestResponses, CancelBranchChangeRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/resizes", ...options, }); } /** * List roles * * ### 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_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public listRoles( options: Options, ) { return (options.client ?? this._client).get< ListRolesResponses, ListRolesErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles", ...options, }); } /** * Create 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_production_read_only_branch_password`, `create_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public createRole( options: Options, ) { return (options.client ?? this._client).post< CreateRoleResponses, CreateRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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** * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public getDefaultRole( options: Options, ) { return (options.client ?? this._client).get< GetDefaultRoleResponses, GetDefaultRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/default", ...options, }); } /** * 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** * `delete_production_branch_password`, `delete_production_read_only_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public resetDefaultRole( options: Options, ) { return (options.client ?? this._client).post< ResetDefaultRoleResponses, ResetDefaultRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/reset-default", ...options, }); } /** * 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** * `delete_production_branch_password`, `delete_production_read_only_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public deleteRole( options: Options, ) { return (options.client ?? this._client).delete< DeleteRoleResponses, DeleteRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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** * `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_production_read_only_branch`, `connect_branch` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public getRole( options: Options, ) { return (options.client ?? this._client).get< GetRoleResponses, GetRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", ...options, }); } /** * 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** * `create_production_branch_password`, `create_production_read_only_branch_password`, `create_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public updateRole( options: Options, ) { return (options.client ?? this._client).patch< UpdateRoleResponses, UpdateRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Reassign objects owned by one role to another 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_production_read_only_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public reassignRoleObjects( options: Options, ) { return (options.client ?? this._client).post< ReassignRoleObjectsResponses, ReassignRoleObjectsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reassign", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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** * `create_production_branch_password`, `create_production_read_only_branch_password`, `create_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_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, }); } /** * 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** * `delete_production_branch_password`, `delete_production_read_only_branch_password`, `delete_branch_password` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Database | `manage_passwords`, `manage_production_branch_passwords`, `manage_read_only_passwords`, `manage_production_read_only_passwords` | * | Branch | `manage_passwords`, `manage_read_only_passwords` | */ public resetRole( options: Options, ) { return (options.client ?? this._client).post< ResetRoleResponses, ResetRoleErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/roles/{id}/reset", ...options, }); } /** * Disable safe migrations for a branch * * */ public disableSafeMigrations( options: Options, ) { return (options.client ?? this._client).delete< DisableSafeMigrationsResponses, DisableSafeMigrationsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations", ...options, }); } /** * Enable safe migrations for a branch * * */ public enableSafeMigrations( options: Options, ) { return (options.client ?? this._client).post< EnableSafeMigrationsResponses, EnableSafeMigrationsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/safe-migrations", ...options, }); } /** * Get a branch schema * * ### 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 getBranchSchema( options: Options, ) { return (options.client ?? this._client).get< GetBranchSchemaResponses, GetBranchSchemaErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/schema", ...options, }); } /** * Lint a branch schema * * ### 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 lintBranchSchema( options: Options, ) { return (options.client ?? this._client).get< LintBranchSchemaResponses, LintBranchSchemaErrors, ThrowOnError >({ 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, }, }); } /** * Get the deploy queue * The deploy queue returns the current list of deploy requests in the order they will be deployed. * */ public getDeployQueue( options: Options, ) { return (options.client ?? this._client).get< GetDeployQueueResponses, GetDeployQueueErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-queue", ...options, }); } /** * List deploy requests * List deploy requests for 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_deploy_request` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_deploy_requests` | * | Database | `read_deploy_requests` | */ public listDeployRequests( options: Options, ) { return (options.client ?? this._client).get< ListDeployRequestsResponses, ListDeployRequestsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests", ...options, }); } /** * Create 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_requests` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_deploy_requests` | * | Database | `write_deploy_requests` | */ public createDeployRequest( options: Options, ) { return (options.client ?? this._client).post< CreateDeployRequestResponses, CreateDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_deploy_requests` | * | Database | `read_deploy_requests` | */ public getDeployRequest( options: Options, ) { return (options.client ?? this._client).get< GetDeployRequestResponses, GetDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}", ...options, }); } /** * Close 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_deploy_requests` | * | Database | `write_deploy_requests` | */ public closeDeployRequest( options: Options, ) { return (options.client ?? this._client).patch< CloseDeployRequestResponses, CloseDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Complete a gated 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 completeGatedDeployRequest( options: Options, ) { return (options.client ?? this._client).post< CompleteGatedDeployRequestResponses, CompleteGatedDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/apply-deploy", ...options, }); } /** * Update auto-apply for deploy request * Enables or disabled the auto-apply 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 updateAutoApply( options: Options, ) { return (options.client ?? this._client).put< UpdateAutoApplyResponses, UpdateAutoApplyErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/auto-apply", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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 * * ### 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 cancelDeployRequest( options: Options, ) { return (options.client ?? this._client).post< CancelDeployRequestResponses, CancelDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/cancel", ...options, }); } /** * Complete an errored deploy * * ### 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 completeErroredDeploy( options: Options, ) { return (options.client ?? this._client).post< CompleteErroredDeployResponses, CompleteErroredDeployErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/complete-deploy", ...options, }); } /** * Queue 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 queueDeployRequest( options: Options, ) { return (options.client ?? this._client).post< QueueDeployRequestResponses, QueueDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deploy", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get a deployment * Get the deployment 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_deploy_requests` | * | Database | `read_deploy_requests` | */ public getDeployment( options: Options, ) { return (options.client ?? this._client).get< GetDeploymentResponses, GetDeploymentErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/deployment", ...options, }); } /** * List deploy operations * List deploy operations 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_deploy_requests` | * | Database | `read_deploy_requests` | */ public listDeployOperations( options: Options, ) { return (options.client ?? this._client).get< ListDeployOperationsResponses, ListDeployOperationsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/operations", ...options, }); } /** * Complete a revert * * ### 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 completeRevert( options: Options, ) { return (options.client ?? this._client).post< CompleteRevertResponses, CompleteRevertErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/revert", ...options, }); } /** * List deploy request reviews * * ### 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 listDeployRequestReviews( options: Options, ) { return (options.client ?? this._client).get< ListDeployRequestReviewsResponses, ListDeployRequestReviewsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews", ...options, }); } /** * Review a deploy request * Review a deploy request by either approving or commenting on the 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** * `approve_deploy_request`, `review_deploy_request` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `approve_deploy_requests` | * | Database | `approve_deploy_requests` | */ public reviewDeployRequest( options: Options, ) { return (options.client ?? this._client).post< ReviewDeployRequestResponses, ReviewDeployRequestErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/reviews", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Skip revert period * Skips the revert period 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 skipRevertPeriod( options: Options, ) { return (options.client ?? this._client).post< SkipRevertPeriodResponses, SkipRevertPeriodErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/deploy-requests/{number}/skip-revert", ...options, }); } /** * 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_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `connect_production_read_only_branch`, `delete_branch_password`, `delete_production_branch_password`, `delete_production_read_only_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `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_branches` | * | Database | `read_branches` | */ public listReadOnlyRegions( options: Options, ) { return (options.client ?? this._client).get< ListReadOnlyRegionsResponses, ListReadOnlyRegionsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/read-only-regions", ...options, }); } /** * 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_database`, `delete_database`, `write_database`, `read_branch`, `delete_branch`, `create_branch`, `delete_production_branch`, `connect_branch`, `connect_production_branch`, `connect_production_read_only_branch`, `delete_branch_password`, `delete_production_branch_password`, `delete_production_read_only_branch_password`, `read_deploy_request`, `create_deploy_request`, `approve_deploy_request`, `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 listDatabaseRegions( options: Options, ) { return (options.client ?? this._client).get< ListDatabaseRegionsResponses, ListDatabaseRegionsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/regions", ...options, }); } /** * List schema recommendations * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_databases` | * | Database | `read_database` | */ public listSchemaRecommendations( options: Options, ) { return (options.client ?? this._client).get< ListSchemaRecommendationsResponses, ListSchemaRecommendationsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/schema-recommendations", ...options, }); } /** * Get a schema recommendation * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_databases` | * | Database | `read_database` | */ public getSchemaRecommendation( options: Options, ) { return (options.client ?? this._client).get< GetSchemaRecommendationResponses, GetSchemaRecommendationErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/schema-recommendations/{number}", ...options, }); } /** * Dismiss a schema recommendation * * ### 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 dismissSchemaRecommendation( options: Options, ) { return (options.client ?? this._client).post< DismissSchemaRecommendationResponses, DismissSchemaRecommendationErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/schema-recommendations/{number}/dismiss", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get database 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 | `read_databases` | * | Database | `read_database` | */ public getDatabaseThrottler( options: Options, ) { return (options.client ?? this._client).get< GetDatabaseThrottlerResponses, GetDatabaseThrottlerErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/throttler", ...options, }); } /** * Update database 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 updateDatabaseThrottler( options: Options, ) { return (options.client ?? this._client).patch< UpdateDatabaseThrottlerResponses, UpdateDatabaseThrottlerErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/throttler", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List webhooks * List webhooks for 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_databases` | * | Database | `read_database` | */ public listWebhooks( options: Options, ) { return (options.client ?? this._client).get< ListWebhooksResponses, ListWebhooksErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks", ...options, }); } /** * Create a webhook * * ### 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 createWebhook( options: Options, ) { return (options.client ?? this._client).post< CreateWebhookResponses, CreateWebhookErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete a webhook * * ### 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 deleteWebhook( options: Options, ) { return (options.client ?? this._client).delete< DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks/{id}", ...options, }); } /** * Get a webhook * * ### 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` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_databases` | * | Database | `read_database` | */ public getWebhook( options: Options, ) { return (options.client ?? this._client).get< GetWebhookResponses, GetWebhookErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks/{id}", ...options, }); } /** * Update a webhook * * ### 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 updateWebhook( options: Options, ) { return (options.client ?? this._client).patch< UpdateWebhookResponses, UpdateWebhookErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Test a webhook * Sends a test event to the webhook * ### 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 testWebhook( options: Options, ) { return (options.client ?? this._client).post< TestWebhookResponses, TestWebhookErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/webhooks/{id}/test", ...options, }); } /** * List workflows * * */ public listWorkflows( options: Options, ) { return (options.client ?? this._client).get< ListWorkflowsResponses, ListWorkflowsErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows", ...options, }); } /** * Create a workflow * * */ public createWorkflow( options: Options, ) { return (options.client ?? this._client).post< CreateWorkflowResponses, CreateWorkflowErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Cancel a workflow * * */ public workflowCancel( options: Options, ) { return (options.client ?? this._client).delete< WorkflowCancelResponses, WorkflowCancelErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}", ...options, }); } /** * Get a workflow * * */ public getWorkflow( options: Options, ) { return (options.client ?? this._client).get< GetWorkflowResponses, GetWorkflowErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}", ...options, }); } /** * Complete a workflow * * */ public workflowComplete( options: Options, ) { return (options.client ?? this._client).patch< WorkflowCompleteResponses, WorkflowCompleteErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/complete", ...options, }); } /** * Cutover traffic * * */ public workflowCutover( options: Options, ) { return (options.client ?? this._client).patch< WorkflowCutoverResponses, WorkflowCutoverErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/cutover", ...options, }); } /** * Retry a failed workflow * * */ public workflowRetry( options: Options, ) { return (options.client ?? this._client).patch< WorkflowRetryResponses, WorkflowRetryErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/retry", ...options, }); } /** * Reverse traffic cutover * * */ public workflowReverseCutover( options: Options, ) { return (options.client ?? this._client).patch< WorkflowReverseCutoverResponses, WorkflowReverseCutoverErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-cutover", ...options, }); } /** * Reverse traffic * * */ public workflowReverseTraffic( options: Options, ) { return (options.client ?? this._client).patch< WorkflowReverseTrafficResponses, WorkflowReverseTrafficErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/reverse-traffic", ...options, }); } /** * Switch primary traffic * * */ public workflowSwitchPrimaries( options: Options, ) { return (options.client ?? this._client).patch< WorkflowSwitchPrimariesResponses, WorkflowSwitchPrimariesErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-primaries", ...options, }); } /** * Switch replica traffic * * */ public workflowSwitchReplicas( options: Options, ) { return (options.client ?? this._client).patch< WorkflowSwitchReplicasResponses, WorkflowSwitchReplicasErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/switch-replicas", ...options, }); } /** * Verify workflow data * * */ public verifyWorkflow( options: Options, ) { return (options.client ?? this._client).patch< VerifyWorkflowResponses, VerifyWorkflowErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/workflows/{number}/verify-data", ...options, }); } /** * 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** * `read_invoices` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_invoices` | */ 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).get< GetOauthApplicationResponses, GetOauthApplicationErrors, ThrowOnError >({ url: "/organizations/{organization}/oauth-applications/{application_id}", ...options, }); } /** * List OAuth tokens * List OAuth tokens created by 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_tokens` * * */ public listOauthTokens( options: Options, ) { return (options.client ?? this._client).get< ListOauthTokensResponses, ListOauthTokensErrors, ThrowOnError >({ url: "/organizations/{organization}/oauth-applications/{application_id}/tokens", ...options, }); } /** * Delete an OAuth token * * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** * `delete_oauth_tokens` * * */ public deleteOauthToken( options: Options, ) { return (options.client ?? this._client).delete< DeleteOauthTokenResponses, DeleteOauthTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", ...options, }); } /** * Get an OAuth 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_tokens` * * */ public getOauthToken( options: Options, ) { return (options.client ?? this._client).get< GetOauthTokenResponses, GetOauthTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/oauth-applications/{application_id}/tokens/{token_id}", ...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 * ### Authorization * A service token must have at least one of the following access in order to use this API endpoint: * * **Service Token Accesses** * `write_oauth_tokens` * * */ public createOauthToken( options: Options, ) { return (options.client ?? this._client).post< CreateOauthTokenResponses, CreateOauthTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/oauth-applications/{id}/token", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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_organization` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | User | `read_organizations` | * | Organization | `read_organization` | */ public listRegionsForOrganization( options: Options, ) { return (options.client ?? this._client).get< ListRegionsForOrganizationResponses, ListRegionsForOrganizationErrors, ThrowOnError >({ url: "/organizations/{organization}/regions", ...options, }); } /** * List service tokens * List service tokens for an 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_service_tokens` * * */ public listServiceTokens( options: Options, ) { return (options.client ?? this._client).get< ListServiceTokensResponses, ListServiceTokensErrors, ThrowOnError >({ url: "/organizations/{organization}/service-tokens", ...options, }); } /** * Create a service token * Create a new service token for 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** * `write_service_tokens` * * */ public createServiceToken( options: Options, ) { return (options.client ?? this._client).post< CreateServiceTokenResponses, CreateServiceTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/service-tokens", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * 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** * `delete_service_tokens` * * */ public deleteServiceToken( options: Options, ) { return (options.client ?? this._client).delete< DeleteServiceTokenResponses, DeleteServiceTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/service-tokens/{id}", ...options, }); } /** * 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_service_tokens` * * */ public getServiceToken( options: Options, ) { return (options.client ?? this._client).get< GetServiceTokenResponses, GetServiceTokenErrors, ThrowOnError >({ url: "/organizations/{organization}/service-tokens/{id}", ...options, }); } /** * List teams in 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_organization` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `read_organization` | */ public listOrganizationTeams( options: Options, ) { return (options.client ?? this._client).get< ListOrganizationTeamsResponses, ListOrganizationTeamsErrors, ThrowOnError >({ url: "/organizations/{organization}/teams", ...options, }); } /** * Create an organization team * * ### 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_teams` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_organization` | */ public createOrganizationTeam( options: Options, ) { return (options.client ?? this._client).post< CreateOrganizationTeamResponses, CreateOrganizationTeamErrors, ThrowOnError >({ url: "/organizations/{organization}/teams", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete an organization team * * ### 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_teams` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_organization` | */ public deleteOrganizationTeam( options: Options, ) { return (options.client ?? this._client).delete< DeleteOrganizationTeamResponses, DeleteOrganizationTeamErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}", ...options, }); } /** * Get an organization team * * ### 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 getOrganizationTeam( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationTeamResponses, GetOrganizationTeamErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}", ...options, }); } /** * Update an organization team * * ### 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_teams` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_organization` | */ public updateOrganizationTeam( options: Options, ) { return (options.client ?? this._client).patch< UpdateOrganizationTeamResponses, UpdateOrganizationTeamErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List team 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 listOrganizationTeamMembers( options: Options, ) { return (options.client ?? this._client).get< ListOrganizationTeamMembersResponses, ListOrganizationTeamMembersErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}/members", ...options, }); } /** * Add a member to a team * * ### 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_teams` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_organization` | */ public addOrganizationTeamMember( options: Options, ) { return (options.client ?? this._client).post< AddOrganizationTeamMemberResponses, AddOrganizationTeamMemberErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}/members", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Remove a member from a team * * ### 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_teams` * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | Organization | `write_organization` | */ public removeOrganizationTeamMember( options: Options, ) { return (options.client ?? this._client).delete< RemoveOrganizationTeamMemberResponses, RemoveOrganizationTeamMemberErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}/members/{id}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get a team 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 getOrganizationTeamMember( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationTeamMemberResponses, GetOrganizationTeamMemberErrors, ThrowOnError >({ url: "/organizations/{organization}/teams/{team}/members/{id}", ...options, }); } /** * List public regions * Endpoint is available without authentication. * */ public listPublicRegions( options?: Options, ) { return (options?.client ?? this._client).get< ListPublicRegionsResponses, ListPublicRegionsErrors, ThrowOnError >({ url: "/regions", ...options, }); } /** * Get current user * Get the user associated with this service token * ### Authorization * A OAuth token must have at least one of the following scopes in order to use this API endpoint: * * **OAuth Scopes** * * | Resource | Scopes | * | :------- | :---------- | * | User | `read_user` | */ public getCurrentUser( options?: Options, ) { return (options?.client ?? this._client).get< GetCurrentUserResponses, GetCurrentUserErrors, ThrowOnError >({ url: "/user", ...options, }); } /** * List keyspace resizes */ public listKeyspaceResizes( options: Options, ) { return (options.client ?? this._client).get< ListKeyspaceResizesResponses, ListKeyspaceResizesErrors, ThrowOnError >({ url: "/organizations/{organization}/databases/{database}/branches/{branch}/keyspaces/{name}/resizes", ...options, }); } }