/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreatePazeDigitalWalletSessionGlobals = { merchantAccountId?: string | undefined; }; export type CreatePazeDigitalWalletSessionRequest = { /** * The ID of the merchant account to use for this request. */ merchantAccountId?: string | null | undefined; pazeSessionRequest: components.PazeSessionRequest; }; /** * Successful Response */ export type CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession = | components.PazeMobileSession | components.PazeWebSession; /** @internal */ export type CreatePazeDigitalWalletSessionRequest$Outbound = { merchantAccountId?: string | null | undefined; PazeSessionRequest: components.PazeSessionRequest$Outbound; }; /** @internal */ export const CreatePazeDigitalWalletSessionRequest$outboundSchema: z.ZodType< CreatePazeDigitalWalletSessionRequest$Outbound, z.ZodTypeDef, CreatePazeDigitalWalletSessionRequest > = z.object({ merchantAccountId: z.nullable(z.string()).optional(), pazeSessionRequest: components.PazeSessionRequest$outboundSchema, }).transform((v) => { return remap$(v, { pazeSessionRequest: "PazeSessionRequest", }); }); export function createPazeDigitalWalletSessionRequestToJSON( createPazeDigitalWalletSessionRequest: CreatePazeDigitalWalletSessionRequest, ): string { return JSON.stringify( CreatePazeDigitalWalletSessionRequest$outboundSchema.parse( createPazeDigitalWalletSessionRequest, ), ); } /** @internal */ export const CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession$inboundSchema: z.ZodType< CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession, z.ZodTypeDef, unknown > = z.union([ components.PazeMobileSession$inboundSchema, components.PazeWebSession$inboundSchema, ]); export function createPazeDigitalWalletSessionResponseCreatePazeDigitalWalletSessionFromJSON( jsonString: string, ): SafeParseResult< CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession, SDKValidationError > { return safeParse( jsonString, (x) => CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession' from JSON`, ); }