/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: a8dcd71bc9aa */ 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"; export type Arc = { /** * Manager URL for commands */ url: string; /** * Deployment ID to use in command requests */ deploymentId: string; }; export const Protocol = { Http: "http", Tcp: "tcp", } as const; export type Protocol = ClosedEnum; export type PublicEndpoints = { url: string; protocol: Protocol; host: string; port: number; wildcardHost?: string | undefined; }; export type DeploymentConnectionInfoResources = { /** * Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior. */ type: string; /** * Public endpoints keyed by endpoint name. */ publicEndpoints?: { [k: string]: PublicEndpoints } | undefined; }; /** * Deployment status in the deployment lifecycle. * * @remarks * * For observe-only deployments with no release or stack state, `Running` * means the Operator is attached. Connectivity comes from `lastHeartbeatAt`; * resource health comes from inventory and resource heartbeat data. */ export const DeploymentConnectionInfoStatus = { 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 in the deployment lifecycle. * * @remarks * * For observe-only deployments with no release or stack state, `Running` * means the Operator is attached. Connectivity comes from `lastHeartbeatAt`; * resource health comes from inventory and resource heartbeat data. */ export type DeploymentConnectionInfoStatus = ClosedEnum< typeof DeploymentConnectionInfoStatus >; export type DeploymentConnectionInfo = { arc: Arc; /** * Deployed resources and their public endpoints */ resources: { [k: string]: DeploymentConnectionInfoResources }; /** * Deployment status in the deployment lifecycle. * * @remarks * * For observe-only deployments with no release or stack state, `Running` * means the Operator is attached. Connectivity comes from `lastHeartbeatAt`; * resource health comes from inventory and resource heartbeat data. */ status: DeploymentConnectionInfoStatus; platform: string; }; /** @internal */ export const Arc$inboundSchema: z.ZodType = z.object({ url: z.string(), deploymentId: z.string(), }); export function arcFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Arc$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Arc' from JSON`, ); } /** @internal */ export const Protocol$inboundSchema: z.ZodEnum = z.enum( Protocol, ); /** @internal */ export const PublicEndpoints$inboundSchema: z.ZodType< PublicEndpoints, unknown > = z.object({ url: z.string(), protocol: Protocol$inboundSchema, host: z.string(), port: z.int(), wildcardHost: z.string().optional(), }); export function publicEndpointsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PublicEndpoints$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PublicEndpoints' from JSON`, ); } /** @internal */ export const DeploymentConnectionInfoResources$inboundSchema: z.ZodType< DeploymentConnectionInfoResources, unknown > = z.object({ type: z.string(), publicEndpoints: z.record( z.string(), z.lazy(() => PublicEndpoints$inboundSchema), ).optional(), }); export function deploymentConnectionInfoResourcesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentConnectionInfoResources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentConnectionInfoResources' from JSON`, ); } /** @internal */ export const DeploymentConnectionInfoStatus$inboundSchema: z.ZodEnum< typeof DeploymentConnectionInfoStatus > = z.enum(DeploymentConnectionInfoStatus); /** @internal */ export const DeploymentConnectionInfo$inboundSchema: z.ZodType< DeploymentConnectionInfo, unknown > = z.object({ arc: z.lazy(() => Arc$inboundSchema), resources: z.record( z.string(), z.lazy(() => DeploymentConnectionInfoResources$inboundSchema), ), status: DeploymentConnectionInfoStatus$inboundSchema, platform: z.string(), }); export function deploymentConnectionInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentConnectionInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentConnectionInfo' from JSON`, ); }