export type CreateApiUsersIdRequestPasswordChangeArgs = {Authorization: string, id: number}; export type CreateApiUsersIdRequestPasswordChangeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Requests a password reset/change for the user. * * This sends the user an email with instructions on how to change their password. * * POST /Users/{id}/RequestPasswordChange */ export const createApiUsersIdRequestPasswordChange = async (args: CreateApiUsersIdRequestPasswordChangeArgs, options?: CreateApiUsersIdRequestPasswordChangeOptions) => { const {baseUrl = "https://api.mindbodyonline.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/Users/${encodeURIComponent(String(args.id))}/RequestPasswordChange${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };