/* * 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 { CallToAction, CallToAction$inboundSchema, CallToAction$outboundSchema, } from "./calltoaction.js"; /** * Customizable display options for a payment link. */ export type PaymentLinkDisplayOptions = { /** * The payment page title displayed to the user. */ title: string; /** * A payment description displayed to the user. */ description: string; /** * The text to be displayed on web form's submit button. * * @remarks * * If set to "auto" the UI will automatically select between * "pay" and "confirm" for payments and payouts respectively. */ callToAction: CallToAction; }; /** @internal */ export const PaymentLinkDisplayOptions$inboundSchema: z.ZodType< PaymentLinkDisplayOptions, z.ZodTypeDef, unknown > = z.object({ title: z.string(), description: z.string(), callToAction: CallToAction$inboundSchema, }); /** @internal */ export type PaymentLinkDisplayOptions$Outbound = { title: string; description: string; callToAction: string; }; /** @internal */ export const PaymentLinkDisplayOptions$outboundSchema: z.ZodType< PaymentLinkDisplayOptions$Outbound, z.ZodTypeDef, PaymentLinkDisplayOptions > = z.object({ title: z.string(), description: z.string(), callToAction: CallToAction$outboundSchema, }); export function paymentLinkDisplayOptionsToJSON( paymentLinkDisplayOptions: PaymentLinkDisplayOptions, ): string { return JSON.stringify( PaymentLinkDisplayOptions$outboundSchema.parse(paymentLinkDisplayOptions), ); } export function paymentLinkDisplayOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentLinkDisplayOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentLinkDisplayOptions' from JSON`, ); }