export type BetConstructSSOAuthAPIViewModelsUserAccountViewModelsUserRegistrationViewModel = {firstName: string, lastName: string, email: string, password: string, recaptchaCode?: (string | null) | undefined, originUrl?: (string | null) | undefined, countryId: number, inAppNotifications?: boolean | undefined, phoneNotifications?: boolean | undefined, emailNotifications?: boolean | undefined, receiveNews?: boolean | undefined, domain?: (string | null) | undefined}; export type CreateApiV1UsersArgs = {body: BetConstructSSOAuthAPIViewModelsUserAccountViewModelsUserRegistrationViewModel}; export type CreateApiV1UsersOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /V1/users */ export const createApiV1Users = async (args: CreateApiV1UsersArgs, options: CreateApiV1UsersOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/V1/users${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 };