/* * 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 { ContainerPort, ContainerPort$inboundSchema } from "./containerport.js"; export type DeploymentV2Env = { value: string; name: string; }; export type DeploymentV2 = { /** * 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; /** * A container port object represents the transport configruations for how your server will listen. */ defaultContainerPort: ContainerPort; /** * When the deployment was created. */ createdAt: Date; createdBy: string; /** * The amount of memory allocated to your process. */ requestedMemoryMB: number; /** * The number of cores allocated to your process. */ requestedCPU: number; /** * System generated id for a deployment. Increments by 1. */ deploymentId: number; /** * System generated id for a build. Increments by 1. */ buildId: number; /** * System generated unique identifier for an application. */ appId: string; }; /** @internal */ export const DeploymentV2Env$inboundSchema: z.ZodType< DeploymentV2Env, z.ZodTypeDef, unknown > = z.object({ value: z.string(), name: z.string(), }); export function deploymentV2EnvFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentV2Env$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentV2Env' from JSON`, ); } /** @internal */ export const DeploymentV2$inboundSchema: z.ZodType< DeploymentV2, z.ZodTypeDef, unknown > = z.object({ idleTimeoutEnabled: z.boolean(), env: z.array(z.lazy(() => DeploymentV2Env$inboundSchema)), roomsPerProcess: z.number().int(), additionalContainerPorts: z.array(ContainerPort$inboundSchema), defaultContainerPort: ContainerPort$inboundSchema, createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), createdBy: z.string(), requestedMemoryMB: z.number(), requestedCPU: z.number(), deploymentId: z.number().int(), buildId: z.number().int(), appId: z.string(), }); export function deploymentV2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentV2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentV2' from JSON`, ); }