/* * 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"; export type PaymentLinkCustomerOptions = { /** * If true, a billing address is required when completing the payment form. */ requireAddress?: boolean | undefined; /** * If true, a phone number is required when completing the payment form. */ requirePhone?: boolean | undefined; /** * Optional free-form metadata for the Moov account that will represent this customer. */ metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const PaymentLinkCustomerOptions$inboundSchema: z.ZodType< PaymentLinkCustomerOptions, z.ZodTypeDef, unknown > = z.object({ requireAddress: z.boolean().optional(), requirePhone: z.boolean().optional(), metadata: z.record(z.string()).optional(), }); /** @internal */ export type PaymentLinkCustomerOptions$Outbound = { requireAddress?: boolean | undefined; requirePhone?: boolean | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const PaymentLinkCustomerOptions$outboundSchema: z.ZodType< PaymentLinkCustomerOptions$Outbound, z.ZodTypeDef, PaymentLinkCustomerOptions > = z.object({ requireAddress: z.boolean().optional(), requirePhone: z.boolean().optional(), metadata: z.record(z.string()).optional(), }); export function paymentLinkCustomerOptionsToJSON( paymentLinkCustomerOptions: PaymentLinkCustomerOptions, ): string { return JSON.stringify( PaymentLinkCustomerOptions$outboundSchema.parse(paymentLinkCustomerOptions), ); } export function paymentLinkCustomerOptionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentLinkCustomerOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentLinkCustomerOptions' from JSON`, ); }