/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 5f1f8b9673a0 */ 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"; import * as models from "../index.js"; export type ListDeploymentsGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | 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 ListDeploymentsStatus = { 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 ListDeploymentsStatus = ClosedEnum; /** * Represents the target cloud platform. */ export const ListDeploymentsEnvironment = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type ListDeploymentsEnvironment = ClosedEnum< typeof ListDeploymentsEnvironment >; export const ListDeploymentsInclude = { Release: "release", DeploymentGroup: "deploymentGroup", Project: "project", } as const; export type ListDeploymentsInclude = ClosedEnum; export type ListDeploymentsRequest = { /** * Filter by project ID or name. */ project?: string | undefined; /** * Filter by deployment group ID or name */ deploymentGroup?: string | undefined; /** * Filter by exact deployment name. Must be used with deploymentGroup. */ name?: string | undefined; /** * Filter by manager ID */ managerId?: string | undefined; /** * Filter by deployment purpose */ purpose?: models.DeploymentPurpose | undefined; /** * Search deployments by name, public subdomain, or deployment group name */ search?: string | undefined; /** * Filter deployments by status */ status?: Array | undefined; /** * Filter deployments by effective environment */ environment?: Array | undefined; /** * Optional fields to include: release, deploymentGroup, project */ include?: Array | undefined; /** * Maximum number of items to return per page */ limit?: number | undefined; /** * Cursor for pagination - omit for first page */ cursor?: string | undefined; }; /** * Paginated response */ export type ListDeploymentsResponse = { /** * Items in this page */ items: Array; /** * Cursor for the next page, null if last page */ nextCursor: string | null; }; /** @internal */ export const ListDeploymentsStatus$outboundSchema: z.ZodEnum< typeof ListDeploymentsStatus > = z.enum(ListDeploymentsStatus); /** @internal */ export const ListDeploymentsEnvironment$outboundSchema: z.ZodEnum< typeof ListDeploymentsEnvironment > = z.enum(ListDeploymentsEnvironment); /** @internal */ export const ListDeploymentsInclude$outboundSchema: z.ZodEnum< typeof ListDeploymentsInclude > = z.enum(ListDeploymentsInclude); /** @internal */ export type ListDeploymentsRequest$Outbound = { project?: string | undefined; deploymentGroup?: string | undefined; name?: string | undefined; managerId?: string | undefined; purpose?: string | undefined; search?: string | undefined; status?: Array | undefined; environment?: Array | undefined; include?: Array | undefined; limit: number; cursor?: string | undefined; }; /** @internal */ export const ListDeploymentsRequest$outboundSchema: z.ZodType< ListDeploymentsRequest$Outbound, ListDeploymentsRequest > = z.object({ project: z.string().optional(), deploymentGroup: z.string().optional(), name: z.string().optional(), managerId: z.string().optional(), purpose: models.DeploymentPurpose$outboundSchema.optional(), search: z.string().optional(), status: z.array(ListDeploymentsStatus$outboundSchema).optional(), environment: z.array(ListDeploymentsEnvironment$outboundSchema).optional(), include: z.array(ListDeploymentsInclude$outboundSchema).optional(), limit: z.int().default(20), cursor: z.string().optional(), }); export function listDeploymentsRequestToJSON( listDeploymentsRequest: ListDeploymentsRequest, ): string { return JSON.stringify( ListDeploymentsRequest$outboundSchema.parse(listDeploymentsRequest), ); } /** @internal */ export const ListDeploymentsResponse$inboundSchema: z.ZodType< ListDeploymentsResponse, unknown > = z.object({ items: z.array(models.DeploymentListItemResponse$inboundSchema), nextCursor: z.nullable(z.string()), }); export function listDeploymentsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListDeploymentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListDeploymentsResponse' from JSON`, ); }