/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ComputeReadiness, ComputeReadiness$inboundSchema, ComputeReadiness$Outbound, ComputeReadiness$outboundSchema, } from "./computereadiness.js"; import { ComputeScalingInput, ComputeScalingInput$inboundSchema, ComputeScalingInput$Outbound, ComputeScalingInput$outboundSchema, } from "./computescalinginput.js"; import { ComputeVolumeInput, ComputeVolumeInput$inboundSchema, ComputeVolumeInput$Outbound, ComputeVolumeInput$outboundSchema, } from "./computevolumeinput.js"; export type ComputeServiceInput = { readiness?: ComputeReadiness | undefined; scaling?: ComputeScalingInput | undefined; volume?: ComputeVolumeInput | undefined; }; /** @internal */ export const ComputeServiceInput$inboundSchema: z.ZodType< ComputeServiceInput, z.ZodTypeDef, unknown > = z.object({ readiness: ComputeReadiness$inboundSchema.optional(), scaling: ComputeScalingInput$inboundSchema.optional(), volume: ComputeVolumeInput$inboundSchema.optional(), }); /** @internal */ export type ComputeServiceInput$Outbound = { readiness?: ComputeReadiness$Outbound | undefined; scaling?: ComputeScalingInput$Outbound | undefined; volume?: ComputeVolumeInput$Outbound | undefined; }; /** @internal */ export const ComputeServiceInput$outboundSchema: z.ZodType< ComputeServiceInput$Outbound, z.ZodTypeDef, ComputeServiceInput > = z.object({ readiness: ComputeReadiness$outboundSchema.optional(), scaling: ComputeScalingInput$outboundSchema.optional(), volume: ComputeVolumeInput$outboundSchema.optional(), }); export function computeServiceInputToJSON( computeServiceInput: ComputeServiceInput, ): string { return JSON.stringify( ComputeServiceInput$outboundSchema.parse(computeServiceInput), ); } export function computeServiceInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeServiceInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeServiceInput' from JSON`, ); }