/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AuthStartRequestSubjectMobileAuthenticatorPassive = { /** * If true, bind will persist between authenticators. If false, bind will be reattempted on every auth flow. */ cacheResult?: boolean | undefined; /** * If true, will allow authentication against a local domain for testing FIDO. */ localDomain?: boolean | undefined; /** * If not set or set to 0, the age of the bind will be ignored during authentication. If set to -1, then it will * * @remarks * force a rebind of the mobile number to the device. If set greater than 0, it specifies the maximum age * (in seconds) of the bind that is allowed or else a rebind occurs during authentication. Ex: 7776000 is 90 days. */ maxAge?: number | undefined; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorPassive$inboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorPassive, z.ZodTypeDef, unknown > = z.object({ cacheResult: z.boolean().optional(), localDomain: z.boolean().optional(), maxAge: z.number().int().optional(), testMode: z.string().optional(), }); /** @internal */ export type AuthStartRequestSubjectMobileAuthenticatorPassive$Outbound = { cacheResult?: boolean | undefined; localDomain?: boolean | undefined; maxAge?: number | undefined; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorPassive$outboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorPassive$Outbound, z.ZodTypeDef, AuthStartRequestSubjectMobileAuthenticatorPassive > = z.object({ cacheResult: z.boolean().optional(), localDomain: z.boolean().optional(), maxAge: z.number().int().optional(), testMode: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthStartRequestSubjectMobileAuthenticatorPassive$ { /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorPassive$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestSubjectMobileAuthenticatorPassive$inboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorPassive$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestSubjectMobileAuthenticatorPassive$outboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorPassive$Outbound` instead. */ export type Outbound = AuthStartRequestSubjectMobileAuthenticatorPassive$Outbound; } export function authStartRequestSubjectMobileAuthenticatorPassiveToJSON( authStartRequestSubjectMobileAuthenticatorPassive: AuthStartRequestSubjectMobileAuthenticatorPassive, ): string { return JSON.stringify( AuthStartRequestSubjectMobileAuthenticatorPassive$outboundSchema.parse( authStartRequestSubjectMobileAuthenticatorPassive, ), ); } export function authStartRequestSubjectMobileAuthenticatorPassiveFromJSON( jsonString: string, ): SafeParseResult< AuthStartRequestSubjectMobileAuthenticatorPassive, SDKValidationError > { return safeParse( jsonString, (x) => AuthStartRequestSubjectMobileAuthenticatorPassive$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthStartRequestSubjectMobileAuthenticatorPassive' from JSON`, ); }