export type PasswordPoliciesUpdateRequest = {digits?: number | undefined, forceExpiredPasswordChange?: number | undefined, length?: number | undefined, lowercase?: number | undefined, maxLength?: number | undefined, passwordHistory?: number | undefined, specialChars?: number | undefined, uppercase?: number | undefined}; export type PasswordPolicyUpdateRequest = {passwordPolicies: PasswordPoliciesUpdateRequest}; export type UpdateApiAuthIdentityPasswordPolicyArgs = {body: PasswordPolicyUpdateRequest}; export type UpdateApiAuthIdentityPasswordPolicyOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /auth/identity/passwordPolicy */ export const updateApiAuthIdentityPasswordPolicy = async (args: UpdateApiAuthIdentityPasswordPolicyArgs, options: UpdateApiAuthIdentityPasswordPolicyOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/auth/identity/passwordPolicy${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 };