export type CreateApiV2StorageComponentsComponentIdConfigsConfigurationIdResetToDefaultArgs = {componentId: string, configurationId: string}; export type CreateApiV2StorageComponentsComponentIdConfigsConfigurationIdResetToDefaultOptions = {baseUrl?: string | undefined, StorageKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset Development Branch Configuration to Default * * POST /v2/storage/components/{componentId}/configs/{configurationId}/reset-to-default * * Also accepts auth: ManageKey, BearerAuth */ export const createApiV2StorageComponentsComponentIdConfigsConfigurationIdResetToDefault = async (args: CreateApiV2StorageComponentsComponentIdConfigsConfigurationIdResetToDefaultArgs, options?: CreateApiV2StorageComponentsComponentIdConfigsConfigurationIdResetToDefaultOptions) => { const {baseUrl = "https://connection.keboola.com", fetch: fetchFn = fetch, StorageKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() 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))}/reset-to-default${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };