export type RESTPwdProfileConfig = {name: string, active?: boolean | undefined, comment?: string | undefined, min_len?: number | undefined, min_uppercase_count?: number | undefined, min_lowercase_count?: number | undefined, min_digit_count?: number | undefined, min_special_count?: number | undefined, enable_password_expiration?: boolean | undefined, password_expire_after_days?: number | undefined, enable_password_history?: boolean | undefined, password_keep_history_count?: number | undefined, enable_block_after_failed_login?: boolean | undefined, block_after_failed_login_count?: number | undefined, block_minutes?: number | undefined}; export type RESTPwdProfileConfigData = {config: RESTPwdProfileConfig}; export type PatchApiPasswordProfileNameArgs = {'X-Auth-Token': string, name: string, body: RESTPwdProfileConfigData}; export type PatchApiPasswordProfileNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Configure password profile * * PATCH /password_profile/{name} */ export const patchApiPasswordProfileName = async (args: PatchApiPasswordProfileNameArgs, options: PatchApiPasswordProfileNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Auth-Token'] != null) headers.set("X-Auth-Token", String(args['X-Auth-Token'])) const url = `${baseUrl.replace(/\/+$/, '')}/password_profile/${encodeURIComponent(String(args.name))}${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 };