export type DeleteApiV2StorageComponentsComponentIdConfigsConfigurationIdArgs = {componentId: string, configurationId: string, 'If-Match'?: string | undefined}; export type DeleteApiV2StorageComponentsComponentIdConfigsConfigurationIdOptions = {baseUrl?: string | undefined, StorageKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Configuration * * DELETE /v2/storage/components/{componentId}/configs/{configurationId} * * Also accepts auth: ManageKey, BearerAuth */ export const deleteApiV2StorageComponentsComponentIdConfigsConfigurationId = async (args: DeleteApiV2StorageComponentsComponentIdConfigsConfigurationIdArgs, options?: DeleteApiV2StorageComponentsComponentIdConfigsConfigurationIdOptions) => { const {baseUrl = "https://connection.keboola.com", fetch: fetchFn = fetch, StorageKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) if (StorageKey !== undefined) headers.set("X-StorageApi-Token", StorageKey) const url = `${baseUrl.replace(/\/+$/, '')}/v2/storage/components/${encodeURIComponent(String(args.componentId))}/configs/${encodeURIComponent(String(args.configurationId))}${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 };