export type GetApiV2WebhooksWebhookIdEventsEventTestArgs = {webhookId: number, event: 'LODGEMENT_RECEIVED' | 'PAYMENT_RECEIVED' | 'PAYMENT_REQUEST_PAYMENT_RECEIVED' | 'ACCOUNT_CREATED' | 'CARD_CREATED' | 'CARD_AUTHORISATION' | 'CARD_SETTLEMENT' | 'PAYMENT_REQUEST_PAYMENT_AUTHORISED' | 'PIS_LODGEMENT_RECEIVED'}; export type GetApiV2WebhooksWebhookIdEventsEventTestOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send test webhooks * * GET /v2/webhooks/{webhookId}/events/{event}/test */ export const getApiV2WebhooksWebhookIdEventsEventTest = async (args: GetApiV2WebhooksWebhookIdEventsEventTestArgs, options?: GetApiV2WebhooksWebhookIdEventsEventTestOptions) => { const {baseUrl = "https://api.fire.com/business", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/webhooks/${encodeURIComponent(String(args.webhookId))}/events/${encodeURIComponent(String(args.event))}/test${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };