// 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 { CreateByocInfrastructureData, CreateByocInfrastructureErrors, CreateByocInfrastructureResponses, CreateClickPipeData, CreateClickPipeErrors, CreateClickPipeResponses, CreateInvitationData, CreateInvitationErrors, CreateInvitationResponses, CreateKeyData, CreateKeyErrors, CreateKeyResponses, CreateNewServiceData, CreateNewServiceErrors, CreateNewServiceResponses, CreatePrivateEndpointData, CreatePrivateEndpointErrors, CreatePrivateEndpointResponses, CreateReversePrivateEndpointData, CreateReversePrivateEndpointErrors, CreateReversePrivateEndpointResponses, DeleteClickPipeData, DeleteClickPipeErrors, DeleteClickPipeResponses, DeleteKeyData, DeleteKeyErrors, DeleteKeyResponses, DeleteOrganizationInvitationData, DeleteOrganizationInvitationErrors, DeleteOrganizationInvitationResponses, DeleteReversePrivateEndpointData, DeleteReversePrivateEndpointErrors, DeleteReversePrivateEndpointResponses, DeleteServiceData, DeleteServiceErrors, DeleteServiceQueryEndpointForInstanceData, DeleteServiceQueryEndpointForInstanceErrors, DeleteServiceQueryEndpointForInstanceResponses, DeleteServiceResponses, GetBackupDetailsData, GetBackupDetailsErrors, GetBackupDetailsResponses, GetCdcClickPipesScalingData, GetCdcClickPipesScalingErrors, GetCdcClickPipesScalingResponses, GetClickPipeData, GetClickPipeErrors, GetClickPipeResponses, GetClickPipeSettingsData, GetClickPipeSettingsErrors, GetClickPipeSettingsResponses, GetInvitationDetailsData, GetInvitationDetailsErrors, GetInvitationDetailsResponses, GetKeyDetailsData, GetKeyDetailsErrors, GetKeyDetailsResponses, GetMemberDetailsData, GetMemberDetailsErrors, GetMemberDetailsResponses, GetOrganizationDetailsData, GetOrganizationDetailsErrors, GetOrganizationDetailsResponses, GetOrganizationMetricsData, GetOrganizationMetricsErrors, GetOrganizationMetricsResponses, GetOrganizationUsageCostsData, GetOrganizationUsageCostsErrors, GetOrganizationUsageCostsResponses, GetPrivateEndpointConfigurationData, GetPrivateEndpointConfigurationErrors, GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationData, GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationErrors, GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationResponses, GetPrivateEndpointConfigurationResponses, GetReversePrivateEndpointData, GetReversePrivateEndpointErrors, GetReversePrivateEndpointResponses, GetServiceBackupConfigurationData, GetServiceBackupConfigurationErrors, GetServiceBackupConfigurationResponses, GetServiceDetailsData, GetServiceDetailsErrors, GetServiceDetailsResponses, GetServiceMetricsData, GetServiceMetricsErrors, GetServiceMetricsResponses, GetServiceQueryEndpointForInstanceData, GetServiceQueryEndpointForInstanceErrors, GetServiceQueryEndpointForInstanceResponses, ListAllInvitationsData, ListAllInvitationsErrors, ListAllInvitationsResponses, ListAllKeysData, ListAllKeysErrors, ListAllKeysResponses, ListAvailableOrganizationsData, ListAvailableOrganizationsErrors, ListAvailableOrganizationsResponses, ListClickPipesData, ListClickPipesErrors, ListClickPipesResponses, ListOrganizationActivitiesData, ListOrganizationActivitiesErrors, ListOrganizationActivitiesResponses, ListOrganizationMembersData, ListOrganizationMembersErrors, ListOrganizationMembersResponses, ListOrganizationServicesData, ListOrganizationServicesErrors, ListOrganizationServicesResponses, ListReversePrivateEndpointsData, ListReversePrivateEndpointsErrors, ListReversePrivateEndpointsResponses, ListServiceBackupsData, ListServiceBackupsErrors, ListServiceBackupsResponses, OrganizationActivityData, OrganizationActivityErrors, OrganizationActivityResponses, RemoveByocInfrastructureData, RemoveByocInfrastructureErrors, RemoveByocInfrastructureResponses, RemoveOrganizationMemberData, RemoveOrganizationMemberErrors, RemoveOrganizationMemberResponses, ScalingClickPipeData, ScalingClickPipeErrors, ScalingClickPipeResponses, UpdateCdcClickPipesScalingData, UpdateCdcClickPipesScalingErrors, UpdateCdcClickPipesScalingResponses, UpdateClickPipeData, UpdateClickPipeErrors, UpdateClickPipeResponses, UpdateClickPipeSettingsData, UpdateClickPipeSettingsErrors, UpdateClickPipeSettingsResponses, UpdateClickPipeStateData, UpdateClickPipeStateErrors, UpdateClickPipeStateResponses, UpdateKeyData, UpdateKeyErrors, UpdateKeyResponses, UpdateOrganizationDetailsData, UpdateOrganizationDetailsErrors, UpdateOrganizationDetailsResponses, UpdateOrganizationMemberData, UpdateOrganizationMemberErrors, UpdateOrganizationMemberResponses, UpdateServiceAutoScalingSettings2Data, UpdateServiceAutoScalingSettings2Errors, UpdateServiceAutoScalingSettings2Responses, UpdateServiceAutoScalingSettingsData, UpdateServiceAutoScalingSettingsErrors, UpdateServiceAutoScalingSettingsResponses, UpdateServiceBackupConfigurationData, UpdateServiceBackupConfigurationErrors, UpdateServiceBackupConfigurationResponses, UpdateServiceBasicDetailsData, UpdateServiceBasicDetailsErrors, UpdateServiceBasicDetailsResponses, UpdateServicePasswordData, UpdateServicePasswordErrors, UpdateServicePasswordResponses, UpdateServiceStateData, UpdateServiceStateErrors, UpdateServiceStateResponses, UpsertServiceQueryEndpointForInstanceData, UpsertServiceQueryEndpointForInstanceErrors, UpsertServiceQueryEndpointForInstanceResponses, } 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 ClickhouseClient extends _HeyApiClient { /** * Get list of available organizations * Returns a list with a single organization associated with the API key in the request. */ public listAvailableOrganizations( options?: Options, ) { return (options?.client ?? this._client).get< ListAvailableOrganizationsResponses, ListAvailableOrganizationsErrors, ThrowOnError >({ url: "/v1/organizations", ...options, }); } /** * Get organization details * Returns details of a single organization. In order to get the details, the auth key must belong to the organization. */ public getOrganizationDetails( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationDetailsResponses, GetOrganizationDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}", ...options, }); } /** * Update organization details * Updates organization fields. Requires ADMIN auth key role. */ public updateOrganizationDetails( options: Options, ) { return (options.client ?? this._client).patch< UpdateOrganizationDetailsResponses, UpdateOrganizationDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get organization metrics * Returns prometheus metrics for all services in an organization. */ public getOrganizationMetrics( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationMetricsResponses, GetOrganizationMetricsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/prometheus", ...options, }); } /** * List of organization services * Returns a list of all services in the organization. */ public listOrganizationServices( options: Options, ) { return (options.client ?? this._client).get< ListOrganizationServicesResponses, ListOrganizationServicesErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services", ...options, }); } /** * Create new service * Creates a new service in the organization, and returns the current service state and a password to access the service. The service is started asynchronously. */ public createNewService( options: Options, ) { return (options.client ?? this._client).post< CreateNewServiceResponses, CreateNewServiceErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete service * Deletes the service. The service must be in stopped state and is deleted asynchronously after this method call. */ public deleteService( options: Options, ) { return (options.client ?? this._client).delete< DeleteServiceResponses, DeleteServiceErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}", ...options, }); } /** * Get service details * Returns a service that belongs to the organization */ public getServiceDetails( options: Options, ) { return (options.client ?? this._client).get< GetServiceDetailsResponses, GetServiceDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}", ...options, }); } /** * Update service basic details * Updates basic service details like service name or IP access list. */ public updateServiceBasicDetails( options: Options, ) { return (options.client ?? this._client).patch< UpdateServiceBasicDetailsResponses, UpdateServiceBasicDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get private endpoint configuration * Information required to set up a private endpoint */ public getPrivateEndpointConfiguration( options: Options, ) { return (options.client ?? this._client).get< GetPrivateEndpointConfigurationResponses, GetPrivateEndpointConfigurationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/privateEndpointConfig", ...options, }); } /** * Delete the service query endpoint for a given instance * This is an experimental feature. Please contact support to enable it. */ public deleteServiceQueryEndpointForInstance< ThrowOnError extends boolean = true, >(options: Options) { return (options.client ?? this._client).delete< DeleteServiceQueryEndpointForInstanceResponses, DeleteServiceQueryEndpointForInstanceErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint", ...options, }); } /** * Get the service query endpoint for a given instance * This is an experimental feature. Please contact support to enable it. */ public getServiceQueryEndpointForInstance< ThrowOnError extends boolean = true, >(options: Options) { return (options.client ?? this._client).get< GetServiceQueryEndpointForInstanceResponses, GetServiceQueryEndpointForInstanceErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint", ...options, }); } /** * Upsert the service query endpoint for a given instance * This is an experimental feature. Please contact support to enable it. */ public upsertServiceQueryEndpointForInstance< ThrowOnError extends boolean = true, >(options: Options) { return (options.client ?? this._client).post< UpsertServiceQueryEndpointForInstanceResponses, UpsertServiceQueryEndpointForInstanceErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Update service state * Starts or stop service */ public updateServiceState( options: Options, ) { return (options.client ?? this._client).patch< UpdateServiceStateResponses, UpdateServiceStateErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/state", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Update service auto scaling settings * Updates minimum and maximum total memory limits and idle mode scaling behavior for the service. The memory settings are available only for "production" services and must be a multiple of 12 starting from 24GB. Please contact support to enable adjustment of numReplicas. * @deprecated */ public updateServiceAutoScalingSettings( options: Options, ) { return (options.client ?? this._client).patch< UpdateServiceAutoScalingSettingsResponses, UpdateServiceAutoScalingSettingsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/scaling", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Update service auto scaling settings * Updates minimum and maximum memory limits per replica and idle mode scaling behavior for the service. The memory settings are available only for "production" services and must be a multiple of 4 starting from 8GB. Please contact support to enable adjustment of numReplicas. */ public updateServiceAutoScalingSettings2( options: Options, ) { return (options.client ?? this._client).patch< UpdateServiceAutoScalingSettings2Responses, UpdateServiceAutoScalingSettings2Errors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/replicaScaling", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Update service password * Sets a new password for the service */ public updateServicePassword( options: Options, ) { return (options.client ?? this._client).patch< UpdateServicePasswordResponses, UpdateServicePasswordErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/password", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Create a private endpoint * Create a new private endpoint. The private endpoint will be associated with this service and organization */ public createPrivateEndpoint( options: Options, ) { return (options.client ?? this._client).post< CreatePrivateEndpointResponses, CreatePrivateEndpointErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/privateEndpoint", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get service metrics * Returns prometheus metrics for a service. */ public getServiceMetrics( options: Options, ) { return (options.client ?? this._client).get< GetServiceMetricsResponses, GetServiceMetricsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/prometheus", ...options, }); } /** * List of service backups * Returns a list of all backups for the service. The most recent backups comes first in the list. */ public listServiceBackups( options: Options, ) { return (options.client ?? this._client).get< ListServiceBackupsResponses, ListServiceBackupsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/backups", ...options, }); } /** * Get backup details * Returns a single backup info. */ public getBackupDetails( options: Options, ) { return (options.client ?? this._client).get< GetBackupDetailsResponses, GetBackupDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/backups/{backupId}", ...options, }); } /** * Get service backup configuration * Returns the service backup configuration. */ public getServiceBackupConfiguration( options: Options, ) { return (options.client ?? this._client).get< GetServiceBackupConfigurationResponses, GetServiceBackupConfigurationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/backupConfiguration", ...options, }); } /** * Update service backup configuration * Updates service backup configuration. Requires ADMIN auth key role. Setting the properties with null value, will reset the properties to theirs default values. */ public updateServiceBackupConfiguration( options: Options, ) { return (options.client ?? this._client).patch< UpdateServiceBackupConfigurationResponses, UpdateServiceBackupConfigurationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/backupConfiguration", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get list of all keys * Returns a list of all keys in the organization. */ public listAllKeys( options: Options, ) { return (options.client ?? this._client).get< ListAllKeysResponses, ListAllKeysErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/keys", ...options, }); } /** * Create key * Creates new API key. */ public createKey( options: Options, ) { return (options.client ?? this._client).post< CreateKeyResponses, CreateKeyErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/keys", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete key * Deletes API key. Only a key not used to authenticate the active request can be deleted. */ public deleteKey( options: Options, ) { return (options.client ?? this._client).delete< DeleteKeyResponses, DeleteKeyErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/keys/{keyId}", ...options, }); } /** * Get key details * Returns a single key details. */ public getKeyDetails( options: Options, ) { return (options.client ?? this._client).get< GetKeyDetailsResponses, GetKeyDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/keys/{keyId}", ...options, }); } /** * Update key * Updates API key properties. */ public updateKey( options: Options, ) { return (options.client ?? this._client).patch< UpdateKeyResponses, UpdateKeyErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/keys/{keyId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List organization members * Returns a list of all members in the organization. */ public listOrganizationMembers( options: Options, ) { return (options.client ?? this._client).get< ListOrganizationMembersResponses, ListOrganizationMembersErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/members", ...options, }); } /** * Remove an organization member * Removes a user from the organization */ public removeOrganizationMember( options: Options, ) { return (options.client ?? this._client).delete< RemoveOrganizationMemberResponses, RemoveOrganizationMemberErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/members/{userId}", ...options, }); } /** * Get member details * Returns a single organization member details. */ public getMemberDetails( options: Options, ) { return (options.client ?? this._client).get< GetMemberDetailsResponses, GetMemberDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/members/{userId}", ...options, }); } /** * Update organization member * Updates organization member role. */ public updateOrganizationMember( options: Options, ) { return (options.client ?? this._client).patch< UpdateOrganizationMemberResponses, UpdateOrganizationMemberErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/members/{userId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * List all invitations * Returns list of all organization invitations. */ public listAllInvitations( options: Options, ) { return (options.client ?? this._client).get< ListAllInvitationsResponses, ListAllInvitationsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/invitations", ...options, }); } /** * Create an invitation * Creates organization invitation. */ public createInvitation( options: Options, ) { return (options.client ?? this._client).post< CreateInvitationResponses, CreateInvitationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/invitations", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete organization invitation * Deletes a single organization invitation. */ public deleteOrganizationInvitation( options: Options, ) { return (options.client ?? this._client).delete< DeleteOrganizationInvitationResponses, DeleteOrganizationInvitationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/invitations/{invitationId}", ...options, }); } /** * Get invitation details * Returns details for a single organization invitation. */ public getInvitationDetails( options: Options, ) { return (options.client ?? this._client).get< GetInvitationDetailsResponses, GetInvitationDetailsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/invitations/{invitationId}", ...options, }); } /** * List of organization activities * Returns a list of all organization activities. */ public listOrganizationActivities( options: Options, ) { return (options.client ?? this._client).get< ListOrganizationActivitiesResponses, ListOrganizationActivitiesErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/activities", ...options, }); } /** * Organization activity * Returns a single organization activity by ID. */ public organizationActivity( options: Options, ) { return (options.client ?? this._client).get< OrganizationActivityResponses, OrganizationActivityErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/activities/{activityId}", ...options, }); } /** * Get organization usage costs * Returns a grand total and a list of daily, per-entity organization usage cost records for the organization in the queried time period (maximum 31 days). All days in both the request and the response are evaluated based on the UTC timezone. */ public getOrganizationUsageCosts( options: Options, ) { return (options.client ?? this._client).get< GetOrganizationUsageCostsResponses, GetOrganizationUsageCostsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/usageCost", ...options, }); } /** * List ClickPipes * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns a list of ClickPipes. */ public listClickPipes( options: Options, ) { return (options.client ?? this._client).get< ListClickPipesResponses, ListClickPipesErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes", ...options, }); } /** * Create ClickPipe * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Create a new ClickPipe. */ public createClickPipe( options: Options, ) { return (options.client ?? this._client).post< CreateClickPipeResponses, CreateClickPipeErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete ClickPipe * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Delete the specified ClickPipe. */ public deleteClickPipe( options: Options, ) { return (options.client ?? this._client).delete< DeleteClickPipeResponses, DeleteClickPipeErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}", ...options, }); } /** * Get ClickPipe * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns the specified ClickPipe. */ public getClickPipe( options: Options, ) { return (options.client ?? this._client).get< GetClickPipeResponses, GetClickPipeErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}", ...options, }); } /** * Update ClickPipe * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Update the specified ClickPipe. */ public updateClickPipe( options: Options, ) { return (options.client ?? this._client).patch< UpdateClickPipeResponses, UpdateClickPipeErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get ClickPipe settings * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns the advanced settings for the specified ClickPipe. */ public getClickPipeSettings( options: Options, ) { return (options.client ?? this._client).get< GetClickPipeSettingsResponses, GetClickPipeSettingsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings", ...options, }); } /** * Update ClickPipe settings * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Update the advanced settings for the specified ClickPipe. Send key-value pairs where values can be strings, numbers, or booleans. */ public updateClickPipeSettings( options: Options, ) { return (options.client ?? this._client).put< UpdateClickPipeSettingsResponses, UpdateClickPipeSettingsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Scaling ClickPipe * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Change scaling settings for the specified ClickPipe. */ public scalingClickPipe( options: Options, ) { return (options.client ?? this._client).patch< ScalingClickPipeResponses, ScalingClickPipeErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/scaling", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Update ClickPipe state * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Start, stop or resync ClickPipe. Stopping a ClickPipe will stop the ingestion process from any state. Starting is allowed for ClickPipes in the "Stopped" state or with a "Failed" state. Resyncing is only for Postgres pipes and can be done from any state. */ public updateClickPipeState( options: Options, ) { return (options.client ?? this._client).patch< UpdateClickPipeStateResponses, UpdateClickPipeStateErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/state", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get CDC ClickPipes scaling * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Get scaling settings for DB ClickPipes. * * The infrastructure is shared between all DB ClickPipes in the service, both for initial load and CDC. For billing purposes, 2 CPU cores and 8 GB of RAM [correspond](https://clickhouse.com/docs/cloud/manage/billing/overview#clickpipes-for-postgres-cdc) to one compute unit. * * **This endpoint becomes available once at least one DB ClickPipe was provisioned.** */ public getCdcClickPipesScaling( options: Options, ) { return (options.client ?? this._client).get< GetCdcClickPipesScalingResponses, GetCdcClickPipesScalingErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesCdcScaling", ...options, }); } /** * Update CDC ClickPipes scaling * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Update scaling settings for DB ClickPipes. * * The infrastructure is shared between all DB ClickPipes in the service, both for initial load and CDC. Scaling settings may take a few minutes to fully propagate. * * For billing purposes, 2 CPU cores and 8 GB of RAM [correspond](https://clickhouse.com/docs/cloud/manage/billing/overview#clickpipes-for-postgres-cdc) to one compute unit. If your organization tier changes, DB ClickPipes will be [rescaled](https://clickhouse.com/docs/cloud/manage/billing/overview#compute) appropriately. * * **This endpoint becomes available once at least one DB ClickPipe was provisioned.** */ public updateCdcClickPipesScaling( options: Options, ) { return (options.client ?? this._client).patch< UpdateCdcClickPipesScalingResponses, UpdateCdcClickPipesScalingErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesCdcScaling", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Get private endpoint configuration for region within cloud provider for an organization * Deprecated. Please follow [documentation](https://clickhouse.com/docs/manage/security/aws-privatelink#add-endpoint-id-to-services-allow-list) for the updated process. * @deprecated */ public getPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganization< ThrowOnError extends boolean = true, >( options: Options< GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationData, ThrowOnError >, ) { return (options.client ?? this._client).get< GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationResponses, GetPrivateEndpointConfigurationForRegionWithinCloudProviderForOrganizationErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/privateEndpointConfig", ...options, }); } /** * Create BYOC Infrastructure * Create a new BYOC Infrastructure in the organization. Returns the configuration of the newly created infrastructure */ public createByocInfrastructure( options: Options, ) { return (options.client ?? this._client).post< CreateByocInfrastructureResponses, CreateByocInfrastructureErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/byocInfrastructure", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Remove a BYOC infrastructure * Removes a BYOC Infrastructure from the organization */ public removeByocInfrastructure( options: Options, ) { return (options.client ?? this._client).delete< RemoveByocInfrastructureResponses, RemoveByocInfrastructureErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/byocInfrastructure/{byocInfrastructureId}", ...options, }); } /** * List reverse private endpoints * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns a list of reverse private endpoints for the specified service. */ public listReversePrivateEndpoints( options: Options, ) { return (options.client ?? this._client).get< ListReversePrivateEndpointsResponses, ListReversePrivateEndpointsErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesReversePrivateEndpoints", ...options, }); } /** * Create reverse private endpoint * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Create a new reverse private endpoint. */ public createReversePrivateEndpoint( options: Options, ) { return (options.client ?? this._client).post< CreateReversePrivateEndpointResponses, CreateReversePrivateEndpointErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesReversePrivateEndpoints", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); } /** * Delete reverse private endpoint * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Delete the reverse private endpoint with the specified ID. */ public deleteReversePrivateEndpoint( options: Options, ) { return (options.client ?? this._client).delete< DeleteReversePrivateEndpointResponses, DeleteReversePrivateEndpointErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesReversePrivateEndpoints/{reversePrivateEndpointId}", ...options, }); } /** * Get reverse private endpoint * **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns the reverse private endpoint with the specified ID. */ public getReversePrivateEndpoint( options: Options, ) { return (options.client ?? this._client).get< GetReversePrivateEndpointResponses, GetReversePrivateEndpointErrors, ThrowOnError >({ url: "/v1/organizations/{organizationId}/services/{serviceId}/clickpipesReversePrivateEndpoints/{reversePrivateEndpointId}", ...options, }); } }