export type VagaroPublicControllerV2ModelEmailNotification = {id?: string | undefined, serviceProviderId: unknown, subject: unknown, message: unknown, cc?: string | undefined, bcc?: string | undefined}; export type CreateApiApiVVersionMerchantsMerchantIdNotificationsMailArgs = {MerchantId: string, version: string, body: VagaroPublicControllerV2ModelEmailNotification}; export type CreateApiApiVVersionMerchantsMerchantIdNotificationsMailOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /api/v{version}/merchants/{merchantId}/Notifications/mail */ export const createApiApiVVersionMerchantsMerchantIdNotificationsMail = async (args: CreateApiApiVVersionMerchantsMerchantIdNotificationsMailArgs, options: CreateApiApiVVersionMerchantsMerchantIdNotificationsMailOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/merchants/${encodeURIComponent(String(args.merchantId))}/Notifications/mail${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 };