/* * 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"; export type AvailableSupplyModels = { model: string; symbol: string; commodity: string; countries: Array; }; /** @internal */ export const AvailableSupplyModels$inboundSchema: z.ZodType< AvailableSupplyModels, z.ZodTypeDef, unknown > = z.object({ model: z.string(), symbol: z.string(), commodity: z.string(), countries: z.array(z.string()), }); /** @internal */ export type AvailableSupplyModels$Outbound = { model: string; symbol: string; commodity: string; countries: Array; }; /** @internal */ export const AvailableSupplyModels$outboundSchema: z.ZodType< AvailableSupplyModels$Outbound, z.ZodTypeDef, AvailableSupplyModels > = z.object({ model: z.string(), symbol: z.string(), commodity: z.string(), countries: z.array(z.string()), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AvailableSupplyModels$ { /** @deprecated use `AvailableSupplyModels$inboundSchema` instead. */ export const inboundSchema = AvailableSupplyModels$inboundSchema; /** @deprecated use `AvailableSupplyModels$outboundSchema` instead. */ export const outboundSchema = AvailableSupplyModels$outboundSchema; /** @deprecated use `AvailableSupplyModels$Outbound` instead. */ export type Outbound = AvailableSupplyModels$Outbound; } export function availableSupplyModelsToJSON( availableSupplyModels: AvailableSupplyModels, ): string { return JSON.stringify( AvailableSupplyModels$outboundSchema.parse(availableSupplyModels), ); } export function availableSupplyModelsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AvailableSupplyModels$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AvailableSupplyModels' from JSON`, ); }