/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ComputeLimits = { maxCostUsd?: number | undefined; maxRuntimeHours?: number | undefined; }; /** @internal */ export const ComputeLimits$inboundSchema: z.ZodType< ComputeLimits, z.ZodTypeDef, unknown > = z.object({ max_cost_usd: z.number().optional(), max_runtime_hours: z.number().optional(), }).transform((v) => { return remap$(v, { "max_cost_usd": "maxCostUsd", "max_runtime_hours": "maxRuntimeHours", }); }); /** @internal */ export type ComputeLimits$Outbound = { max_cost_usd?: number | undefined; max_runtime_hours?: number | undefined; }; /** @internal */ export const ComputeLimits$outboundSchema: z.ZodType< ComputeLimits$Outbound, z.ZodTypeDef, ComputeLimits > = z.object({ maxCostUsd: z.number().optional(), maxRuntimeHours: z.number().optional(), }).transform((v) => { return remap$(v, { maxCostUsd: "max_cost_usd", maxRuntimeHours: "max_runtime_hours", }); }); export function computeLimitsToJSON(computeLimits: ComputeLimits): string { return JSON.stringify(ComputeLimits$outboundSchema.parse(computeLimits)); } export function computeLimitsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeLimits$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeLimits' from JSON`, ); }