/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Additional invoiced charges to be shown on the Customs Declaration Commercial Invoice. */ export type CustomsInvoicedCharges = { /** * Currency for the invoiced charges amounts incurred on the end consumer. */ currency: string; /** * Total shipping paid by the buyer. */ totalShipping?: string | undefined; /** * Total taxes paid by the buyer. */ totalTaxes?: string | undefined; /** * Total duties paid by the buyer. */ totalDuties?: string | undefined; /** * Other fees paid by the buyer. */ otherFees?: string | undefined; }; /** @internal */ export const CustomsInvoicedCharges$inboundSchema: z.ZodMiniType< CustomsInvoicedCharges, unknown > = z.pipe( z.object({ currency: z.string(), total_shipping: z.optional(z.string()), total_taxes: z.optional(z.string()), total_duties: z.optional(z.string()), other_fees: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { "total_shipping": "totalShipping", "total_taxes": "totalTaxes", "total_duties": "totalDuties", "other_fees": "otherFees", }); }), ); export function customsInvoicedChargesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomsInvoicedCharges$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomsInvoicedCharges' from JSON`, ); }