export type DeleteApiV4ScalingConfigsNameArgs = {name: string}; export type DeleteApiV4ScalingConfigsNameOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete * * DELETE /v4/scaling-configs/{name} * * Also accepts auth: APIKeyCookie */ export const deleteApiV4ScalingConfigsName = async (args: DeleteApiV4ScalingConfigsNameArgs, options?: DeleteApiV4ScalingConfigsNameOptions) => { const {baseUrl = "https://www.mystic.ai", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v4/scaling-configs/${encodeURIComponent(String(args.name))}${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 };