export type CdnCustomHostingUpdateApiRequest = {provider: 'NONE' | 'AMAZON_S3' | 'AZURE_BLOB_STORAGE' | 'GOOGLE_CLOUD_STORAGE', accessKey?: string | undefined, secretKey?: string | undefined, region?: string | undefined, bucket?: string | undefined, accountName?: string | undefined, accountKey?: string | undefined, containerName?: string | undefined, credentialsJson?: string | undefined}; export type PatchApiApiV1HostingCustomHostingArgs = {body: CdnCustomHostingUpdateApiRequest}; export type PatchApiApiV1HostingCustomHostingOptions = {baseUrl?: string | undefined, ProjectAPIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update custom translation hosting settings * * PATCH /api/v1/hosting/custom-hosting */ export const patchApiApiV1HostingCustomHosting = async (args: PatchApiApiV1HostingCustomHostingArgs, options?: PatchApiApiV1HostingCustomHostingOptions) => { const {baseUrl = "https://api.simplelocalize.io", fetch: fetchFn = fetch, ProjectAPIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ProjectAPIKey !== undefined) headers.set("X-SimpleLocalize-Token", ProjectAPIKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/hosting/custom-hosting${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };