/*
* 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 {
BatchShipmentCreateRequest,
BatchShipmentCreateRequest$Outbound,
BatchShipmentCreateRequest$outboundSchema,
} from "./batchshipmentcreaterequest.js";
import {
LabelFileTypeEnum,
LabelFileTypeEnum$outboundSchema,
} from "./labelfiletypeenum.js";
export type BatchCreateRequest = {
/**
* ID of the Carrier Account object to use as the default for all shipments in this Batch.
*
* @remarks
* The carrier account can be changed on a per-shipment basis by changing the carrier_account in the
* corresponding BatchShipment object.
*/
defaultCarrierAccount: string;
/**
* Token of the service level to use as the default for all shipments in this Batch.
*
* @remarks
* The servicelevel can be changed on a per-shipment basis by changing the servicelevel_token in the
* corresponding BatchShipment object. Servicelevel tokens can be found here.
*/
defaultServicelevelToken: string;
/**
* Print format of the label. If empty, will use the default format set from
*
* @remarks
* the Shippo dashboard.
*/
labelFiletype?: LabelFileTypeEnum | undefined;
/**
* A string of up to 100 characters that can be filled with any additional information you want to attach to the object.
*/
metadata?: string | undefined;
/**
* Array of BatchShipment objects. The response keeps the same order as in the request array.
*/
batchShipments: Array;
};
/** @internal */
export type BatchCreateRequest$Outbound = {
default_carrier_account: string;
default_servicelevel_token: string;
label_filetype?: string | undefined;
metadata?: string | undefined;
batch_shipments: Array;
};
/** @internal */
export const BatchCreateRequest$outboundSchema: z.ZodMiniType<
BatchCreateRequest$Outbound,
BatchCreateRequest
> = z.pipe(
z.object({
defaultCarrierAccount: z.string(),
defaultServicelevelToken: z.string(),
labelFiletype: z.optional(LabelFileTypeEnum$outboundSchema),
metadata: z.optional(z.string()),
batchShipments: z.array(BatchShipmentCreateRequest$outboundSchema),
}),
z.transform((v) => {
return remap$(v, {
defaultCarrierAccount: "default_carrier_account",
defaultServicelevelToken: "default_servicelevel_token",
labelFiletype: "label_filetype",
batchShipments: "batch_shipments",
});
}),
);
export function batchCreateRequestToJSON(
batchCreateRequest: BatchCreateRequest,
): string {
return JSON.stringify(
BatchCreateRequest$outboundSchema.parse(batchCreateRequest),
);
}