/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 28f4178eed85 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; 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 ConfigureProjectSourceGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | undefined; }; /** * Template root directory inside alienplatform/alien */ export const ConfigureProjectSourceTemplatePathRequest = { ExamplesCustomerModelsTs: "examples/customer-models-ts", ExamplesRemoteWorkerTs: "examples/remote-worker-ts", ExamplesGithubAgentPackagesRemoteAgent: "examples/github-agent/packages/remote-agent", ExamplesEndpointAgent: "examples/endpoint-agent", ExamplesByocDatabase: "examples/byoc-database", } as const; /** * Template root directory inside alienplatform/alien */ export type ConfigureProjectSourceTemplatePathRequest = ClosedEnum< typeof ConfigureProjectSourceTemplatePathRequest >; export type TemplateRequest = { mode: "template"; targetNamespace: string; /** * Template root directory inside alienplatform/alien */ templatePath: ConfigureProjectSourceTemplatePathRequest; /** * 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; }; /** * The Git Provider of the repository */ export const ConfigureProjectSourceTypeRequest = { Github: "github", } as const; /** * The Git Provider of the repository */ export type ConfigureProjectSourceTypeRequest = ClosedEnum< typeof ConfigureProjectSourceTypeRequest >; export type ConfigureProjectSourceGitRepositoryRequest = { /** * The Git Provider of the repository */ type: ConfigureProjectSourceTypeRequest; /** * The name of the git repository */ repo: string; }; export type ConfigureProjectSourceRepository = { mode: "repository"; gitRepository: ConfigureProjectSourceGitRepositoryRequest; /** * 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; }; export type ConfigureProjectSourceRequestBody = | ConfigureProjectSourceRepository | TemplateRequest; export type ConfigureProjectSourceRequest = { /** * Project ID or name. */ idOrName: string; requestBody?: ConfigureProjectSourceRepository | TemplateRequest | undefined; }; /** * The Git Provider of the repository */ export const ConfigureProjectSourceTypeResponse = { Github: "github", } as const; /** * The Git Provider of the repository */ export type ConfigureProjectSourceTypeResponse = ClosedEnum< typeof ConfigureProjectSourceTypeResponse >; /** * 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 ConfigureProjectSourceGitRepositoryResponse = { /** * The Git Provider of the repository */ type: ConfigureProjectSourceTypeResponse; /** * The name of the git repository */ repo: string; }; /** * Customer-facing deployment portal appearance settings. */ export type ConfigureProjectSourceDeploymentPortalAppearance = { /** * Optional project-specific avatar override for the deployment portal. */ avatarUrl?: string | null | undefined; /** * Curated visual style for the deployment portal. */ preset: models.DeploymentPortalAppearancePreset; /** * Accent color used for highlights and primary actions. */ accentColor: models.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: models.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 ConfigureProjectSourceBinaryTarget = { 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 ConfigureProjectSourceBinaryTarget = ClosedEnum< typeof ConfigureProjectSourceBinaryTarget >; /** * CLI package configuration. If null, CLI packages will not be generated. */ export type ConfigureProjectSourceCli = { /** * 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 ConfigureProjectSourceCloudformation = { /** * 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 ConfigureProjectSourceOperatorImage = { /** * 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 ConfigureProjectSourceHelm = { /** * 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 ConfigureProjectSourceTerraform = { /** * 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 ConfigureProjectSourcePackagesConfig = { /** * CLI package configuration. If null, CLI packages will not be generated. */ cli?: ConfigureProjectSourceCli | null | undefined; /** * CloudFormation package configuration. If null, CloudFormation packages will not be generated. */ cloudformation?: ConfigureProjectSourceCloudformation | null | undefined; /** * Operator image package configuration. Required when Helm is enabled. If null, Operator image packages will not be generated. */ operatorImage?: ConfigureProjectSourceOperatorImage | null | undefined; /** * Helm chart package configuration. If null, Helm packages will not be generated. */ helm?: ConfigureProjectSourceHelm | null | undefined; /** * Terraform package configuration. If null, Terraform packages will not be generated. */ terraform?: ConfigureProjectSourceTerraform | null | undefined; }; /** * Project default private managers for new push deployments. */ export type ConfigureProjectSourceDefaultManagers = { /** * 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 ConfigureProjectSourceMethod = { Framework: "framework", RemoteOperator: "remote-operator", } as const; export type ConfigureProjectSourceMethod = ClosedEnum< typeof ConfigureProjectSourceMethod >; export type ConfigureProjectSourceDeployments = { enabled: boolean; methods?: Array | undefined; }; export type ConfigureProjectSourceKeys = { enabled: boolean; applicationEncryption: boolean; }; export const ConfigureProjectSourceAllowedProvider = { AwsBedrock: "aws-bedrock", GcpVertex: "gcp-vertex", AzureFoundry: "azure-foundry", Anthropic: "anthropic", Databricks: "databricks", Openai: "openai", } as const; export type ConfigureProjectSourceAllowedProvider = ClosedEnum< typeof ConfigureProjectSourceAllowedProvider >; export const ConfigureProjectSourceClientApi = { OpenaiChat: "openai-chat", OpenaiResponses: "openai-responses", AnthropicMessages: "anthropic-messages", } as const; export type ConfigureProjectSourceClientApi = ClosedEnum< typeof ConfigureProjectSourceClientApi >; export type ConfigureProjectSourceRequirement = { publicModelId: string; clientApis: Array; required: boolean; }; export type ConfigureProjectSourceModels = { enabled: boolean; allowedProviders: Array; requirements: Array; }; export const ConfigureProjectSourceAccess = { ReadWrite: "read-write", } as const; export type ConfigureProjectSourceAccess = ClosedEnum< typeof ConfigureProjectSourceAccess >; export type ConfigureProjectSourceBuckets = { enabled: boolean; access: ConfigureProjectSourceAccess; }; export const ConfigureProjectSourceCredentialPolicy = { PullOnly: "pull-only", PushAndPull: "push-and-pull", } as const; export type ConfigureProjectSourceCredentialPolicy = ClosedEnum< typeof ConfigureProjectSourceCredentialPolicy >; export type ConfigureProjectSourceRegistry = { enabled: boolean; repositories: Array; credentialPolicy: ConfigureProjectSourceCredentialPolicy; }; export type ConfigureProjectSourceAzure = { catalogImage: string; idleSuspendSeconds: number; }; export type ConfigureProjectSourceRemoteSandbox = { enabled: boolean; baseImage?: string | undefined; azure?: ConfigureProjectSourceAzure | undefined; maxLifetimeSeconds?: number | undefined; }; export type ConfigureProjectSourceCapabilities = { deployments?: ConfigureProjectSourceDeployments | undefined; keys?: ConfigureProjectSourceKeys | undefined; models?: ConfigureProjectSourceModels | undefined; buckets?: ConfigureProjectSourceBuckets | undefined; registry?: ConfigureProjectSourceRegistry | undefined; remoteSandbox?: ConfigureProjectSourceRemoteSandbox | undefined; }; /** * Capabilities this Project may offer through setup links. */ export type ConfigureProjectSourceProjectCapabilities = { schemaVersion: number; capabilities: ConfigureProjectSourceCapabilities; }; export type ConfigureProjectSourceGithubSetup = { /** * URL to the pull request with the Alien build workflow */ pullRequestUrl: string; /** * URL to the GitHub Actions workflow */ workflowUrl: string; }; export const ConfigureProjectSourceSourceRepository = { AlienplatformAlien: "alienplatform/alien", } as const; export type ConfigureProjectSourceSourceRepository = ClosedEnum< typeof ConfigureProjectSourceSourceRepository >; /** * Template root directory inside alienplatform/alien */ export const ConfigureProjectSourceTemplatePathResponse = { ExamplesCustomerModelsTs: "examples/customer-models-ts", ExamplesRemoteWorkerTs: "examples/remote-worker-ts", ExamplesGithubAgentPackagesRemoteAgent: "examples/github-agent/packages/remote-agent", ExamplesEndpointAgent: "examples/endpoint-agent", ExamplesByocDatabase: "examples/byoc-database", } as const; /** * Template root directory inside alienplatform/alien */ export type ConfigureProjectSourceTemplatePathResponse = ClosedEnum< typeof ConfigureProjectSourceTemplatePathResponse >; export type ConfigureProjectSourceTemplateResponse = { sourceRepository: ConfigureProjectSourceSourceRepository; /** * Fork repository in / format */ forkRepository: string; /** * Template root directory inside alienplatform/alien */ templatePath: ConfigureProjectSourceTemplatePathResponse; resolvedRootDirectory: string; }; /** * Project source connected. */ export type ConfigureProjectSourceResponse = { /** * 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?: | ConfigureProjectSourceGitRepositoryResponse | 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?: | ConfigureProjectSourceDeploymentPortalAppearance | null | undefined; /** * Configuration for embedded packages (CLI, CloudFormation, Helm, Terraform) */ packagesConfig?: ConfigureProjectSourcePackagesConfig | null | undefined; /** * Selected domain for this project (null = default system domain) */ domainId?: string | null | undefined; /** * Project default private managers for new push deployments. */ defaultManagers?: ConfigureProjectSourceDefaultManagers | null | undefined; /** * Capabilities this Project may offer through setup links. */ projectCapabilities?: | ConfigureProjectSourceProjectCapabilities | null | undefined; createdAt: Date; /** * Unique identifier for the workspace. */ workspaceId: string; githubSetup?: ConfigureProjectSourceGithubSetup | undefined; gitRepositoryWarning?: models.APIError | undefined; template?: ConfigureProjectSourceTemplateResponse | undefined; }; /** @internal */ export const ConfigureProjectSourceTemplatePathRequest$outboundSchema: z.ZodEnum = z.enum( ConfigureProjectSourceTemplatePathRequest, ); /** @internal */ export type TemplateRequest$Outbound = { mode: "template"; targetNamespace: string; templatePath: string; rootDirectory?: string | null | undefined; }; /** @internal */ export const TemplateRequest$outboundSchema: z.ZodType< TemplateRequest$Outbound, TemplateRequest > = z.object({ mode: z.literal("template"), targetNamespace: z.string(), templatePath: ConfigureProjectSourceTemplatePathRequest$outboundSchema, rootDirectory: z.nullable(z.string()).optional(), }); export function templateRequestToJSON( templateRequest: TemplateRequest, ): string { return JSON.stringify(TemplateRequest$outboundSchema.parse(templateRequest)); } /** @internal */ export const ConfigureProjectSourceTypeRequest$outboundSchema: z.ZodEnum< typeof ConfigureProjectSourceTypeRequest > = z.enum(ConfigureProjectSourceTypeRequest); /** @internal */ export type ConfigureProjectSourceGitRepositoryRequest$Outbound = { type: string; repo: string; }; /** @internal */ export const ConfigureProjectSourceGitRepositoryRequest$outboundSchema: z.ZodType< ConfigureProjectSourceGitRepositoryRequest$Outbound, ConfigureProjectSourceGitRepositoryRequest > = z.object({ type: ConfigureProjectSourceTypeRequest$outboundSchema, repo: z.string(), }); export function configureProjectSourceGitRepositoryRequestToJSON( configureProjectSourceGitRepositoryRequest: ConfigureProjectSourceGitRepositoryRequest, ): string { return JSON.stringify( ConfigureProjectSourceGitRepositoryRequest$outboundSchema.parse( configureProjectSourceGitRepositoryRequest, ), ); } /** @internal */ export type ConfigureProjectSourceRepository$Outbound = { mode: "repository"; gitRepository: ConfigureProjectSourceGitRepositoryRequest$Outbound; rootDirectory?: string | null | undefined; }; /** @internal */ export const ConfigureProjectSourceRepository$outboundSchema: z.ZodType< ConfigureProjectSourceRepository$Outbound, ConfigureProjectSourceRepository > = z.object({ mode: z.literal("repository"), gitRepository: z.lazy(() => ConfigureProjectSourceGitRepositoryRequest$outboundSchema ), rootDirectory: z.nullable(z.string()).optional(), }); export function configureProjectSourceRepositoryToJSON( configureProjectSourceRepository: ConfigureProjectSourceRepository, ): string { return JSON.stringify( ConfigureProjectSourceRepository$outboundSchema.parse( configureProjectSourceRepository, ), ); } /** @internal */ export type ConfigureProjectSourceRequestBody$Outbound = | ConfigureProjectSourceRepository$Outbound | TemplateRequest$Outbound; /** @internal */ export const ConfigureProjectSourceRequestBody$outboundSchema: z.ZodType< ConfigureProjectSourceRequestBody$Outbound, ConfigureProjectSourceRequestBody > = z.union([ z.lazy(() => ConfigureProjectSourceRepository$outboundSchema), z.lazy(() => TemplateRequest$outboundSchema), ]); export function configureProjectSourceRequestBodyToJSON( configureProjectSourceRequestBody: ConfigureProjectSourceRequestBody, ): string { return JSON.stringify( ConfigureProjectSourceRequestBody$outboundSchema.parse( configureProjectSourceRequestBody, ), ); } /** @internal */ export type ConfigureProjectSourceRequest$Outbound = { idOrName: string; RequestBody?: | ConfigureProjectSourceRepository$Outbound | TemplateRequest$Outbound | undefined; }; /** @internal */ export const ConfigureProjectSourceRequest$outboundSchema: z.ZodType< ConfigureProjectSourceRequest$Outbound, ConfigureProjectSourceRequest > = z.object({ idOrName: z.string(), requestBody: z.union([ z.lazy(() => ConfigureProjectSourceRepository$outboundSchema), z.lazy(() => TemplateRequest$outboundSchema), ]).optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function configureProjectSourceRequestToJSON( configureProjectSourceRequest: ConfigureProjectSourceRequest, ): string { return JSON.stringify( ConfigureProjectSourceRequest$outboundSchema.parse( configureProjectSourceRequest, ), ); } /** @internal */ export const ConfigureProjectSourceTypeResponse$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceTypeResponse > = z.enum(ConfigureProjectSourceTypeResponse); /** @internal */ export const ConfigureProjectSourceGitRepositoryResponse$inboundSchema: z.ZodType = z.object({ type: ConfigureProjectSourceTypeResponse$inboundSchema, repo: z.string(), }); export function configureProjectSourceGitRepositoryResponseFromJSON( jsonString: string, ): SafeParseResult< ConfigureProjectSourceGitRepositoryResponse, SDKValidationError > { return safeParse( jsonString, (x) => ConfigureProjectSourceGitRepositoryResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ConfigureProjectSourceGitRepositoryResponse' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceDeploymentPortalAppearance$inboundSchema: z.ZodType = z .object({ avatarUrl: z.nullable(z.string()).optional(), preset: models.DeploymentPortalAppearancePreset$inboundSchema.default( "clean", ), accentColor: models.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: models.DeploymentPortalDensity$inboundSchema.default( "comfortable", ), }); export function configureProjectSourceDeploymentPortalAppearanceFromJSON( jsonString: string, ): SafeParseResult< ConfigureProjectSourceDeploymentPortalAppearance, SDKValidationError > { return safeParse( jsonString, (x) => ConfigureProjectSourceDeploymentPortalAppearance$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ConfigureProjectSourceDeploymentPortalAppearance' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceBinaryTarget$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceBinaryTarget > = z.enum(ConfigureProjectSourceBinaryTarget); /** @internal */ export const ConfigureProjectSourceCli$inboundSchema: z.ZodType< ConfigureProjectSourceCli, unknown > = z.object({ binaryTargets: z.array(ConfigureProjectSourceBinaryTarget$inboundSchema) .optional(), displayName: z.string(), name: z.string(), enabled: z.boolean(), }); export function configureProjectSourceCliFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceCli$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceCli' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceCloudformation$inboundSchema: z.ZodType< ConfigureProjectSourceCloudformation, unknown > = z.object({ enabled: z.boolean(), displayName: z.nullable(z.string()).optional(), }); export function configureProjectSourceCloudformationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceCloudformation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceCloudformation' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceOperatorImage$inboundSchema: z.ZodType< ConfigureProjectSourceOperatorImage, 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 configureProjectSourceOperatorImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceOperatorImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceOperatorImage' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceHelm$inboundSchema: z.ZodType< ConfigureProjectSourceHelm, unknown > = z.object({ chartName: z.string(), description: z.string(), enabled: z.boolean(), }); export function configureProjectSourceHelmFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceHelm$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceHelm' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceTerraform$inboundSchema: z.ZodType< ConfigureProjectSourceTerraform, unknown > = z.object({ enabled: z.boolean(), displayName: z.nullable(z.string()).optional(), }); export function configureProjectSourceTerraformFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceTerraform$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceTerraform' from JSON`, ); } /** @internal */ export const ConfigureProjectSourcePackagesConfig$inboundSchema: z.ZodType< ConfigureProjectSourcePackagesConfig, unknown > = z.object({ cli: z.nullable(z.lazy(() => ConfigureProjectSourceCli$inboundSchema)) .optional(), cloudformation: z.nullable( z.lazy(() => ConfigureProjectSourceCloudformation$inboundSchema), ).optional(), operatorImage: z.nullable( z.lazy(() => ConfigureProjectSourceOperatorImage$inboundSchema), ).optional(), helm: z.nullable(z.lazy(() => ConfigureProjectSourceHelm$inboundSchema)) .optional(), terraform: z.nullable( z.lazy(() => ConfigureProjectSourceTerraform$inboundSchema), ).optional(), }); export function configureProjectSourcePackagesConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourcePackagesConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourcePackagesConfig' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceDefaultManagers$inboundSchema: z.ZodType< ConfigureProjectSourceDefaultManagers, 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 configureProjectSourceDefaultManagersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceDefaultManagers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceDefaultManagers' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceMethod$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceMethod > = z.enum(ConfigureProjectSourceMethod); /** @internal */ export const ConfigureProjectSourceDeployments$inboundSchema: z.ZodType< ConfigureProjectSourceDeployments, unknown > = z.object({ enabled: z.boolean(), methods: z.array(ConfigureProjectSourceMethod$inboundSchema).optional(), }); export function configureProjectSourceDeploymentsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceDeployments$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceDeployments' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceKeys$inboundSchema: z.ZodType< ConfigureProjectSourceKeys, unknown > = z.object({ enabled: z.boolean(), applicationEncryption: z.boolean(), }); export function configureProjectSourceKeysFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceKeys$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceKeys' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceAllowedProvider$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceAllowedProvider > = z.enum(ConfigureProjectSourceAllowedProvider); /** @internal */ export const ConfigureProjectSourceClientApi$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceClientApi > = z.enum(ConfigureProjectSourceClientApi); /** @internal */ export const ConfigureProjectSourceRequirement$inboundSchema: z.ZodType< ConfigureProjectSourceRequirement, unknown > = z.object({ publicModelId: z.string(), clientApis: z.array(ConfigureProjectSourceClientApi$inboundSchema), required: z.boolean(), }); export function configureProjectSourceRequirementFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceRequirement$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceRequirement' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceModels$inboundSchema: z.ZodType< ConfigureProjectSourceModels, unknown > = z.object({ enabled: z.boolean(), allowedProviders: z.array( ConfigureProjectSourceAllowedProvider$inboundSchema, ), requirements: z.array( z.lazy(() => ConfigureProjectSourceRequirement$inboundSchema), ), }); export function configureProjectSourceModelsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceModels$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceModels' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceAccess$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceAccess > = z.enum(ConfigureProjectSourceAccess); /** @internal */ export const ConfigureProjectSourceBuckets$inboundSchema: z.ZodType< ConfigureProjectSourceBuckets, unknown > = z.object({ enabled: z.boolean(), access: ConfigureProjectSourceAccess$inboundSchema, }); export function configureProjectSourceBucketsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceBuckets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceBuckets' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceCredentialPolicy$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceCredentialPolicy > = z.enum(ConfigureProjectSourceCredentialPolicy); /** @internal */ export const ConfigureProjectSourceRegistry$inboundSchema: z.ZodType< ConfigureProjectSourceRegistry, unknown > = z.object({ enabled: z.boolean(), repositories: z.array(z.string()), credentialPolicy: ConfigureProjectSourceCredentialPolicy$inboundSchema, }); export function configureProjectSourceRegistryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceRegistry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceRegistry' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceAzure$inboundSchema: z.ZodType< ConfigureProjectSourceAzure, unknown > = z.object({ catalogImage: z.string(), idleSuspendSeconds: z.int(), }); export function configureProjectSourceAzureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceAzure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceAzure' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceRemoteSandbox$inboundSchema: z.ZodType< ConfigureProjectSourceRemoteSandbox, unknown > = z.object({ enabled: z.boolean(), baseImage: z.string().optional(), azure: z.lazy(() => ConfigureProjectSourceAzure$inboundSchema).optional(), maxLifetimeSeconds: z.int().optional(), }); export function configureProjectSourceRemoteSandboxFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceRemoteSandbox$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceRemoteSandbox' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceCapabilities$inboundSchema: z.ZodType< ConfigureProjectSourceCapabilities, unknown > = z.object({ deployments: z.lazy(() => ConfigureProjectSourceDeployments$inboundSchema) .optional(), keys: z.lazy(() => ConfigureProjectSourceKeys$inboundSchema).optional(), models: z.lazy(() => ConfigureProjectSourceModels$inboundSchema).optional(), buckets: z.lazy(() => ConfigureProjectSourceBuckets$inboundSchema).optional(), registry: z.lazy(() => ConfigureProjectSourceRegistry$inboundSchema) .optional(), remoteSandbox: z.lazy(() => ConfigureProjectSourceRemoteSandbox$inboundSchema) .optional(), }); export function configureProjectSourceCapabilitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceCapabilities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceCapabilities' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceProjectCapabilities$inboundSchema: z.ZodType< ConfigureProjectSourceProjectCapabilities, unknown > = z.object({ schemaVersion: z.number(), capabilities: z.lazy(() => ConfigureProjectSourceCapabilities$inboundSchema), }); export function configureProjectSourceProjectCapabilitiesFromJSON( jsonString: string, ): SafeParseResult< ConfigureProjectSourceProjectCapabilities, SDKValidationError > { return safeParse( jsonString, (x) => ConfigureProjectSourceProjectCapabilities$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ConfigureProjectSourceProjectCapabilities' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceGithubSetup$inboundSchema: z.ZodType< ConfigureProjectSourceGithubSetup, unknown > = z.object({ pullRequestUrl: z.string(), workflowUrl: z.string(), }); export function configureProjectSourceGithubSetupFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceGithubSetup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceGithubSetup' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceSourceRepository$inboundSchema: z.ZodEnum< typeof ConfigureProjectSourceSourceRepository > = z.enum(ConfigureProjectSourceSourceRepository); /** @internal */ export const ConfigureProjectSourceTemplatePathResponse$inboundSchema: z.ZodEnum = z.enum( ConfigureProjectSourceTemplatePathResponse, ); /** @internal */ export const ConfigureProjectSourceTemplateResponse$inboundSchema: z.ZodType< ConfigureProjectSourceTemplateResponse, unknown > = z.object({ sourceRepository: ConfigureProjectSourceSourceRepository$inboundSchema, forkRepository: z.string(), templatePath: ConfigureProjectSourceTemplatePathResponse$inboundSchema, resolvedRootDirectory: z.string(), }); export function configureProjectSourceTemplateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceTemplateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceTemplateResponse' from JSON`, ); } /** @internal */ export const ConfigureProjectSourceResponse$inboundSchema: z.ZodType< ConfigureProjectSourceResponse, unknown > = z.object({ id: z.string(), name: z.string(), gitRepository: z.nullable( z.lazy(() => ConfigureProjectSourceGitRepositoryResponse$inboundSchema), ).optional(), rootDirectory: z.nullable(z.string()).optional(), deploymentPortalAppearance: z.nullable( z.lazy(() => ConfigureProjectSourceDeploymentPortalAppearance$inboundSchema ), ).optional(), packagesConfig: z.nullable( z.lazy(() => ConfigureProjectSourcePackagesConfig$inboundSchema), ).optional(), domainId: z.nullable(z.string()).optional(), defaultManagers: z.nullable( z.lazy(() => ConfigureProjectSourceDefaultManagers$inboundSchema), ).optional(), projectCapabilities: z.nullable( z.lazy(() => ConfigureProjectSourceProjectCapabilities$inboundSchema), ).optional(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), workspaceId: z.string(), githubSetup: z.lazy(() => ConfigureProjectSourceGithubSetup$inboundSchema) .optional(), gitRepositoryWarning: models.APIError$inboundSchema.optional(), template: z.lazy(() => ConfigureProjectSourceTemplateResponse$inboundSchema) .optional(), }); export function configureProjectSourceResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigureProjectSourceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigureProjectSourceResponse' from JSON`, ); }