/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; import { EcommerceOrderStatus, EcommerceOrderStatus$inboundSchema, } from "./ecommerceorderstatus.js"; /** * The order this entity is linked to. */ export type LinkedEcommerceOrder = { /** * A unique identifier for an object. */ id?: string | undefined; /** * The total amount of the order. */ total?: string | null | undefined; /** * Current status of the order. */ status?: EcommerceOrderStatus | null | undefined; }; /** @internal */ export const LinkedEcommerceOrder$inboundSchema: z.ZodType< LinkedEcommerceOrder, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), total: z.nullable(types.string()).optional(), status: z.nullable(EcommerceOrderStatus$inboundSchema).optional(), }) ); export function linkedEcommerceOrderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedEcommerceOrder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedEcommerceOrder' from JSON`, ); }