export type UpdateApiApiV1EsindexCreateParamsArgs = {params: string}; export type UpdateApiApiV1EsindexCreateParamsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /api/v1/esindex/create/{params} */ export const updateApiApiV1EsindexCreateParams = async (args: UpdateApiApiV1EsindexCreateParamsArgs, options: UpdateApiApiV1EsindexCreateParamsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/esindex/create/${encodeURIComponent(String(args.params))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };