/* * 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"; /** * User provided settings to manage card payments. This data is only allowed on a business account. */ export type CardPaymentSettings = { /** * The description that shows up on credit card transactions. This will default to the accounts display name on account creation. */ statementDescriptor?: string | undefined; }; /** @internal */ export const CardPaymentSettings$inboundSchema: z.ZodType< CardPaymentSettings, z.ZodTypeDef, unknown > = z.object({ statementDescriptor: z.string().optional(), }); /** @internal */ export type CardPaymentSettings$Outbound = { statementDescriptor?: string | undefined; }; /** @internal */ export const CardPaymentSettings$outboundSchema: z.ZodType< CardPaymentSettings$Outbound, z.ZodTypeDef, CardPaymentSettings > = z.object({ statementDescriptor: z.string().optional(), }); export function cardPaymentSettingsToJSON( cardPaymentSettings: CardPaymentSettings, ): string { return JSON.stringify( CardPaymentSettings$outboundSchema.parse(cardPaymentSettings), ); } export function cardPaymentSettingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CardPaymentSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CardPaymentSettings' from JSON`, ); }