export type DeleteApiApiPublicV1PoliciesPolicyArgs = {'X-VO-Api-Id': string, 'X-VO-Api-Key': string, policy: string}; export type DeleteApiApiPublicV1PoliciesPolicyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a specified escalation policy * * DELETE /api-public/v1/policies/{policy} */ export const deleteApiApiPublicV1PoliciesPolicy = async (args: DeleteApiApiPublicV1PoliciesPolicyArgs, options?: DeleteApiApiPublicV1PoliciesPolicyOptions) => { const {baseUrl = "https://api.victorops.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-VO-Api-Id'] != null) headers.set("X-VO-Api-Id", String(args['X-VO-Api-Id'])) if (args['X-VO-Api-Key'] != null) headers.set("X-VO-Api-Key", String(args['X-VO-Api-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api-public/v1/policies/${encodeURIComponent(String(args.policy))}${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 };