export type DeleteApiBackupAndDrPoliciesPolicyIdArgs = {policy_id: string, cascade?: boolean | undefined}; export type DeleteApiBackupAndDrPoliciesPolicyIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete policy * * DELETE /backup-and-dr/policies/{policy_id} */ export const deleteApiBackupAndDrPoliciesPolicyId = async (args: DeleteApiBackupAndDrPoliciesPolicyIdArgs, options?: DeleteApiBackupAndDrPoliciesPolicyIdOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.cascade != null) query.append("cascade", String(args.cascade)) const url = `${baseUrl.replace(/\/+$/, '')}/backup-and-dr/policies/${encodeURIComponent(String(args.policy_id))}${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 };