/* * 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 AuthStartRequestSubjectMobileAuthenticatorInstantLink = { /** * 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; /** * FinalTargetURL is the destination the end user will be directed to after clicking on the Instant Link. * * @remarks * This is where we redirect the session upon successful authentication. */ finalTargetUrl: string; /** * MessageText is the message that will be sent to the end user via SMS with the Instant Link represented by pound signs. */ messageText: string; /** * SourceIP is the IP address of the device the request initiates from. This adds an additional fraud detection * * @remarks * indicator, as Prove uses this value to complete an IP comparison with the IP of the device that clicks on * the Instant Link sent. If provided, an IP match is required for a successful bind. */ sourceIp?: string | undefined; /** * SubscriptionCustomerID is a unique identifier for the customer's subscribers for Prove Identity Manager. */ subscriptionCustomerId?: string | undefined; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorInstantLink$inboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorInstantLink, z.ZodTypeDef, unknown > = z.object({ allowMobileNumberRePrompt: z.boolean().optional(), finalTargetUrl: z.string(), messageText: z.string(), sourceIp: z.string().optional(), subscriptionCustomerId: z.string().optional(), testMode: z.string().optional(), }); /** @internal */ export type AuthStartRequestSubjectMobileAuthenticatorInstantLink$Outbound = { allowMobileNumberRePrompt?: boolean | undefined; finalTargetUrl: string; messageText: string; sourceIp?: string | undefined; subscriptionCustomerId?: string | undefined; testMode?: string | undefined; }; /** @internal */ export const AuthStartRequestSubjectMobileAuthenticatorInstantLink$outboundSchema: z.ZodType< AuthStartRequestSubjectMobileAuthenticatorInstantLink$Outbound, z.ZodTypeDef, AuthStartRequestSubjectMobileAuthenticatorInstantLink > = z.object({ allowMobileNumberRePrompt: z.boolean().optional(), finalTargetUrl: z.string(), messageText: z.string(), sourceIp: z.string().optional(), subscriptionCustomerId: z.string().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 AuthStartRequestSubjectMobileAuthenticatorInstantLink$ { /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorInstantLink$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestSubjectMobileAuthenticatorInstantLink$inboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorInstantLink$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestSubjectMobileAuthenticatorInstantLink$outboundSchema; /** @deprecated use `AuthStartRequestSubjectMobileAuthenticatorInstantLink$Outbound` instead. */ export type Outbound = AuthStartRequestSubjectMobileAuthenticatorInstantLink$Outbound; } export function authStartRequestSubjectMobileAuthenticatorInstantLinkToJSON( authStartRequestSubjectMobileAuthenticatorInstantLink: AuthStartRequestSubjectMobileAuthenticatorInstantLink, ): string { return JSON.stringify( AuthStartRequestSubjectMobileAuthenticatorInstantLink$outboundSchema.parse( authStartRequestSubjectMobileAuthenticatorInstantLink, ), ); } export function authStartRequestSubjectMobileAuthenticatorInstantLinkFromJSON( jsonString: string, ): SafeParseResult< AuthStartRequestSubjectMobileAuthenticatorInstantLink, SDKValidationError > { return safeParse( jsonString, (x) => AuthStartRequestSubjectMobileAuthenticatorInstantLink$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthStartRequestSubjectMobileAuthenticatorInstantLink' from JSON`, ); }