/* * 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 { Region, Region$inboundSchema } from "./region.js"; export type StaticProcessAllocationConfig = { /** * Whether autoscaling is enabled in this region. When enabled, `targetProcesses` is managed by the Process Autoscaler * * @remarks * in accordance with the `processAutoscalerConfig` field set on the application's `serviceConfig`. */ autoscalingEnabled?: boolean | undefined; /** * The maximum number of running processes. * * @remarks * Invariant: minProcesses <= maxProcesses */ maxProcesses: number; /** * The target number of running processes * * @remarks * When autoscaling is enabled, this field is managed by the Process Autoscaler */ targetProcesses: number; /** * The minimum number of running processes. * * @remarks * Invariant: 0 <= minProcesses < targetProcesses */ minProcesses: number; region: Region; }; /** @internal */ export const StaticProcessAllocationConfig$inboundSchema: z.ZodType< StaticProcessAllocationConfig, z.ZodTypeDef, unknown > = z.object({ autoscalingEnabled: z.boolean().optional(), maxProcesses: z.number().int(), targetProcesses: z.number().int(), minProcesses: z.number().int(), region: Region$inboundSchema, }); export function staticProcessAllocationConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StaticProcessAllocationConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StaticProcessAllocationConfig' from JSON`, ); }