/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Transaction, Transaction$inboundSchema, Transaction$Outbound, Transaction$outboundSchema, } from "./transaction.js"; export type OrderResponse = { id: string; transaction: Transaction; }; /** @internal */ export const OrderResponse$inboundSchema: z.ZodType< OrderResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string(), transaction: Transaction$inboundSchema, }); /** @internal */ export type OrderResponse$Outbound = { id: string; transaction: Transaction$Outbound; }; /** @internal */ export const OrderResponse$outboundSchema: z.ZodType< OrderResponse$Outbound, z.ZodTypeDef, OrderResponse > = z.object({ id: z.string(), transaction: Transaction$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace OrderResponse$ { /** @deprecated use `OrderResponse$inboundSchema` instead. */ export const inboundSchema = OrderResponse$inboundSchema; /** @deprecated use `OrderResponse$outboundSchema` instead. */ export const outboundSchema = OrderResponse$outboundSchema; /** @deprecated use `OrderResponse$Outbound` instead. */ export type Outbound = OrderResponse$Outbound; } export function orderResponseToJSON(orderResponse: OrderResponse): string { return JSON.stringify(OrderResponse$outboundSchema.parse(orderResponse)); } export function orderResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrderResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrderResponse' from JSON`, ); }