export type BetConstructSSOAuthAPIViewModelsUserAccountViewModelsUserProfileUpdateViewModel = {firstName: string, lastName: string, birthDate?: (string | null) | undefined, receiveNews?: boolean | undefined, inAppNotifications?: boolean | undefined, phoneNotifications?: boolean | undefined, emailNotifications?: boolean | undefined, countryId?: (number | null) | undefined}; export type UpdateApiV1UsersMeArgs = {body: BetConstructSSOAuthAPIViewModelsUserAccountViewModelsUserProfileUpdateViewModel}; export type UpdateApiV1UsersMeOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /V1/users/me */ export const updateApiV1UsersMe = async (args: UpdateApiV1UsersMeArgs, options: UpdateApiV1UsersMeOptions) => { 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/me${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };