export type DeleteApiApiTenantsTenantIdRegulationsRegulationIdScriptsScriptIdArgs = {tenantId: number, regulationId: number, scriptId: number}; export type DeleteApiApiTenantsTenantIdRegulationsRegulationIdScriptsScriptIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /api/tenants/{tenantId}/regulations/{regulationId}/scripts/{scriptId} */ export const deleteApiApiTenantsTenantIdRegulationsRegulationIdScriptsScriptId = async (args: DeleteApiApiTenantsTenantIdRegulationsRegulationIdScriptsScriptIdArgs, options: DeleteApiApiTenantsTenantIdRegulationsRegulationIdScriptsScriptIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/tenants/${encodeURIComponent(String(args.tenantId))}/regulations/${encodeURIComponent(String(args.regulationId))}/scripts/${encodeURIComponent(String(args.scriptId))}${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 };