/*
* 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 {
Location,
Location$Outbound,
Location$outboundSchema,
} from "./location.js";
export type PickupBase = {
/**
* The object ID of your USPS or DHL Express carrier account.
*
* @remarks
* You can retrieve this from your Rate requests or our Carrier Accounts endpoint.
*/
carrierAccount: string;
/**
* Location where the parcel(s) will be picked up.
*/
location: Location;
/**
* A string of up to 100 characters that can be filled with any additional information you
*
* @remarks
* want to attach to the object.
*/
metadata?: string | undefined;
/**
* The latest that you requested your parcels to be available for pickup.
*
* @remarks
* Expressed in the timezone specified in the response.
*/
requestedEndTime: Date;
/**
* The earliest that you requested your parcels to be ready for pickup.
*
* @remarks
* Expressed in the timezone specified in the response.
*/
requestedStartTime: Date;
/**
* The transaction(s) object ID(s) for the parcel(s) that need to be picked up.
*/
transactions: Array;
};
/** @internal */
export type PickupBase$Outbound = {
carrier_account: string;
location: Location$Outbound;
metadata?: string | undefined;
requested_end_time: string;
requested_start_time: string;
transactions: Array;
};
/** @internal */
export const PickupBase$outboundSchema: z.ZodMiniType<
PickupBase$Outbound,
PickupBase
> = z.pipe(
z.object({
carrierAccount: z.string(),
location: Location$outboundSchema,
metadata: z.optional(z.string()),
requestedEndTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
requestedStartTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
transactions: z.array(z.string()),
}),
z.transform((v) => {
return remap$(v, {
carrierAccount: "carrier_account",
requestedEndTime: "requested_end_time",
requestedStartTime: "requested_start_time",
});
}),
);
export function pickupBaseToJSON(pickupBase: PickupBase): string {
return JSON.stringify(PickupBase$outboundSchema.parse(pickupBase));
}