/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { CollectionMethod, CollectionMethod$inboundSchema, } from "./collection-method.js"; import { PaymentMethodType, PaymentMethodType$inboundSchema, } from "./payment-method-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type CheckoutJSONBCheckoutPaymentProviderConfig = { collectionMethod?: CollectionMethod | undefined; maxMandateLimit?: string | undefined; paymentMethod?: PaymentMethodType | undefined; }; /** @internal */ export const CheckoutJSONBCheckoutPaymentProviderConfig$inboundSchema: z.ZodMiniType = z.pipe( z.object({ collection_method: types.optional(CollectionMethod$inboundSchema), max_mandate_limit: types.optional(types.string()), payment_method: types.optional(PaymentMethodType$inboundSchema), }), z.transform((v) => { return remap$(v, { "collection_method": "collectionMethod", "max_mandate_limit": "maxMandateLimit", "payment_method": "paymentMethod", }); }), ); export function checkoutJSONBCheckoutPaymentProviderConfigFromJSON( jsonString: string, ): SafeParseResult< CheckoutJSONBCheckoutPaymentProviderConfig, SDKValidationError > { return safeParse( jsonString, (x) => CheckoutJSONBCheckoutPaymentProviderConfig$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CheckoutJSONBCheckoutPaymentProviderConfig' from JSON`, ); }