/* * 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 { DistanceUnitEnum, DistanceUnitEnum$outboundSchema, } from "./distanceunitenum.js"; import { WeightUnitEnum, WeightUnitEnum$outboundSchema, } from "./weightunitenum.js"; export type UserParcelTemplateUpdateRequest = { /** * The measure unit used for length, width and height. */ distanceUnit: DistanceUnitEnum; /** * The height of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. */ height: string; /** * The length of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. */ length: string; /** * The name of the User Parcel Template */ name: string; /** * The weight of the package, in units specified by the weight_unit attribute. */ weight?: string | undefined; /** * The unit used for weight. */ weightUnit?: WeightUnitEnum | undefined; /** * The width of the package, in units specified by the `distance_unit` attribute. Required, but if using a preset carrier template then this field must be empty. */ width: string; }; /** @internal */ export type UserParcelTemplateUpdateRequest$Outbound = { distance_unit: string; height: string; length: string; name: string; weight?: string | undefined; weight_unit?: string | undefined; width: string; }; /** @internal */ export const UserParcelTemplateUpdateRequest$outboundSchema: z.ZodMiniType< UserParcelTemplateUpdateRequest$Outbound, UserParcelTemplateUpdateRequest > = z.pipe( z.object({ distanceUnit: DistanceUnitEnum$outboundSchema, height: z.string(), length: z.string(), name: z.string(), weight: z.optional(z.string()), weightUnit: z.optional(WeightUnitEnum$outboundSchema), width: z.string(), }), z.transform((v) => { return remap$(v, { distanceUnit: "distance_unit", weightUnit: "weight_unit", }); }), ); export function userParcelTemplateUpdateRequestToJSON( userParcelTemplateUpdateRequest: UserParcelTemplateUpdateRequest, ): string { return JSON.stringify( UserParcelTemplateUpdateRequest$outboundSchema.parse( userParcelTemplateUpdateRequest, ), ); }