/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { ContainerPort, ContainerPort$Outbound, ContainerPort$outboundSchema, } from "./containerport.js"; import { TransportType, TransportType$outboundSchema, } from "./transporttype.js"; export type DeploymentConfigV2Env = { value: string; name: string; }; export type DeploymentConfigV2 = { /** * Option to shut down processes that have had no new connections or rooms * * @remarks * for five minutes. */ idleTimeoutEnabled: boolean; /** * The environment variable that our process will have access to at runtime. */ env: Array; /** * Governs how many [rooms](https://hathora.dev/docs/concepts/hathora-entities#room) can be scheduled in a process. */ roomsPerProcess: number; /** * Additional ports your server listens on. */ additionalContainerPorts?: Array | undefined; /** * Transport type specifies the underlying communication protocol to the exposed port. */ transportType: TransportType; /** * Default port the server listens on. */ containerPort: number; /** * The amount of memory allocated to your process. */ requestedMemoryMB: number; /** * The number of cores allocated to your process. */ requestedCPU: number; }; /** @internal */ export type DeploymentConfigV2Env$Outbound = { value: string; name: string; }; /** @internal */ export const DeploymentConfigV2Env$outboundSchema: z.ZodType< DeploymentConfigV2Env$Outbound, z.ZodTypeDef, DeploymentConfigV2Env > = z.object({ value: z.string(), name: z.string(), }); export function deploymentConfigV2EnvToJSON( deploymentConfigV2Env: DeploymentConfigV2Env, ): string { return JSON.stringify( DeploymentConfigV2Env$outboundSchema.parse(deploymentConfigV2Env), ); } /** @internal */ export type DeploymentConfigV2$Outbound = { idleTimeoutEnabled: boolean; env: Array; roomsPerProcess: number; additionalContainerPorts?: Array | undefined; transportType: string; containerPort: number; requestedMemoryMB: number; requestedCPU: number; }; /** @internal */ export const DeploymentConfigV2$outboundSchema: z.ZodType< DeploymentConfigV2$Outbound, z.ZodTypeDef, DeploymentConfigV2 > = z.object({ idleTimeoutEnabled: z.boolean(), env: z.array(z.lazy(() => DeploymentConfigV2Env$outboundSchema)), roomsPerProcess: z.number().int(), additionalContainerPorts: z.array(ContainerPort$outboundSchema).optional(), transportType: TransportType$outboundSchema, containerPort: z.number().int(), requestedMemoryMB: z.number(), requestedCPU: z.number(), }); export function deploymentConfigV2ToJSON( deploymentConfigV2: DeploymentConfigV2, ): string { return JSON.stringify( DeploymentConfigV2$outboundSchema.parse(deploymentConfigV2), ); }