export type UpdateProviderRequest = {configuration: {accessKeyId?: string | undefined, secretAccessKey?: string | undefined, sessionToken?: string | undefined, awsRegion?: string | undefined, bucket?: string | undefined, folderPath?: string | undefined} | {apiKey?: string | undefined} | {accessKeyId?: string | undefined, secretAccessKey?: string | undefined, apiKey?: string | undefined, region?: ('us-east-1' | 'us-west-2' | 'ap-northeast-1' | 'ap-northeast-2' | 'ap-northeast-3' | 'ap-south-1' | 'ap-south-2' | 'ap-southeast-1' | 'ap-southeast-2' | 'ca-central-1' | 'eu-central-1' | 'eu-central-2' | 'eu-north-1' | 'eu-south-1' | 'eu-south-2' | 'eu-west-1' | 'eu-west-2' | 'eu-west-3' | 'sa-east-1') | undefined}}; export type UpdateApiV4OrganizationsOrganizationIdAiServicesProvidersProviderIdArgs = {'If-Match'?: string | undefined, body: UpdateProviderRequest}; export type UpdateApiV4OrganizationsOrganizationIdAiServicesProvidersProviderIdOptions = {baseUrl?: string | undefined, token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update provider * * PUT /v4/organizations/{organizationId}/aiServices/providers/{providerId} */ export const updateApiV4OrganizationsOrganizationIdAiServicesProvidersProviderId = async (args: UpdateApiV4OrganizationsOrganizationIdAiServicesProvidersProviderIdArgs, options?: UpdateApiV4OrganizationsOrganizationIdAiServicesProvidersProviderIdOptions) => { 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 (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (token !== undefined) headers.set('authorization', `Bearer ${token}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/${encodeURIComponent(String(args.organizationId))}/aiServices/providers/${encodeURIComponent(String(args.providerId))}${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 };