export type DeleteApiPolicyTenantLocatorTransactionsLocatorSchedulesStaticElementLocatorArgs = {tenantLocator: string, locator: unknown, staticElementLocator: unknown, body: Array}; export type DeleteApiPolicyTenantLocatorTransactionsLocatorSchedulesStaticElementLocatorOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /policy/{tenantLocator}/transactions/{locator}/schedules/{staticElementLocator} */ export const deleteApiPolicyTenantLocatorTransactionsLocatorSchedulesStaticElementLocator = async (args: DeleteApiPolicyTenantLocatorTransactionsLocatorSchedulesStaticElementLocatorArgs, options: DeleteApiPolicyTenantLocatorTransactionsLocatorSchedulesStaticElementLocatorOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/policy/${encodeURIComponent(String(args.tenantLocator))}/transactions/${encodeURIComponent(String(args.locator))}/schedules/${encodeURIComponent(String(args.staticElementLocator))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };