export type VagaroPublicControllerV2ModelMobileNotificationActions = {launchUrl?: string | undefined, buttonLabel?: unknown | undefined, buttonIconPath?: unknown | undefined, buttonIconUrl?: string | undefined}; export type VagaroPublicControllerV2ModelNotification = {serviceProviderId: unknown, subject: string, message: string, imageUrl?: string | undefined, action1?: VagaroPublicControllerV2ModelMobileNotificationActions | undefined, action2?: VagaroPublicControllerV2ModelMobileNotificationActions | undefined}; export type CreateApiApiVVersionMerchantsMerchantIdNotificationsMobileArgs = {MerchantId: string, version: string, body: VagaroPublicControllerV2ModelNotification}; export type CreateApiApiVVersionMerchantsMerchantIdNotificationsMobileOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /api/v{version}/merchants/{merchantId}/Notifications/mobile */ export const createApiApiVVersionMerchantsMerchantIdNotificationsMobile = async (args: CreateApiApiVVersionMerchantsMerchantIdNotificationsMobileArgs, options: CreateApiApiVVersionMerchantsMerchantIdNotificationsMobileOptions) => { 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/mobile${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 };