export type UpdateApiV4OrganizationsOrganizationIdCmekProvidersArgs = {body: {cloudProvider: 'aws' | 'gcp' | 'azure'}}; export type UpdateApiV4OrganizationsOrganizationIdCmekProvidersOptions = {baseUrl?: string | undefined, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable CMEK For Cloud Services Provider * * PUT /v4/organizations/{organizationId}/cmek/providers */ export const updateApiV4OrganizationsOrganizationIdCmekProviders = async (args: UpdateApiV4OrganizationsOrganizationIdCmekProvidersArgs, options?: UpdateApiV4OrganizationsOrganizationIdCmekProvidersOptions) => { const {baseUrl = "https://cloudapi.cloud.couchbase.com", fetch: fetchFn = fetch, token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (token !== undefined) headers.set('authorization', `Bearer ${token}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/${encodeURIComponent(String(args.organizationId))}/cmek/providers${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };