export type CreateApiV1PoliciesIdRegenerateArgs = {'X-Organization-Id'?: string | undefined, id: string}; export type CreateApiV1PoliciesIdRegenerateOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Regenerate policy with AI * * POST /v1/policies/{id}/regenerate */ export const createApiV1PoliciesIdRegenerate = async (args: CreateApiV1PoliciesIdRegenerateArgs, options?: CreateApiV1PoliciesIdRegenerateOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Organization-Id'] != null) headers.set("X-Organization-Id", String(args['X-Organization-Id'])) if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/policies/${encodeURIComponent(String(args.id))}/regenerate${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 };