export type CoreUpdateConfRequest = {cluster_name?: string | undefined, content?: string | undefined, content_changed?: boolean | undefined, description?: string | undefined, tag?: string | undefined}; export type UpdateApiV1OrgsOrgIdConfsConfIdArgs = {org_id: string, conf_id: string, body: CoreUpdateConfRequest}; export type UpdateApiV1OrgsOrgIdConfsConfIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates the config for given id * * PUT /v1/orgs/{org_id}/confs/{conf_id} */ export const updateApiV1OrgsOrgIdConfsConfId = async (args: UpdateApiV1OrgsOrgIdConfsConfIdArgs, options?: UpdateApiV1OrgsOrgIdConfsConfIdOptions) => { const {baseUrl = "https://api.edgedelta.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-ED-API-Token", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orgs/${encodeURIComponent(String(args.org_id))}/confs/${encodeURIComponent(String(args.conf_id))}${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 };