/* * 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 { AddressCreateRequest, AddressCreateRequest$Outbound, AddressCreateRequest$outboundSchema, } from "./addresscreaterequest.js"; export type ManifestCreateRequestAddressFrom = AddressCreateRequest | string; export type ManifestCreateRequest = { /** * ID of carrier account */ carrierAccount: string; /** * All shipments to be submitted on this day will be closed out. * * @remarks * Must be in the format `2014-01-18T00:35:03.463Z` (ISO 8601 date). */ shipmentDate: string; /** * IDs transactions to use. If you set this to null or not send this parameter, * * @remarks * Shippo will automatically assign all applicable transactions. */ transactions?: Array | undefined; addressFrom: AddressCreateRequest | string; async?: boolean | undefined; }; /** @internal */ export type ManifestCreateRequestAddressFrom$Outbound = | AddressCreateRequest$Outbound | string; /** @internal */ export const ManifestCreateRequestAddressFrom$outboundSchema: z.ZodMiniType< ManifestCreateRequestAddressFrom$Outbound, ManifestCreateRequestAddressFrom > = z.union([AddressCreateRequest$outboundSchema, z.string()]); export function manifestCreateRequestAddressFromToJSON( manifestCreateRequestAddressFrom: ManifestCreateRequestAddressFrom, ): string { return JSON.stringify( ManifestCreateRequestAddressFrom$outboundSchema.parse( manifestCreateRequestAddressFrom, ), ); } /** @internal */ export type ManifestCreateRequest$Outbound = { carrier_account: string; shipment_date: string; transactions?: Array | undefined; address_from: AddressCreateRequest$Outbound | string; async?: boolean | undefined; }; /** @internal */ export const ManifestCreateRequest$outboundSchema: z.ZodMiniType< ManifestCreateRequest$Outbound, ManifestCreateRequest > = z.pipe( z.object({ carrierAccount: z.string(), shipmentDate: z.string(), transactions: z.optional(z.array(z.string())), addressFrom: z.union([AddressCreateRequest$outboundSchema, z.string()]), async: z.optional(z.boolean()), }), z.transform((v) => { return remap$(v, { carrierAccount: "carrier_account", shipmentDate: "shipment_date", addressFrom: "address_from", }); }), ); export function manifestCreateRequestToJSON( manifestCreateRequest: ManifestCreateRequest, ): string { return JSON.stringify( ManifestCreateRequest$outboundSchema.parse(manifestCreateRequest), ); }