export type DeleteApiV4OrganizationsOrganizationIdAiServicesModelsApiKeysApiKeyIdOptions = {baseUrl?: string | undefined, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete API key * * DELETE /v4/organizations/{organizationId}/aiServices/models/apiKeys/{apiKeyId} */ export const deleteApiV4OrganizationsOrganizationIdAiServicesModelsApiKeysApiKeyId = async (options?: DeleteApiV4OrganizationsOrganizationIdAiServicesModelsApiKeysApiKeyIdOptions) => { const {baseUrl = "https://cloudapi.cloud.couchbase.com", fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (token !== undefined) headers.set('authorization', `Bearer ${token}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/${encodeURIComponent(String(args.organizationId))}/aiServices/models/apiKeys/${encodeURIComponent(String(args.apiKeyId))}${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 };