/* * 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 AuthStartRequestSubjectMobileAuthenticatorOTP = { /** * If AllowMobileNumberRePrompt is true, the end user will have up to 3 attempts * * @remarks * to re-enter their phone number during a Prove Auth flow. * If false, the end user won't be able to provide a new phone number. */ allowMobileNumberRePrompt?: boolean | undefined; /** * If AllowOtpRetry is set to true, the end user will have up to 3 OTP entry attempts in a Prove Auth flow. If * * @remarks * false, the end user will only get 1 OTP attempt. Once the maximum number of attempts is reached, the auth flow * will return an error. */ allowOtpRetry?: boolean | undefined; /** * MessageText is the message that will be sent to end user with the one-time passcode (OTP) represented by pound * * @remarks * signs. The number of pound signs should be equal to the OTP length */ messageText: string; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorOTP$inboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorOTP, z.ZodTypeDef, unknown > = z.object({ allowMobileNumberRePrompt: z.boolean().optional(), allowOtpRetry: z.boolean().optional(), messageText: z.string(), testMode: z.string().optional(), }); /** @internal */ export type AuthStartRequestSubjectMobileAuthenticatorOTP$Outbound = { allowMobileNumberRePrompt?: boolean | undefined; allowOtpRetry?: boolean | undefined; messageText: string; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorOTP$outboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorOTP$Outbound, z.ZodTypeDef, AuthStartRequestSubjectMobileAuthenticatorOTP > = z.object({ allowMobileNumberRePrompt: z.boolean().optional(), allowOtpRetry: z.boolean().optional(), messageText: z.string(), 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 AuthStartRequestSubjectMobileAuthenticatorOTP$ { /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorOTP$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestSubjectMobileAuthenticatorOTP$inboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorOTP$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestSubjectMobileAuthenticatorOTP$outboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorOTP$Outbound` instead. */ export type Outbound = AuthStartRequestSubjectMobileAuthenticatorOTP$Outbound; } export function authStartRequestSubjectMobileAuthenticatorOTPToJSON( authStartRequestSubjectMobileAuthenticatorOTP: AuthStartRequestSubjectMobileAuthenticatorOTP, ): string { return JSON.stringify( AuthStartRequestSubjectMobileAuthenticatorOTP$outboundSchema.parse( authStartRequestSubjectMobileAuthenticatorOTP, ), ); } export function authStartRequestSubjectMobileAuthenticatorOTPFromJSON( jsonString: string, ): SafeParseResult< AuthStartRequestSubjectMobileAuthenticatorOTP, SDKValidationError > { return safeParse( jsonString, (x) => AuthStartRequestSubjectMobileAuthenticatorOTP$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthStartRequestSubjectMobileAuthenticatorOTP' from JSON`, ); }