export type DeleteApiApiBusinessRulesNameVersionArgs = {name: string, version: number}; export type DeleteApiApiBusinessRulesNameVersionOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a version of business rule by name * * DELETE /api/business-rules/{name}/{version} */ export const deleteApiApiBusinessRulesNameVersion = async (args: DeleteApiApiBusinessRulesNameVersionArgs, options?: DeleteApiApiBusinessRulesNameVersionOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/business-rules/${encodeURIComponent(String(args.name))}/${encodeURIComponent(String(args.version))}${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 };