/* * 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"; export type AutoscalerConfig = { /** * If vCPU utilization rate is above this threshold percentage, the autoscaler will scale up. * * @remarks * If set to 100 this disables preemptive autoscaling (i.e. nodes will only scale up when you * run out of capacity and request more resources). */ scaleUpThreshold: number; }; /** @internal */ export const AutoscalerConfig$inboundSchema: z.ZodType< AutoscalerConfig, z.ZodTypeDef, unknown > = z.object({ scaleUpThreshold: z.number().int(), }); /** @internal */ export type AutoscalerConfig$Outbound = { scaleUpThreshold: number; }; /** @internal */ export const AutoscalerConfig$outboundSchema: z.ZodType< AutoscalerConfig$Outbound, z.ZodTypeDef, AutoscalerConfig > = z.object({ scaleUpThreshold: z.number().int(), }); export function autoscalerConfigToJSON( autoscalerConfig: AutoscalerConfig, ): string { return JSON.stringify( AutoscalerConfig$outboundSchema.parse(autoscalerConfig), ); } export function autoscalerConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AutoscalerConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AutoscalerConfig' from JSON`, ); }