/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CardAcceptanceMethodsError, CardAcceptanceMethodsError$inboundSchema, CardAcceptanceMethodsError$Outbound, CardAcceptanceMethodsError$outboundSchema, } from "./cardacceptancemethodserror.js"; import { EstimatedActivityError, EstimatedActivityError$inboundSchema, EstimatedActivityError$Outbound, EstimatedActivityError$outboundSchema, } from "./estimatedactivityerror.js"; import { FulfillmentError, FulfillmentError$inboundSchema, FulfillmentError$Outbound, FulfillmentError$outboundSchema, } from "./fulfillmenterror.js"; export type CollectFundsCardPaymentsError = { cardAcceptanceMethods?: CardAcceptanceMethodsError | undefined; currentlyAcceptsCards?: string | undefined; estimatedActivity?: EstimatedActivityError | undefined; fulfillment?: FulfillmentError | undefined; refundPolicy?: string | undefined; }; /** @internal */ export const CollectFundsCardPaymentsError$inboundSchema: z.ZodType< CollectFundsCardPaymentsError, z.ZodTypeDef, unknown > = z.object({ cardAcceptanceMethods: CardAcceptanceMethodsError$inboundSchema.optional(), currentlyAcceptsCards: z.string().optional(), estimatedActivity: EstimatedActivityError$inboundSchema.optional(), fulfillment: FulfillmentError$inboundSchema.optional(), refundPolicy: z.string().optional(), }); /** @internal */ export type CollectFundsCardPaymentsError$Outbound = { cardAcceptanceMethods?: CardAcceptanceMethodsError$Outbound | undefined; currentlyAcceptsCards?: string | undefined; estimatedActivity?: EstimatedActivityError$Outbound | undefined; fulfillment?: FulfillmentError$Outbound | undefined; refundPolicy?: string | undefined; }; /** @internal */ export const CollectFundsCardPaymentsError$outboundSchema: z.ZodType< CollectFundsCardPaymentsError$Outbound, z.ZodTypeDef, CollectFundsCardPaymentsError > = z.object({ cardAcceptanceMethods: CardAcceptanceMethodsError$outboundSchema.optional(), currentlyAcceptsCards: z.string().optional(), estimatedActivity: EstimatedActivityError$outboundSchema.optional(), fulfillment: FulfillmentError$outboundSchema.optional(), refundPolicy: z.string().optional(), }); export function collectFundsCardPaymentsErrorToJSON( collectFundsCardPaymentsError: CollectFundsCardPaymentsError, ): string { return JSON.stringify( CollectFundsCardPaymentsError$outboundSchema.parse( collectFundsCardPaymentsError, ), ); } export function collectFundsCardPaymentsErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectFundsCardPaymentsError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectFundsCardPaymentsError' from JSON`, ); }