/* * 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 { CreatePaymentLinkLineItem, CreatePaymentLinkLineItem$inboundSchema, CreatePaymentLinkLineItem$Outbound, CreatePaymentLinkLineItem$outboundSchema, } from "./createpaymentlinklineitem.js"; /** * An optional collection of line items for a payment link. * * @remarks * When line items are provided, their total plus sales tax must equal the payment link amount. */ export type CreatePaymentLinkLineItemsUpdate = { /** * The list of line items. */ items?: Array | undefined; }; /** @internal */ export const CreatePaymentLinkLineItemsUpdate$inboundSchema: z.ZodType< CreatePaymentLinkLineItemsUpdate, z.ZodTypeDef, unknown > = z.object({ items: z.array(CreatePaymentLinkLineItem$inboundSchema).optional(), }); /** @internal */ export type CreatePaymentLinkLineItemsUpdate$Outbound = { items?: Array | undefined; }; /** @internal */ export const CreatePaymentLinkLineItemsUpdate$outboundSchema: z.ZodType< CreatePaymentLinkLineItemsUpdate$Outbound, z.ZodTypeDef, CreatePaymentLinkLineItemsUpdate > = z.object({ items: z.array(CreatePaymentLinkLineItem$outboundSchema).optional(), }); export function createPaymentLinkLineItemsUpdateToJSON( createPaymentLinkLineItemsUpdate: CreatePaymentLinkLineItemsUpdate, ): string { return JSON.stringify( CreatePaymentLinkLineItemsUpdate$outboundSchema.parse( createPaymentLinkLineItemsUpdate, ), ); } export function createPaymentLinkLineItemsUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreatePaymentLinkLineItemsUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreatePaymentLinkLineItemsUpdate' from JSON`, ); }