/* * 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 DeploymentV3Env = { value: string; name: string; }; export type DeploymentV3 = { /** * The id of the fleet. */ fleetId?: string | undefined; /** * Arbitrary metadata associated with a deployment. */ deploymentTag?: string | undefined; /** * 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 number of GPUs allocated to your process. Must be an integer. * * @remarks * If not provided, the requested GPU is 0. */ requestedGPU?: number | undefined; /** * EXPERIMENTAL - this feature is in closed beta. * * @remarks * The number of GPUs allocated to your process. Must be an integer. * If not provided, the requested GPU is 0. */ experimentalRequestedGPU?: number | undefined; /** * The amount of memory allocated to your process. By default, this is capped * * @remarks * at 8192 MB, but can be increased further on the Enterprise tier. */ requestedMemoryMB: number; /** * The number of cores allocated to your process. */ requestedCPU: number; /** * System generated id for a deployment. */ deploymentId: string; /** * Tag to associate an external version with a build. It is accessible via [`GetBuild()`](https://hathora.dev/api#tag/BuildsV3/operation/GetBuild). */ buildTag?: string | undefined; /** * System generated id for a build. Can also be user defined when creating a build. */ buildId: string; /** * System generated unique identifier for an application. */ appId: string; }; /** @internal */ export const DeploymentV3Env$inboundSchema: z.ZodType< DeploymentV3Env, z.ZodTypeDef, unknown > = z.object({ value: z.string(), name: z.string(), }); export function deploymentV3EnvFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentV3Env$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentV3Env' from JSON`, ); } /** @internal */ export const DeploymentV3$inboundSchema: z.ZodType< DeploymentV3, z.ZodTypeDef, unknown > = z.object({ fleetId: z.string().optional(), deploymentTag: z.string().optional(), idleTimeoutEnabled: z.boolean(), env: z.array(z.lazy(() => DeploymentV3Env$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(), requestedGPU: z.number().optional(), experimentalRequestedGPU: z.number().optional(), requestedMemoryMB: z.number(), requestedCPU: z.number(), deploymentId: z.string(), buildTag: z.string().optional(), buildId: z.string(), appId: z.string(), }); export function deploymentV3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentV3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentV3' from JSON`, ); }