/* * 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"; import { ThreeDSecureScenarioConditions, ThreeDSecureScenarioConditions$inboundSchema, } from "./threedsecurescenarioconditions.js"; import { ThreeDSecureScenarioOutcome, ThreeDSecureScenarioOutcome$inboundSchema, } from "./threedsecurescenariooutcome.js"; export type ThreeDSecureScenario = { /** * Always `three-d-secure-scenario`. */ type: "three-d-secure-scenario"; /** * Unique identifier for the 3DS scenario */ id: string; /** * ID of the associated merchant account */ merchantAccountId: string; /** * The date and time when this 3DS scenario was first created in our system. */ createdAt: Date; /** * The date and time when this 3DS scenario was last updated in our system. */ updatedAt: Date; conditions: ThreeDSecureScenarioConditions; outcome: ThreeDSecureScenarioOutcome; }; /** @internal */ export const ThreeDSecureScenario$inboundSchema: z.ZodType< ThreeDSecureScenario, z.ZodTypeDef, unknown > = z.object({ type: z.literal("three-d-secure-scenario").default("three-d-secure-scenario"), id: z.string(), merchant_account_id: z.string(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), conditions: ThreeDSecureScenarioConditions$inboundSchema, outcome: ThreeDSecureScenarioOutcome$inboundSchema, }).transform((v) => { return remap$(v, { "merchant_account_id": "merchantAccountId", "created_at": "createdAt", "updated_at": "updatedAt", }); }); export function threeDSecureScenarioFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ThreeDSecureScenario$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ThreeDSecureScenario' from JSON`, ); }