/* * 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"; /** * Specify that the package contains Dry Ice (FedEx, Veho, and UPS only). */ export type DryIce = { /** * Mandatory. Specifies that the package contains Dry Ice. */ containsDryIce?: boolean | undefined; /** * Mandatory. Units must be in Kilograms. Cannot be greater than package weight. */ weight?: string | undefined; }; /** @internal */ export const DryIce$inboundSchema: z.ZodMiniType = z.pipe( z.object({ contains_dry_ice: z.optional(z.boolean()), weight: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { "contains_dry_ice": "containsDryIce", }); }), ); /** @internal */ export type DryIce$Outbound = { contains_dry_ice?: boolean | undefined; weight?: string | undefined; }; /** @internal */ export const DryIce$outboundSchema: z.ZodMiniType = z .pipe( z.object({ containsDryIce: z.optional(z.boolean()), weight: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { containsDryIce: "contains_dry_ice", }); }), ); export function dryIceToJSON(dryIce: DryIce): string { return JSON.stringify(DryIce$outboundSchema.parse(dryIce)); } export function dryIceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DryIce$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DryIce' from JSON`, ); }