/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ThreeDSecureScenarioConditions = { /** * First name of the buyer to match. */ firstName?: string | null | undefined; /** * Last name of the buyer to match. */ lastName?: string | null | undefined; /** * Email address of the buyer to match. */ emailAddress?: string | null | undefined; /** * Amount of the transaction to match. */ amount?: number | null | undefined; /** * External identifier to match. */ externalIdentifier?: string | null | undefined; /** * Card number to match. */ cardNumber?: string | null | undefined; }; /** @internal */ export const ThreeDSecureScenarioConditions$inboundSchema: z.ZodType< ThreeDSecureScenarioConditions, z.ZodTypeDef, unknown > = z.object({ first_name: z.nullable(z.string()).optional(), last_name: z.nullable(z.string()).optional(), email_address: z.nullable(z.string()).optional(), amount: z.nullable(z.number().int()).optional(), external_identifier: z.nullable(z.string()).optional(), card_number: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "email_address": "emailAddress", "external_identifier": "externalIdentifier", "card_number": "cardNumber", }); }); /** @internal */ export type ThreeDSecureScenarioConditions$Outbound = { first_name?: string | null | undefined; last_name?: string | null | undefined; email_address?: string | null | undefined; amount?: number | null | undefined; external_identifier?: string | null | undefined; card_number?: string | null | undefined; }; /** @internal */ export const ThreeDSecureScenarioConditions$outboundSchema: z.ZodType< ThreeDSecureScenarioConditions$Outbound, z.ZodTypeDef, ThreeDSecureScenarioConditions > = z.object({ firstName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), emailAddress: z.nullable(z.string()).optional(), amount: z.nullable(z.number().int()).optional(), externalIdentifier: z.nullable(z.string()).optional(), cardNumber: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { firstName: "first_name", lastName: "last_name", emailAddress: "email_address", externalIdentifier: "external_identifier", cardNumber: "card_number", }); }); export function threeDSecureScenarioConditionsToJSON( threeDSecureScenarioConditions: ThreeDSecureScenarioConditions, ): string { return JSON.stringify( ThreeDSecureScenarioConditions$outboundSchema.parse( threeDSecureScenarioConditions, ), ); } export function threeDSecureScenarioConditionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ThreeDSecureScenarioConditions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThreeDSecureScenarioConditions' from JSON`, ); }