export type CreateApiWebhooksWebhookIdNotificationsNotificationIdResendArgs = {webhookId: string, notificationId: string, 'Idempotency-Key'?: string | undefined}; export type CreateApiWebhooksWebhookIdNotificationsNotificationIdResendOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resend notification by id * * POST /webhooks/{webhookId}/notifications/{notificationId}/resend */ export const createApiWebhooksWebhookIdNotificationsNotificationIdResend = async (args: CreateApiWebhooksWebhookIdNotificationsNotificationIdResendArgs, options?: CreateApiWebhooksWebhookIdNotificationsNotificationIdResendOptions) => { 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(/\/+$/, '')}/webhooks/${encodeURIComponent(String(args.webhookId))}/notifications/${encodeURIComponent(String(args.notificationId))}/resend${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 };