/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 6fbd3868de86 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * Deployment status of the internal deployment */ export const ManagerDeploymentStatus = { Pending: "pending", PreflightsFailed: "preflights-failed", InitialSetup: "initial-setup", InitialSetupFailed: "initial-setup-failed", Provisioning: "provisioning", WaitingForMachines: "waiting-for-machines", ProvisioningFailed: "provisioning-failed", Running: "running", RefreshFailed: "refresh-failed", UpdatePending: "update-pending", Updating: "updating", UpdateFailed: "update-failed", DeletePending: "delete-pending", Deleting: "deleting", DeleteFailed: "delete-failed", TeardownRequired: "teardown-required", TeardownFailed: "teardown-failed", Deleted: "deleted", Error: "error", } as const; /** * Deployment status of the internal deployment */ export type ManagerDeploymentStatus = ClosedEnum< typeof ManagerDeploymentStatus >; export type ManagerDeploymentResources = { /** * Resource type */ type: string; /** * Resource status */ status: string; /** * Resource outputs */ outputs?: { [k: string]: any | null } | undefined; }; export type ManagerDeployment = { /** * Platform of the internal deployment */ platform: string; /** * Deployment status of the internal deployment */ status: ManagerDeploymentStatus; /** * Internal deployment ID */ deploymentId: string; /** * Currently deployed private manager release */ currentReleaseId?: string | null | undefined; /** * Target private manager release for an in-progress update */ desiredReleaseId?: string | null | undefined; /** * Latest provision / upgrade / delete error */ error?: any | null | undefined; /** * Simplified stack state resources */ resources: { [k: string]: ManagerDeploymentResources }; /** * Manager environment info */ environmentInfo?: any | null | undefined; }; /** @internal */ export const ManagerDeploymentStatus$inboundSchema: z.ZodEnum< typeof ManagerDeploymentStatus > = z.enum(ManagerDeploymentStatus); /** @internal */ export const ManagerDeploymentResources$inboundSchema: z.ZodType< ManagerDeploymentResources, unknown > = z.object({ type: z.string(), status: z.string(), outputs: z.record(z.string(), z.nullable(z.any())).optional(), }); export function managerDeploymentResourcesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerDeploymentResources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerDeploymentResources' from JSON`, ); } /** @internal */ export const ManagerDeployment$inboundSchema: z.ZodType< ManagerDeployment, unknown > = z.object({ platform: z.string(), status: ManagerDeploymentStatus$inboundSchema, deploymentId: z.string(), currentReleaseId: z.nullable(z.string()).optional(), desiredReleaseId: z.nullable(z.string()).optional(), error: z.nullable(z.any()).optional(), resources: z.record( z.string(), z.lazy(() => ManagerDeploymentResources$inboundSchema), ), environmentInfo: z.nullable(z.any()).optional(), }); export function managerDeploymentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerDeployment' from JSON`, ); }