export type ResendSystemEmailRequest = {first_name?: string | undefined, forward_email?: string | undefined, last_name?: string | undefined, service_id?: string | undefined}; export type CreateApiBookingsBookingIdSystemEmailsResendArgs = {booking_id: number, body: ResendSystemEmailRequest}; export type CreateApiBookingsBookingIdSystemEmailsResendOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resend or forward an email from the System Emails tab on the reservation page * * POST /bookings/{booking_id}/system-emails/resend * * Also accepts auth: API-Key */ export const createApiBookingsBookingIdSystemEmailsResend = async (args: CreateApiBookingsBookingIdSystemEmailsResendArgs, options: CreateApiBookingsBookingIdSystemEmailsResendOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/bookings/${encodeURIComponent(String(args.booking_id))}/system-emails/resend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };