export type DeleteApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdArgs = {retainsnapshotbackups?: boolean | undefined}; export type DeleteApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdOptions = {baseUrl?: string | undefined, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Cluster * * DELETE /v4/organizations/{organizationId}/projects/{projectId}/clusters/{clusterId} */ export const deleteApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterId = async (args: DeleteApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdArgs, options?: DeleteApiV4OrganizationsOrganizationIdProjectsProjectIdClustersClusterIdOptions) => { const {baseUrl = "https://cloudapi.cloud.couchbase.com", fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.retainsnapshotbackups != null) query.append("retainsnapshotbackups", String(args.retainsnapshotbackups)) if (token !== undefined) headers.set('authorization', `Bearer ${token}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/${encodeURIComponent(String(args.organizationId))}/projects/${encodeURIComponent(String(args.projectId))}/clusters/${encodeURIComponent(String(args.clusterId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };