/* * 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 { CardAcceptanceMethods, CardAcceptanceMethods$inboundSchema, CardAcceptanceMethods$Outbound, CardAcceptanceMethods$outboundSchema, } from "./cardacceptancemethods.js"; import { EstimatedActivity, EstimatedActivity$inboundSchema, EstimatedActivity$Outbound, EstimatedActivity$outboundSchema, } from "./estimatedactivity.js"; import { Fulfillment, Fulfillment$inboundSchema, Fulfillment$Outbound, Fulfillment$outboundSchema, } from "./fulfillment.js"; import { RefundPolicy, RefundPolicy$inboundSchema, RefundPolicy$outboundSchema, } from "./refundpolicy.js"; export type CollectFundsCardPayments = { /** * Describes the distribution of card transactions by payment method. */ cardAcceptanceMethods?: CardAcceptanceMethods | undefined; currentlyAcceptsCards?: boolean | undefined; estimatedActivity?: EstimatedActivity | undefined; fulfillment?: Fulfillment | undefined; refundPolicy?: RefundPolicy | undefined; }; /** @internal */ export const CollectFundsCardPayments$inboundSchema: z.ZodType< CollectFundsCardPayments, z.ZodTypeDef, unknown > = z.object({ cardAcceptanceMethods: CardAcceptanceMethods$inboundSchema.optional(), currentlyAcceptsCards: z.boolean().optional(), estimatedActivity: EstimatedActivity$inboundSchema.optional(), fulfillment: Fulfillment$inboundSchema.optional(), refundPolicy: RefundPolicy$inboundSchema.optional(), }); /** @internal */ export type CollectFundsCardPayments$Outbound = { cardAcceptanceMethods?: CardAcceptanceMethods$Outbound | undefined; currentlyAcceptsCards?: boolean | undefined; estimatedActivity?: EstimatedActivity$Outbound | undefined; fulfillment?: Fulfillment$Outbound | undefined; refundPolicy?: string | undefined; }; /** @internal */ export const CollectFundsCardPayments$outboundSchema: z.ZodType< CollectFundsCardPayments$Outbound, z.ZodTypeDef, CollectFundsCardPayments > = z.object({ cardAcceptanceMethods: CardAcceptanceMethods$outboundSchema.optional(), currentlyAcceptsCards: z.boolean().optional(), estimatedActivity: EstimatedActivity$outboundSchema.optional(), fulfillment: Fulfillment$outboundSchema.optional(), refundPolicy: RefundPolicy$outboundSchema.optional(), }); export function collectFundsCardPaymentsToJSON( collectFundsCardPayments: CollectFundsCardPayments, ): string { return JSON.stringify( CollectFundsCardPayments$outboundSchema.parse(collectFundsCardPayments), ); } export function collectFundsCardPaymentsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectFundsCardPayments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectFundsCardPayments' from JSON`, ); }