export type SystemTimeSpan = {ticks?: number | undefined, days?: number | undefined, hours?: number | undefined, milliseconds?: number | undefined, minutes?: number | undefined, seconds?: number | undefined, totalDays?: number | undefined, totalHours?: number | undefined, totalMilliseconds?: number | undefined, totalMinutes?: number | undefined, totalSeconds?: number | undefined}; export type BetConstructSSOAuthAPIViewModelsCreateViewModelsAuthPolicyCreationViewModel = {passwordMaximumAge?: SystemTimeSpan | undefined, requiredLength: number, requiredUniqueChars: number, requireNonAlphanumeric: boolean, requireLowercase: boolean, requireUppercase: boolean, requireDigit: boolean, maxFailedAccessAttempts: number, defaultLockoutTimeSpan: SystemTimeSpan, name: string, reusePasswordAfterChangeCount?: number | undefined}; export type CreateApiV1ManagementsAuthPoliciesArgs = {body: BetConstructSSOAuthAPIViewModelsCreateViewModelsAuthPolicyCreationViewModel}; export type CreateApiV1ManagementsAuthPoliciesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /V1/managements/authPolicies */ export const createApiV1ManagementsAuthPolicies = async (args: CreateApiV1ManagementsAuthPoliciesArgs, options: CreateApiV1ManagementsAuthPoliciesOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/V1/managements/authPolicies${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };