export type CreateApiApprovalsRequestIdRejectArgs = {'Idempotency-Key'?: string | undefined, requestId: string}; export type CreateApiApprovalsRequestIdRejectOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reject an approval request * * POST /approvals/{requestId}/reject */ export const createApiApprovalsRequestIdReject = async (args: CreateApiApprovalsRequestIdRejectArgs, options?: CreateApiApprovalsRequestIdRejectOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Idempotency-Key'] != null) headers.set("Idempotency-Key", String(args['Idempotency-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/approvals/${encodeURIComponent(String(args.requestId))}/reject${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };