/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 99675df26f2e */ 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 { DeploymentPortalAccentColor, DeploymentPortalAccentColor$inboundSchema, } from "./deploymentportalaccentcolor.js"; import { DeploymentPortalAppearancePreset, DeploymentPortalAppearancePreset$inboundSchema, } from "./deploymentportalappearancepreset.js"; import { DeploymentPortalDensity, DeploymentPortalDensity$inboundSchema, } from "./deploymentportaldensity.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * The Git Provider of the repository */ export const ProjectTypeGithub = { Github: "github", } as const; /** * The Git Provider of the repository */ export type ProjectTypeGithub = ClosedEnum; /** * Verified source repository connected to the project. Alien uses this for GitHub Actions setup and source-aware features; releases are still created explicitly by CI or `alien release`. */ export type ProjectGitRepository = { /** * The Git Provider of the repository */ type: ProjectTypeGithub; /** * The name of the git repository */ repo: string; }; /** * Customer-facing deployment portal appearance settings. */ export type ProjectDeploymentPortalAppearance = { /** * Optional project-specific avatar override for the deployment portal. */ avatarUrl?: string | null | undefined; /** * Curated visual style for the deployment portal. */ preset: DeploymentPortalAppearancePreset; /** * Accent color used for highlights and primary actions. */ accentColor: DeploymentPortalAccentColor; /** * Optional portal title. Defaults to the project name. */ title?: string | null | undefined; /** * Optional customer-facing subtitle. */ subtitle?: string | null | undefined; /** * Optional support or contact URL. */ supportUrl?: string | null | undefined; /** * Optional documentation URL. */ docsUrl?: string | null | undefined; /** * Layout density for portal content. */ density: DeploymentPortalDensity; }; /** * Target OS and architecture for compiled binaries. * * @remarks * * Used as keys in package output maps (CLI binaries, Terraform providers, etc.) * and for cross-compilation target selection during builds. */ export const ProjectBinaryTarget = { WindowsX64: "windows-x64", LinuxX64: "linux-x64", LinuxArm64: "linux-arm64", DarwinArm64: "darwin-arm64", } as const; /** * Target OS and architecture for compiled binaries. * * @remarks * * Used as keys in package output maps (CLI binaries, Terraform providers, etc.) * and for cross-compilation target selection during builds. */ export type ProjectBinaryTarget = ClosedEnum; /** * CLI package configuration. If null, CLI packages will not be generated. */ export type ProjectCli = { /** * Binary targets required by this package's setup consumer. * * @remarks * * Older package rows omit this field and retain the historical all-target * behavior. Callers creating new packages should state their target set. */ binaryTargets?: Array | undefined; /** * Human-friendly display name for help banners and about text */ displayName: string; /** * Binary name displayed in help and usage (e.g., "acmectl") */ name: string; /** * Whether CLI package generation is enabled */ enabled: boolean; }; /** * CloudFormation package configuration. If null, CloudFormation packages will not be generated. */ export type ProjectCloudformation = { /** * Whether CloudFormation package generation is enabled */ enabled: boolean; /** * Human-friendly application name shown in generated install artifacts */ displayName?: string | null | undefined; }; /** * Operator image package configuration. Required when Helm is enabled. If null, Operator image packages will not be generated. */ export type ProjectOperatorImage = { /** * Short brand slug used for generated resource names. */ brand?: string | null | undefined; /** * Human-friendly display name for logs and startup messages */ displayName: string; /** * Branded environment variable prefix (e.g., "ACME"). */ envPrefix?: string | null | undefined; /** * Branded Kubernetes/cloud label domain (e.g., "acme.dev"). */ labelDomain?: string | null | undefined; /** * Image name (e.g., "acme-operator") */ name: string; /** * Whether Operator image package generation is enabled */ enabled: boolean; }; /** * Helm chart package configuration. If null, Helm packages will not be generated. */ export type ProjectHelm = { /** * Chart name (e.g., "acme-operator") */ chartName: string; /** * Human-friendly description of the chart */ description: string; /** * Whether Helm chart package generation is enabled */ enabled: boolean; }; /** * Terraform package configuration. If null, Terraform packages will not be generated. */ export type ProjectTerraform = { /** * Whether Terraform package generation is enabled */ enabled: boolean; /** * Human-friendly application name shown in generated install artifacts */ displayName?: string | null | undefined; }; /** * Configuration for embedded packages (CLI, CloudFormation, Helm, Terraform) */ export type ProjectPackagesConfig = { /** * CLI package configuration. If null, CLI packages will not be generated. */ cli?: ProjectCli | null | undefined; /** * CloudFormation package configuration. If null, CloudFormation packages will not be generated. */ cloudformation?: ProjectCloudformation | null | undefined; /** * Operator image package configuration. Required when Helm is enabled. If null, Operator image packages will not be generated. */ operatorImage?: ProjectOperatorImage | null | undefined; /** * Helm chart package configuration. If null, Helm packages will not be generated. */ helm?: ProjectHelm | null | undefined; /** * Terraform package configuration. If null, Terraform packages will not be generated. */ terraform?: ProjectTerraform | null | undefined; }; /** * Project default private managers for new push deployments. */ export type ProjectDefaultManagers = { /** * Unique identifier for a default private manager. */ aws?: string | null | undefined; /** * Unique identifier for a default private manager. */ gcp?: string | null | undefined; /** * Unique identifier for a default private manager. */ azure?: string | null | undefined; /** * Unique identifier for a default private manager. */ kubernetes?: string | null | undefined; /** * Unique identifier for a default private manager. */ machines?: string | null | undefined; /** * Unique identifier for a default private manager. */ local?: string | null | undefined; }; export const ProjectMethod = { Framework: "framework", RemoteOperator: "remote-operator", } as const; export type ProjectMethod = ClosedEnum; export type ProjectDeployments = { enabled: boolean; methods?: Array | undefined; }; export type ProjectKeys = { enabled: boolean; applicationEncryption: boolean; }; export const ProjectAllowedProvider = { AwsBedrock: "aws-bedrock", GcpVertex: "gcp-vertex", AzureFoundry: "azure-foundry", Anthropic: "anthropic", Databricks: "databricks", Openai: "openai", } as const; export type ProjectAllowedProvider = ClosedEnum; export const ProjectClientApi = { OpenaiChat: "openai-chat", OpenaiResponses: "openai-responses", AnthropicMessages: "anthropic-messages", } as const; export type ProjectClientApi = ClosedEnum; export type ProjectRequirement = { publicModelId: string; clientApis: Array; required: boolean; }; export type ProjectModels = { enabled: boolean; allowedProviders: Array; requirements: Array; }; export const ProjectAccess = { ReadWrite: "read-write", } as const; export type ProjectAccess = ClosedEnum; export type ProjectBuckets = { enabled: boolean; access: ProjectAccess; }; export const ProjectCredentialPolicy = { PullOnly: "pull-only", PushAndPull: "push-and-pull", } as const; export type ProjectCredentialPolicy = ClosedEnum< typeof ProjectCredentialPolicy >; export type ProjectRegistry = { enabled: boolean; repositories: Array; credentialPolicy: ProjectCredentialPolicy; }; export type ProjectAzure = { catalogImage: string; idleSuspendSeconds: number; }; export type ProjectRemoteSandbox = { enabled: boolean; baseImage?: string | undefined; azure?: ProjectAzure | undefined; maxLifetimeSeconds?: number | undefined; }; export type ProjectProjectCapabilitiesCapabilities = { deployments?: ProjectDeployments | undefined; keys?: ProjectKeys | undefined; models?: ProjectModels | undefined; buckets?: ProjectBuckets | undefined; registry?: ProjectRegistry | undefined; remoteSandbox?: ProjectRemoteSandbox | undefined; }; /** * Capabilities this Project may offer through setup links. */ export type ProjectProjectCapabilities = { schemaVersion: number; capabilities: ProjectProjectCapabilitiesCapabilities; }; export type Project = { /** * Unique identifier for the project. */ id: string; /** * Project name. */ name: string; /** * Verified source repository connected to the project. Alien uses this for GitHub Actions setup and source-aware features; releases are still created explicitly by CI or `alien release`. */ gitRepository?: ProjectGitRepository | null | undefined; /** * The name of a directory or relative path to the source code of your project. When null is used it will default to the project root */ rootDirectory?: string | null | undefined; /** * Customer-facing deployment portal appearance settings. */ deploymentPortalAppearance?: | ProjectDeploymentPortalAppearance | null | undefined; /** * Configuration for embedded packages (CLI, CloudFormation, Helm, Terraform) */ packagesConfig?: ProjectPackagesConfig | null | undefined; /** * Selected domain for this project (null = default system domain) */ domainId?: string | null | undefined; /** * Project default private managers for new push deployments. */ defaultManagers?: ProjectDefaultManagers | null | undefined; /** * Capabilities this Project may offer through setup links. */ projectCapabilities?: ProjectProjectCapabilities | null | undefined; createdAt: Date; /** * Unique identifier for the workspace. */ workspaceId: string; }; /** @internal */ export const ProjectTypeGithub$inboundSchema: z.ZodEnum< typeof ProjectTypeGithub > = z.enum(ProjectTypeGithub); /** @internal */ export const ProjectGitRepository$inboundSchema: z.ZodType< ProjectGitRepository, unknown > = z.object({ type: ProjectTypeGithub$inboundSchema, repo: z.string(), }); export function projectGitRepositoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectGitRepository$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectGitRepository' from JSON`, ); } /** @internal */ export const ProjectDeploymentPortalAppearance$inboundSchema: z.ZodType< ProjectDeploymentPortalAppearance, unknown > = z.object({ avatarUrl: z.nullable(z.string()).optional(), preset: DeploymentPortalAppearancePreset$inboundSchema.default("clean"), accentColor: DeploymentPortalAccentColor$inboundSchema.default("blue"), title: z.nullable(z.string()).optional(), subtitle: z.nullable(z.string()).optional(), supportUrl: z.nullable(z.string()).optional(), docsUrl: z.nullable(z.string()).optional(), density: DeploymentPortalDensity$inboundSchema.default("comfortable"), }); export function projectDeploymentPortalAppearanceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectDeploymentPortalAppearance$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectDeploymentPortalAppearance' from JSON`, ); } /** @internal */ export const ProjectBinaryTarget$inboundSchema: z.ZodEnum< typeof ProjectBinaryTarget > = z.enum(ProjectBinaryTarget); /** @internal */ export const ProjectCli$inboundSchema: z.ZodType = z .object({ binaryTargets: z.array(ProjectBinaryTarget$inboundSchema).optional(), displayName: z.string(), name: z.string(), enabled: z.boolean(), }); export function projectCliFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectCli$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectCli' from JSON`, ); } /** @internal */ export const ProjectCloudformation$inboundSchema: z.ZodType< ProjectCloudformation, unknown > = z.object({ enabled: z.boolean(), displayName: z.nullable(z.string()).optional(), }); export function projectCloudformationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectCloudformation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectCloudformation' from JSON`, ); } /** @internal */ export const ProjectOperatorImage$inboundSchema: z.ZodType< ProjectOperatorImage, unknown > = z.object({ brand: z.nullable(z.string()).optional(), displayName: z.string(), envPrefix: z.nullable(z.string()).optional(), labelDomain: z.nullable(z.string()).optional(), name: z.string(), enabled: z.boolean(), }); export function projectOperatorImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectOperatorImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectOperatorImage' from JSON`, ); } /** @internal */ export const ProjectHelm$inboundSchema: z.ZodType = z .object({ chartName: z.string(), description: z.string(), enabled: z.boolean(), }); export function projectHelmFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectHelm$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectHelm' from JSON`, ); } /** @internal */ export const ProjectTerraform$inboundSchema: z.ZodType< ProjectTerraform, unknown > = z.object({ enabled: z.boolean(), displayName: z.nullable(z.string()).optional(), }); export function projectTerraformFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectTerraform$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectTerraform' from JSON`, ); } /** @internal */ export const ProjectPackagesConfig$inboundSchema: z.ZodType< ProjectPackagesConfig, unknown > = z.object({ cli: z.nullable(z.lazy(() => ProjectCli$inboundSchema)).optional(), cloudformation: z.nullable(z.lazy(() => ProjectCloudformation$inboundSchema)) .optional(), operatorImage: z.nullable(z.lazy(() => ProjectOperatorImage$inboundSchema)) .optional(), helm: z.nullable(z.lazy(() => ProjectHelm$inboundSchema)).optional(), terraform: z.nullable(z.lazy(() => ProjectTerraform$inboundSchema)) .optional(), }); export function projectPackagesConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectPackagesConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectPackagesConfig' from JSON`, ); } /** @internal */ export const ProjectDefaultManagers$inboundSchema: z.ZodType< ProjectDefaultManagers, unknown > = z.object({ aws: z.nullable(z.string()).optional(), gcp: z.nullable(z.string()).optional(), azure: z.nullable(z.string()).optional(), kubernetes: z.nullable(z.string()).optional(), machines: z.nullable(z.string()).optional(), local: z.nullable(z.string()).optional(), }); export function projectDefaultManagersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectDefaultManagers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectDefaultManagers' from JSON`, ); } /** @internal */ export const ProjectMethod$inboundSchema: z.ZodEnum = z .enum(ProjectMethod); /** @internal */ export const ProjectDeployments$inboundSchema: z.ZodType< ProjectDeployments, unknown > = z.object({ enabled: z.boolean(), methods: z.array(ProjectMethod$inboundSchema).optional(), }); export function projectDeploymentsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectDeployments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectDeployments' from JSON`, ); } /** @internal */ export const ProjectKeys$inboundSchema: z.ZodType = z .object({ enabled: z.boolean(), applicationEncryption: z.boolean(), }); export function projectKeysFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectKeys$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectKeys' from JSON`, ); } /** @internal */ export const ProjectAllowedProvider$inboundSchema: z.ZodEnum< typeof ProjectAllowedProvider > = z.enum(ProjectAllowedProvider); /** @internal */ export const ProjectClientApi$inboundSchema: z.ZodEnum< typeof ProjectClientApi > = z.enum(ProjectClientApi); /** @internal */ export const ProjectRequirement$inboundSchema: z.ZodType< ProjectRequirement, unknown > = z.object({ publicModelId: z.string(), clientApis: z.array(ProjectClientApi$inboundSchema), required: z.boolean(), }); export function projectRequirementFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectRequirement$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectRequirement' from JSON`, ); } /** @internal */ export const ProjectModels$inboundSchema: z.ZodType = z .object({ enabled: z.boolean(), allowedProviders: z.array(ProjectAllowedProvider$inboundSchema), requirements: z.array(z.lazy(() => ProjectRequirement$inboundSchema)), }); export function projectModelsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectModels$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectModels' from JSON`, ); } /** @internal */ export const ProjectAccess$inboundSchema: z.ZodEnum = z .enum(ProjectAccess); /** @internal */ export const ProjectBuckets$inboundSchema: z.ZodType = z.object({ enabled: z.boolean(), access: ProjectAccess$inboundSchema, }); export function projectBucketsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectBuckets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectBuckets' from JSON`, ); } /** @internal */ export const ProjectCredentialPolicy$inboundSchema: z.ZodEnum< typeof ProjectCredentialPolicy > = z.enum(ProjectCredentialPolicy); /** @internal */ export const ProjectRegistry$inboundSchema: z.ZodType< ProjectRegistry, unknown > = z.object({ enabled: z.boolean(), repositories: z.array(z.string()), credentialPolicy: ProjectCredentialPolicy$inboundSchema, }); export function projectRegistryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectRegistry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectRegistry' from JSON`, ); } /** @internal */ export const ProjectAzure$inboundSchema: z.ZodType = z .object({ catalogImage: z.string(), idleSuspendSeconds: z.int(), }); export function projectAzureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectAzure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectAzure' from JSON`, ); } /** @internal */ export const ProjectRemoteSandbox$inboundSchema: z.ZodType< ProjectRemoteSandbox, unknown > = z.object({ enabled: z.boolean(), baseImage: z.string().optional(), azure: z.lazy(() => ProjectAzure$inboundSchema).optional(), maxLifetimeSeconds: z.int().optional(), }); export function projectRemoteSandboxFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectRemoteSandbox$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectRemoteSandbox' from JSON`, ); } /** @internal */ export const ProjectProjectCapabilitiesCapabilities$inboundSchema: z.ZodType< ProjectProjectCapabilitiesCapabilities, unknown > = z.object({ deployments: z.lazy(() => ProjectDeployments$inboundSchema).optional(), keys: z.lazy(() => ProjectKeys$inboundSchema).optional(), models: z.lazy(() => ProjectModels$inboundSchema).optional(), buckets: z.lazy(() => ProjectBuckets$inboundSchema).optional(), registry: z.lazy(() => ProjectRegistry$inboundSchema).optional(), remoteSandbox: z.lazy(() => ProjectRemoteSandbox$inboundSchema).optional(), }); export function projectProjectCapabilitiesCapabilitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectProjectCapabilitiesCapabilities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectProjectCapabilitiesCapabilities' from JSON`, ); } /** @internal */ export const ProjectProjectCapabilities$inboundSchema: z.ZodType< ProjectProjectCapabilities, unknown > = z.object({ schemaVersion: z.number(), capabilities: z.lazy(() => ProjectProjectCapabilitiesCapabilities$inboundSchema ), }); export function projectProjectCapabilitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ProjectProjectCapabilities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProjectProjectCapabilities' from JSON`, ); } /** @internal */ export const Project$inboundSchema: z.ZodType = z.object({ id: z.string(), name: z.string(), gitRepository: z.nullable(z.lazy(() => ProjectGitRepository$inboundSchema)) .optional(), rootDirectory: z.nullable(z.string()).optional(), deploymentPortalAppearance: z.nullable( z.lazy(() => ProjectDeploymentPortalAppearance$inboundSchema), ).optional(), packagesConfig: z.nullable(z.lazy(() => ProjectPackagesConfig$inboundSchema)) .optional(), domainId: z.nullable(z.string()).optional(), defaultManagers: z.nullable( z.lazy(() => ProjectDefaultManagers$inboundSchema), ).optional(), projectCapabilities: z.nullable( z.lazy(() => ProjectProjectCapabilities$inboundSchema), ).optional(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), workspaceId: z.string(), }); export function projectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Project$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Project' from JSON`, ); }