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