export type Account = {id: string, name?: string | undefined}; export type UpdateUserRequest = {account: Account, phone_number?: string | undefined, email?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, locale?: string | undefined}; export type UpdateApiApiV1UserUserIdArgs = {userId: string, body: UpdateUserRequest}; export type UpdateApiApiV1UserUserIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update user auth data like mobile or secret * * PUT /api/v1/user/{userId} */ export const updateApiApiV1UserUserId = async (args: UpdateApiApiV1UserUserIdArgs, options?: UpdateApiApiV1UserUserIdOptions) => { const {baseUrl = "https://one.digicert.com/documentmanager", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/user/${encodeURIComponent(String(args.userId))}${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 };