/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 0466715db3ae */ import * as z from "zod/v4"; 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 DeploymentResourceConfig = { replicas?: number | null | undefined; cpuRequest?: string | null | undefined; cpuLimit?: string | null | undefined; memoryRequest?: string | null | undefined; memoryLimit?: string | null | undefined; }; /** @internal */ export const DeploymentResourceConfig$inboundSchema: z.ZodType< DeploymentResourceConfig, unknown > = z.object({ replicas: z.nullable(z.int()).optional(), cpu_request: z.nullable(z.string()).optional(), cpu_limit: z.nullable(z.string()).optional(), memory_request: z.nullable(z.string()).optional(), memory_limit: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "cpu_request": "cpuRequest", "cpu_limit": "cpuLimit", "memory_request": "memoryRequest", "memory_limit": "memoryLimit", }); }); /** @internal */ export type DeploymentResourceConfig$Outbound = { replicas?: number | null | undefined; cpu_request?: string | null | undefined; cpu_limit?: string | null | undefined; memory_request?: string | null | undefined; memory_limit?: string | null | undefined; }; /** @internal */ export const DeploymentResourceConfig$outboundSchema: z.ZodType< DeploymentResourceConfig$Outbound, DeploymentResourceConfig > = z.object({ replicas: z.nullable(z.int()).optional(), cpuRequest: z.nullable(z.string()).optional(), cpuLimit: z.nullable(z.string()).optional(), memoryRequest: z.nullable(z.string()).optional(), memoryLimit: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { cpuRequest: "cpu_request", cpuLimit: "cpu_limit", memoryRequest: "memory_request", memoryLimit: "memory_limit", }); }); export function deploymentResourceConfigToJSON( deploymentResourceConfig: DeploymentResourceConfig, ): string { return JSON.stringify( DeploymentResourceConfig$outboundSchema.parse(deploymentResourceConfig), ); } export function deploymentResourceConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentResourceConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentResourceConfig' from JSON`, ); }