/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: ea676ba112b9 */ 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 { CommandDeploymentGroupInfo, CommandDeploymentGroupInfo$inboundSchema, } from "./commanddeploymentgroupinfo.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * Represents the target cloud platform. */ export const CommandDeploymentInfoPlatform = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type CommandDeploymentInfoPlatform = ClosedEnum< typeof CommandDeploymentInfoPlatform >; export const CommandDeploymentInfoPlatformTest = { Test: "test", } as const; export type CommandDeploymentInfoPlatformTest = ClosedEnum< typeof CommandDeploymentInfoPlatformTest >; /** * Test platform environment information (mock) */ export type CommandDeploymentInfoEnvironmentInfoTest = { /** * Test identifier for this environment */ testId: string; platform: CommandDeploymentInfoPlatformTest; }; export const CommandDeploymentInfoPlatformLocal = { Local: "local", } as const; export type CommandDeploymentInfoPlatformLocal = ClosedEnum< typeof CommandDeploymentInfoPlatformLocal >; /** * Local platform environment information */ export type CommandDeploymentInfoEnvironmentInfoLocal = { /** * Architecture (e.g., "x86_64", "aarch64") */ arch: string; /** * Hostname of the machine running the deployment */ hostname: string; /** * Operating system (e.g., "linux", "macos", "windows") */ os: string; platform: CommandDeploymentInfoPlatformLocal; }; export const CommandDeploymentInfoPlatformAzure = { Azure: "azure", } as const; export type CommandDeploymentInfoPlatformAzure = ClosedEnum< typeof CommandDeploymentInfoPlatformAzure >; /** * Azure-specific environment information */ export type CommandDeploymentInfoEnvironmentInfoAzure = { /** * Azure location/region */ location: string; /** * Azure subscription ID */ subscriptionId: string; /** * Azure tenant ID */ tenantId: string; platform: CommandDeploymentInfoPlatformAzure; }; export const CommandDeploymentInfoPlatformGcp = { Gcp: "gcp", } as const; export type CommandDeploymentInfoPlatformGcp = ClosedEnum< typeof CommandDeploymentInfoPlatformGcp >; /** * GCP-specific environment information */ export type CommandDeploymentInfoEnvironmentInfoGcp = { /** * GCP project ID (e.g., "my-project") */ projectId: string; /** * GCP project number (e.g., "123456789012") */ projectNumber: string; /** * GCP region */ region: string; platform: CommandDeploymentInfoPlatformGcp; }; export const CommandDeploymentInfoPlatformAws = { Aws: "aws", } as const; export type CommandDeploymentInfoPlatformAws = ClosedEnum< typeof CommandDeploymentInfoPlatformAws >; /** * AWS-specific environment information */ export type CommandDeploymentInfoEnvironmentInfoAws = { /** * AWS account ID */ accountId: string; /** * AWS region */ region: string; platform: CommandDeploymentInfoPlatformAws; }; /** * Platform-specific environment information */ export type CommandDeploymentInfoEnvironmentInfoUnion = | CommandDeploymentInfoEnvironmentInfoGcp | CommandDeploymentInfoEnvironmentInfoAzure | CommandDeploymentInfoEnvironmentInfoLocal | CommandDeploymentInfoEnvironmentInfoAws | CommandDeploymentInfoEnvironmentInfoTest | any; export type CommandDeploymentInfo = { /** * Unique identifier for the deployment. */ id: string; name: string; deploymentGroup?: CommandDeploymentGroupInfo | undefined; /** * Represents the target cloud platform. */ platform?: CommandDeploymentInfoPlatform | undefined; /** * Platform-specific environment information */ environmentInfo?: | CommandDeploymentInfoEnvironmentInfoGcp | CommandDeploymentInfoEnvironmentInfoAzure | CommandDeploymentInfoEnvironmentInfoLocal | CommandDeploymentInfoEnvironmentInfoAws | CommandDeploymentInfoEnvironmentInfoTest | any | null | undefined; /** * Manager ID for obtaining access tokens */ managerId: string; /** * URL of the manager for direct payload access */ managerUrl?: string | null | undefined; /** * Human-readable name of the manager */ managerName?: string | null | undefined; /** * Whether the manager is Alien-hosted (system) */ managerIsSystem?: boolean | null | undefined; }; /** @internal */ export const CommandDeploymentInfoPlatform$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatform > = z.enum(CommandDeploymentInfoPlatform); /** @internal */ export const CommandDeploymentInfoPlatformTest$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatformTest > = z.enum(CommandDeploymentInfoPlatformTest); /** @internal */ export const CommandDeploymentInfoEnvironmentInfoTest$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoTest, unknown > = z.object({ testId: z.string(), platform: CommandDeploymentInfoPlatformTest$inboundSchema, }); export function commandDeploymentInfoEnvironmentInfoTestFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoTest, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoTest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoTest' from JSON`, ); } /** @internal */ export const CommandDeploymentInfoPlatformLocal$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatformLocal > = z.enum(CommandDeploymentInfoPlatformLocal); /** @internal */ export const CommandDeploymentInfoEnvironmentInfoLocal$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoLocal, unknown > = z.object({ arch: z.string(), hostname: z.string(), os: z.string(), platform: CommandDeploymentInfoPlatformLocal$inboundSchema, }); export function commandDeploymentInfoEnvironmentInfoLocalFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoLocal, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoLocal$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoLocal' from JSON`, ); } /** @internal */ export const CommandDeploymentInfoPlatformAzure$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatformAzure > = z.enum(CommandDeploymentInfoPlatformAzure); /** @internal */ export const CommandDeploymentInfoEnvironmentInfoAzure$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoAzure, unknown > = z.object({ location: z.string(), subscriptionId: z.string(), tenantId: z.string(), platform: CommandDeploymentInfoPlatformAzure$inboundSchema, }); export function commandDeploymentInfoEnvironmentInfoAzureFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoAzure, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoAzure$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoAzure' from JSON`, ); } /** @internal */ export const CommandDeploymentInfoPlatformGcp$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatformGcp > = z.enum(CommandDeploymentInfoPlatformGcp); /** @internal */ export const CommandDeploymentInfoEnvironmentInfoGcp$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoGcp, unknown > = z.object({ projectId: z.string(), projectNumber: z.string(), region: z.string(), platform: CommandDeploymentInfoPlatformGcp$inboundSchema, }); export function commandDeploymentInfoEnvironmentInfoGcpFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoGcp, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoGcp$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoGcp' from JSON`, ); } /** @internal */ export const CommandDeploymentInfoPlatformAws$inboundSchema: z.ZodEnum< typeof CommandDeploymentInfoPlatformAws > = z.enum(CommandDeploymentInfoPlatformAws); /** @internal */ export const CommandDeploymentInfoEnvironmentInfoAws$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoAws, unknown > = z.object({ accountId: z.string(), region: z.string(), platform: CommandDeploymentInfoPlatformAws$inboundSchema, }); export function commandDeploymentInfoEnvironmentInfoAwsFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoAws, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoAws$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoAws' from JSON`, ); } /** @internal */ export const CommandDeploymentInfoEnvironmentInfoUnion$inboundSchema: z.ZodType< CommandDeploymentInfoEnvironmentInfoUnion, unknown > = z.union([ z.lazy(() => CommandDeploymentInfoEnvironmentInfoGcp$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoAzure$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoLocal$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoAws$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoTest$inboundSchema), z.any(), ]); export function commandDeploymentInfoEnvironmentInfoUnionFromJSON( jsonString: string, ): SafeParseResult< CommandDeploymentInfoEnvironmentInfoUnion, SDKValidationError > { return safeParse( jsonString, (x) => CommandDeploymentInfoEnvironmentInfoUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CommandDeploymentInfoEnvironmentInfoUnion' from JSON`, ); } /** @internal */ export const CommandDeploymentInfo$inboundSchema: z.ZodType< CommandDeploymentInfo, unknown > = z.object({ id: z.string(), name: z.string(), deploymentGroup: CommandDeploymentGroupInfo$inboundSchema.optional(), platform: CommandDeploymentInfoPlatform$inboundSchema.optional(), environmentInfo: z.nullable( z.union([ z.lazy(() => CommandDeploymentInfoEnvironmentInfoGcp$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoAzure$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoLocal$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoAws$inboundSchema), z.lazy(() => CommandDeploymentInfoEnvironmentInfoTest$inboundSchema), z.any(), ]), ).optional(), managerId: z.string(), managerUrl: z.nullable(z.string()).optional(), managerName: z.nullable(z.string()).optional(), managerIsSystem: z.nullable(z.boolean()).optional(), }); export function commandDeploymentInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CommandDeploymentInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CommandDeploymentInfo' from JSON`, ); }