/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Represents the tracking information associated with an ecommerce order. */ export type TrackingItem = { /** * The name or code of the carrier or shipping company that is handling the shipment. */ provider: string | null; /** * The tracking number associated with the shipment, which can be used to track the progress of the delivery. */ number: string | null; /** * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. */ url?: string | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; }; /** @internal */ export const TrackingItem$inboundSchema: z.ZodType< TrackingItem, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ provider: types.nullable(types.string()), number: types.nullable(types.string()), url: z.nullable(types.string()).optional(), updated_at: z.nullable(types.date()).optional(), }).transform((v) => { return remap$(v, { "updated_at": "updatedAt", }); }) ); export function trackingItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TrackingItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TrackingItem' from JSON`, ); }