export type PatchUserMeBodyDto = {firstName?: string | undefined, lastName?: string | undefined, gender?: ('male' | 'female' | 'nb' | 'na' | null) | undefined, genderToCompareWith?: ('male' | 'female' | null) | undefined, birthday?: string | undefined, weight?: number | undefined, avatarMediaUrl?: string | undefined, profileVisibility?: ('public' | 'private') | undefined, timeZone?: string | undefined, preferredHeartRateMaximumEntrySource?: ('manual' | 'whoop' | 'estimated') | undefined, preferredFtpEntrySource?: ('manual' | 'estimated' | 'apple-health') | undefined, isStravaPostingAllowed?: boolean | undefined}; export type PatchApiV1UsersMeArgs = {body: PatchUserMeBodyDto}; export type PatchApiV1UsersMeOptions = {baseUrl: string, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /v1/users/me */ export const patchApiV1UsersMe = async (args: PatchApiV1UsersMeArgs, options: PatchApiV1UsersMeOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/users/me${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };