export type DeleteApiAuctionsAuctionIdOrdersCancelArgs = {auctionId: string, param: Array}; export type DeleteApiAuctionsAuctionIdOrdersCancelOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Auctions - cancel orders by portfolios * * DELETE /auctions/{auctionId}/orders/cancel */ export const deleteApiAuctionsAuctionIdOrdersCancel = async (args: DeleteApiAuctionsAuctionIdOrdersCancelArgs, options?: DeleteApiAuctionsAuctionIdOrdersCancelOptions) => { const {baseUrl = "https://auctions-api.test.nordpoolgroup.com/api/v1", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") for (const item of args.param ?? []) query.append("param", String(item)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/auctions/${encodeURIComponent(String(args.auctionId))}/orders/cancel${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 (await res.json()) as unknown };