UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

4,861 lines 142 kB
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
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 * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

export const Target2 = {
  Production: "production",
  Preview: "preview",
  Development: "development",
} as const;
export type Target2 = ClosedEnum<typeof Target2>;

export const Target1 = {
  Production: "production",
  Preview: "preview",
  Development: "development",
} as const;
export type Target1 = ClosedEnum<typeof Target1>;

/**
 * Deployment Target or Targets in which the ENV variable will be used
 */
export type CreateProjectTarget = Target1 | Array<Target2>;

/**
 * Type of the ENV variable
 */
export const CreateProjectType = {
  System: "system",
  Encrypted: "encrypted",
  Plain: "plain",
  Sensitive: "sensitive",
} as const;
/**
 * Type of the ENV variable
 */
export type CreateProjectType = ClosedEnum<typeof CreateProjectType>;

export type EnvironmentVariables = {
  /**
   * Name of the ENV variable
   */
  key: string;
  /**
   * Deployment Target or Targets in which the ENV variable will be used
   */
  target: Target1 | Array<Target2>;
  /**
   * If defined, the git branch of the environment variable (must have target=preview)
   */
  gitBranch?: string | undefined;
  /**
   * Type of the ENV variable
   */
  type?: CreateProjectType | undefined;
  /**
   * Value for the ENV variable
   */
  value: string;
};

/**
 * The framework that is being used for this project. When `null` is used no framework is selected
 */
export const CreateProjectFramework = {
  Container: "container",
  Blitzjs: "blitzjs",
  Nextjs: "nextjs",
  Gatsby: "gatsby",
  Remix: "remix",
  ReactRouter: "react-router",
  Astro: "astro",
  Hexo: "hexo",
  Eleventy: "eleventy",
  Docusaurus2: "docusaurus-2",
  Docusaurus: "docusaurus",
  Preact: "preact",
  Solidstart1: "solidstart-1",
  Solidstart: "solidstart",
  Dojo: "dojo",
  Ember: "ember",
  Vue: "vue",
  Scully: "scully",
  IonicAngular: "ionic-angular",
  Angular: "angular",
  Polymer: "polymer",
  Svelte: "svelte",
  Sveltekit: "sveltekit",
  Sveltekit1: "sveltekit-1",
  IonicReact: "ionic-react",
  CreateReactApp: "create-react-app",
  Gridsome: "gridsome",
  Umijs: "umijs",
  Sapper: "sapper",
  Saber: "saber",
  Stencil: "stencil",
  Nuxtjs: "nuxtjs",
  Redwoodjs: "redwoodjs",
  Hugo: "hugo",
  Jekyll: "jekyll",
  Brunch: "brunch",
  Middleman: "middleman",
  Zola: "zola",
  Hydrogen: "hydrogen",
  Vite: "vite",
  TanstackStart: "tanstack-start",
  TanstackStartLovable: "tanstack-start-lovable",
  Vitepress: "vitepress",
  Vuepress: "vuepress",
  Parcel: "parcel",
  Fastapi: "fastapi",
  Flask: "flask",
  Fasthtml: "fasthtml",
  Django: "django",
  Ash: "ash",
  FactoryEve: "factory-eve",
  Eve: "eve",
  Sanity: "sanity",
  SanityV2: "sanity-v2",
  Storybook: "storybook",
  Nitro: "nitro",
  Hono: "hono",
  Express: "express",
  H3: "h3",
  Koa: "koa",
  Nestjs: "nestjs",
  Elysia: "elysia",
  Fastify: "fastify",
  Xmcp: "xmcp",
  Python: "python",
  Ruby: "ruby",
  Rust: "rust",
  Axum: "axum",
  ActixWeb: "actix-web",
  Bun: "bun",
  Node: "node",
  Go: "go",
  Services: "services",
  Mastra: "mastra",
} as const;
/**
 * The framework that is being used for this project. When `null` is used no framework is selected
 */
export type CreateProjectFramework = ClosedEnum<typeof CreateProjectFramework>;

/**
 * The Git Provider of the repository
 */
export const CreateProjectProjectsType = {
  Github: "github",
  GithubLimited: "github-limited",
  Gitlab: "gitlab",
  Bitbucket: "bitbucket",
  Vercel: "vercel",
  CursorOrigin: "cursor-origin",
} as const;
/**
 * The Git Provider of the repository
 */
export type CreateProjectProjectsType = ClosedEnum<
  typeof CreateProjectProjectsType
>;

/**
 * The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed
 */
export type GitRepository = {
  /**
   * The name of the git repository. For example: \"vercel/next.js\"
   */
  repo: string;
  /**
   * The Git Provider of the repository
   */
  type: CreateProjectProjectsType;
};

export const CreateProjectDeploymentType = {
  All: "all",
  Preview: "preview",
  ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
  AllExceptCustomDomains: "all_except_custom_domains",
} as const;
export type CreateProjectDeploymentType = ClosedEnum<
  typeof CreateProjectDeploymentType
>;

/**
 * The Vercel Auth setting for the project (historically named \"SSO Protection\")
 */
export type CreateProjectSsoProtection = {
  deploymentType: CreateProjectDeploymentType;
};

/**
 * The Vercel region sandboxes in this project are created in by default.
 */
export const Region = {
  Iad1: "iad1",
  Sfo1: "sfo1",
  Cle1: "cle1",
  Cdg1: "cdg1",
  Fra1: "fra1",
  Arn1: "arn1",
  Sin1: "sin1",
  Pdx1: "pdx1",
  Lhr1: "lhr1",
  Icn1: "icn1",
  Bom1: "bom1",
  Cpt1: "cpt1",
  Dub1: "dub1",
  Gru1: "gru1",
  Hkg1: "hkg1",
  Syd1: "syd1",
  Yul1: "yul1",
  Hnd1: "hnd1",
  Kix1: "kix1",
} as const;
/**
 * The Vercel region sandboxes in this project are created in by default.
 */
export type Region = ClosedEnum<typeof Region>;

export const CreateProjectFailoverRegions = {
  Iad1: "iad1",
  Sfo1: "sfo1",
  Cle1: "cle1",
  Cdg1: "cdg1",
  Fra1: "fra1",
  Arn1: "arn1",
  Sin1: "sin1",
  Pdx1: "pdx1",
  Lhr1: "lhr1",
  Icn1: "icn1",
  Bom1: "bom1",
  Cpt1: "cpt1",
  Dub1: "dub1",
  Gru1: "gru1",
  Hkg1: "hkg1",
  Syd1: "syd1",
  Yul1: "yul1",
  Hnd1: "hnd1",
  Kix1: "kix1",
} as const;
export type CreateProjectFailoverRegions = ClosedEnum<
  typeof CreateProjectFailoverRegions
>;

/**
 * Specifies the default region and failover regions for sandboxes created in the project
 */
export type Sandbox = {
  /**
   * The Vercel region sandboxes in this project are created in by default.
   */
  region?: Region | undefined;
  /**
   * The regions sandboxes in this project fall back to when they cannot be created in `region`.
   */
  failoverRegions?: Array<CreateProjectFailoverRegions> | undefined;
};

/**
 * team: `https://oidc.vercel.com/[team_slug]` global: `https://oidc.vercel.com`
 */
export const CreateProjectIssuerMode = {
  Team: "team",
  Global: "global",
} as const;
/**
 * team: `https://oidc.vercel.com/[team_slug]` global: `https://oidc.vercel.com`
 */
export type CreateProjectIssuerMode = ClosedEnum<
  typeof CreateProjectIssuerMode
>;

/**
 * OpenID Connect JSON Web Token generation configuration.
 */
export type OidcTokenConfig = {
  /**
   * Whether or not to generate OpenID Connect JSON Web Tokens.
   *
   * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
   */
  enabled?: boolean | undefined;
  /**
   * team: `https://oidc.vercel.com/[team_slug]` global: `https://oidc.vercel.com`
   */
  issuerMode?: CreateProjectIssuerMode | undefined;
};

export const BuildMachineType = {
  Basic: "basic",
  Enhanced: "enhanced",
  Turbo: "turbo",
  Standard: "standard",
  Elastic: "elastic",
} as const;
export type BuildMachineType = ClosedEnum<typeof BuildMachineType>;

export const FunctionDefaultMemoryType = {
  StandardLegacy: "standard_legacy",
  Standard: "standard",
  Performance: "performance",
  PerformanceXl: "performance_xl",
} as const;
export type FunctionDefaultMemoryType = ClosedEnum<
  typeof FunctionDefaultMemoryType
>;

export const BuildMachineSelection = {
  Elastic: "elastic",
  Fixed: "fixed",
} as const;
export type BuildMachineSelection = ClosedEnum<typeof BuildMachineSelection>;

export const BuildMachineElasticReason = {
  OomFailure: "oom-failure",
  EnospcFailure: "enospc-failure",
  BuildTimeoutFailure: "build-timeout-failure",
  BasicFloor: "basic-floor",
  HighPeakMemory: "high-peak-memory",
  SustainedHighCpu: "sustained-high-cpu",
  HighPeakDisk: "high-peak-disk",
  LongBuildDuration: "long-build-duration",
  ShortBuildDuration: "short-build-duration",
  EnterpriseFloor: "enterprise-floor",
} as const;
export type BuildMachineElasticReason = ClosedEnum<
  typeof BuildMachineElasticReason
>;

export const CreateProjectConfiguration = {
  SkipNamespaceQueue: "SKIP_NAMESPACE_QUEUE",
  WaitForNamespaceQueue: "WAIT_FOR_NAMESPACE_QUEUE",
} as const;
export type CreateProjectConfiguration = ClosedEnum<
  typeof CreateProjectConfiguration
>;

export type CreateProjectBuildQueue = {
  configuration?: CreateProjectConfiguration | undefined;
};

/**
 * Specifies resource override configuration for the project
 */
export type CreateProjectResourceConfig = {
  buildMachineType?: BuildMachineType | undefined;
  fluid?: boolean | undefined;
  /**
   * The regions to deploy Vercel Functions to for this project
   */
  functionDefaultRegions?: Array<string> | undefined;
  functionDefaultTimeout?: number | undefined;
  functionDefaultMemoryType?: FunctionDefaultMemoryType | undefined;
  /**
   * Specifies whether Zero Config Failover is enabled for this project.
   */
  functionZeroConfigFailover?: boolean | undefined;
  elasticConcurrencyEnabled?: boolean | undefined;
  buildMachineSelection?: BuildMachineSelection | undefined;
  buildMachineElasticLastUpdated?: number | undefined;
  buildMachineElasticReason?: BuildMachineElasticReason | undefined;
  isNSNBDisabled?: boolean | undefined;
  buildQueue?: CreateProjectBuildQueue | undefined;
  enableFunctionsBeta?: boolean | undefined;
};

export type CreateProjectRequestBody = {
  /**
   * Opt-in to preview toolbar on the project level
   */
  enablePreviewFeedback?: boolean | null | undefined;
  /**
   * Opt-in to production toolbar on the project level
   */
  enableProductionFeedback?: boolean | null | undefined;
  /**
   * Specifies whether preview deployments are disabled for this project.
   */
  previewDeploymentsDisabled?: boolean | null | undefined;
  /**
   * Custom domain suffix for preview deployments. Takes precedence over team-level suffix. Must be a domain owned by the team.
   */
  previewDeploymentSuffix?: string | null | undefined;
  /**
   * The build command for this project. When `null` is used this value will be automatically detected
   */
  buildCommand?: string | null | undefined;
  commandForIgnoringBuildStep?: string | null | undefined;
  /**
   * The dev command for this project. When `null` is used this value will be automatically detected
   */
  devCommand?: string | null | undefined;
  /**
   * Collection of ENV Variables the Project will use
   */
  environmentVariables?: Array<EnvironmentVariables> | undefined;
  /**
   * The framework that is being used for this project. When `null` is used no framework is selected
   */
  framework?: CreateProjectFramework | undefined;
  /**
   * The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed
   */
  gitRepository?: GitRepository | undefined;
  /**
   * The install command for this project. When `null` is used this value will be automatically detected
   */
  installCommand?: string | null | undefined;
  /**
   * The desired name for the project
   */
  name: string;
  /**
   * Opts-out of the message prompting a CLI user to connect a Git repository in `vercel link`.
   *
   * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
   */
  skipGitConnectDuringLink?: boolean | undefined;
  /**
   * The Vercel Auth setting for the project (historically named \"SSO Protection\")
   */
  ssoProtection?: CreateProjectSsoProtection | null | undefined;
  /**
   * Specifies the default region and failover regions for sandboxes created in the project
   */
  sandbox?: Sandbox | undefined;
  /**
   * The output directory of the project. When `null` is used this value will be automatically detected
   */
  outputDirectory?: string | null | undefined;
  /**
   * Deprecated. Accepted for backwards compatibility but ignored.
   *
   * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
   */
  publicSource?: boolean | 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;
  /**
   * The region to deploy Serverless Functions in this project
   */
  serverlessFunctionRegion?: string | null | undefined;
  /**
   * Specifies whether Zero Config Failover is enabled for this project.
   */
  serverlessFunctionZeroConfigFailover?: boolean | undefined;
  /**
   * OpenID Connect JSON Web Token generation configuration.
   */
  oidcTokenConfig?: OidcTokenConfig | undefined;
  /**
   * Opt-in to skip deployments when there are no changes to the root directory and its dependencies
   */
  enableAffectedProjectsDeployments?: boolean | undefined;
  /**
   * Specifies resource override configuration for the project
   */
  resourceConfig?: CreateProjectResourceConfig | undefined;
};

export type CreateProjectRequest = {
  /**
   * The Team identifier to perform the request on behalf of.
   */
  teamId?: string | undefined;
  /**
   * The Team slug to perform the request on behalf of.
   */
  slug?: string | undefined;
  requestBody?: CreateProjectRequestBody | undefined;
};

export type Creator4 = {
  type: "system";
};

export type CreatorIntegration = {
  integrationId: string;
  configurationId: string;
};

export type Creator3 = {
  type: "integration";
  integration: CreatorIntegration;
};

export type CreatorApp = {
  /**
   * The internal ID of the Vercel App backing this principal.
   */
  id: string;
  /**
   * The protocol-facing OAuth client ID. This may differ from {@link id} when Client ID Metadata Documents (CIMD) are used.
   */
  clientId?: string | undefined;
};

export type Creator2 = {
  type: "app";
  app: CreatorApp;
};

export type ViaIntegration = {
  integrationId: string;
  configurationId: string;
};

/**
 * Set when a Vercel App or Integration acts on behalf of a {@link User}. Captures user-consented OAuth delegation that the ACL layer may inspect to evaluate scope restrictions. This is NOT for impersonation or token-exchange provenance — those live on `auth.token`, not on the principal.
 */
export type CreateProjectVia2 = {
  type: "integration";
  integration: ViaIntegration;
};

export type ViaApp = {
  /**
   * The internal ID of the Vercel App backing this principal.
   */
  id: string;
  /**
   * The protocol-facing OAuth client ID. This may differ from {@link id} when Client ID Metadata Documents (CIMD) are used.
   */
  clientId?: string | undefined;
};

/**
 * Set when a Vercel App or Integration acts on behalf of a {@link User}. Captures user-consented OAuth delegation that the ACL layer may inspect to evaluate scope restrictions. This is NOT for impersonation or token-exchange provenance — those live on `auth.token`, not on the principal.
 */
export type CreateProjectVia1 = {
  type: "app";
  app: ViaApp;
};

export type CreatorVia = CreateProjectVia1 | CreateProjectVia2;

export type CreatorUser = {
  id: string;
};

export type Creator1 = {
  type: "user";
  via: CreateProjectVia1 | CreateProjectVia2 | null;
  user: CreatorUser;
};

export type CreateProjectCreator = Creator1 | Creator2 | Creator3 | Creator4;

export const CreateProjectConfiguredBy = {
  A: "A",
  Cname: "CNAME",
  Dns01: "dns-01",
  Http: "http",
} as const;
export type CreateProjectConfiguredBy = ClosedEnum<
  typeof CreateProjectConfiguredBy
>;

export type CreateProjectProjectsAliasAssigned = number | boolean;

export type CreateProjectProjectsResponseAliasError = {
  code: string;
  message: string;
};

/**
 * The type of matching to perform
 */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType =
  {
    EndsWith: "endsWith",
    Equals: "equals",
    StartsWith: "startsWith",
  } as const;
/**
 * The type of matching to perform
 */
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType
  >;

export type CreateProjectProjectsResponse200BranchMatcher = {
  /**
   * The type of matching to perform
   */
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType;
  /**
   * The pattern to match against branch names
   */
  pattern: string;
};

export type CreateProjectProjectsResponseBuilds = {
  use: string;
  src?: string | undefined;
  dest?: string | undefined;
};

export const CreateProjectProjectsResponseChecksConclusion = {
  Canceled: "canceled",
  Failed: "failed",
  Skipped: "skipped",
  Succeeded: "succeeded",
} as const;
export type CreateProjectProjectsResponseChecksConclusion = ClosedEnum<
  typeof CreateProjectProjectsResponseChecksConclusion
>;

export const CreateProjectProjectsResponseChecksState = {
  Completed: "completed",
  Registered: "registered",
  Running: "running",
} as const;
export type CreateProjectProjectsResponseChecksState = ClosedEnum<
  typeof CreateProjectProjectsResponseChecksState
>;

export type CreateProjectProjectsResponse200Creator = {
  email: string;
  githubLogin?: string | undefined;
  gitlabLogin?: string | undefined;
  uid: string;
  username: string;
};

export type CreateProjectProjectsResponseOidcTokenClaims = {
  iss: string;
  sub: string;
  scope: string;
  aud: string;
  owner: string;
  ownerId: string;
  project: string;
  projectId: string;
  environment: string;
  customEnvironmentId?: string | undefined;
  mfeGroupIds?: Array<string> | undefined;
  plan?: string | undefined;
};

export const CreateProjectProjectsResponsePlan = {
  Enterprise: "enterprise",
  Hobby: "hobby",
  Pro: "pro",
} as const;
export type CreateProjectProjectsResponsePlan = ClosedEnum<
  typeof CreateProjectProjectsResponsePlan
>;

export const CreateProjectProjectsResponseReadyState = {
  Blocked: "BLOCKED",
  Building: "BUILDING",
  Canceled: "CANCELED",
  Error: "ERROR",
  Initializing: "INITIALIZING",
  Queued: "QUEUED",
  Ready: "READY",
} as const;
export type CreateProjectProjectsResponseReadyState = ClosedEnum<
  typeof CreateProjectProjectsResponseReadyState
>;

export const CreateProjectProjectsResponseReadySubstate = {
  Promoted: "PROMOTED",
  Rolling: "ROLLING",
  Staged: "STAGED",
} as const;
export type CreateProjectProjectsResponseReadySubstate = ClosedEnum<
  typeof CreateProjectProjectsResponseReadySubstate
>;

export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType =
  {
    Lambdas: "LAMBDAS",
  } as const;
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType
  >;

export type CreateProjectDeployment = {
  id: string;
  alias?: Array<string> | undefined;
  aliasAssigned?: number | boolean | null | undefined;
  aliasError?: CreateProjectProjectsResponseAliasError | null | undefined;
  aliasFinal?: string | null | undefined;
  automaticAliases?: Array<string> | undefined;
  branchMatcher?: CreateProjectProjectsResponse200BranchMatcher | undefined;
  buildingAt?: number | undefined;
  builds?: Array<CreateProjectProjectsResponseBuilds> | undefined;
  checksConclusion?: CreateProjectProjectsResponseChecksConclusion | undefined;
  checksState?: CreateProjectProjectsResponseChecksState | undefined;
  connectBuildsEnabled?: boolean | undefined;
  connectConfigurationId?: string | undefined;
  createdAt: number;
  createdIn: string;
  creator: CreateProjectProjectsResponse200Creator | null;
  deletedAt?: number | undefined;
  deploymentHostname: string;
  forced?: boolean | undefined;
  name: string;
  meta?: { [k: string]: string } | undefined;
  monorepoManager?: string | null | undefined;
  oidcTokenClaims?: CreateProjectProjectsResponseOidcTokenClaims | undefined;
  plan: CreateProjectProjectsResponsePlan;
  /**
   * Whether or not preview comments are enabled for the deployment
   */
  previewCommentsEnabled?: boolean | undefined;
  private: boolean;
  readyAt?: number | undefined;
  readyState: CreateProjectProjectsResponseReadyState;
  readySubstate?: CreateProjectProjectsResponseReadySubstate | undefined;
  requestedAt?: number | undefined;
  target?: string | null | undefined;
  teamId?: string | null | undefined;
  type: CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType;
  url: string;
  /**
   * Present for user creators; omitted for app/integration/system creators.
   */
  userId?: string | undefined;
  withCache?: boolean | undefined;
};

export const CreateProjectEnvironment = {
  Preview: "preview",
  Production: "production",
} as const;
export type CreateProjectEnvironment = ClosedEnum<
  typeof CreateProjectEnvironment
>;

export const CreateProjectProjectsTarget = {
  Preview: "PREVIEW",
  Production: "PRODUCTION",
  Staging: "STAGING",
} as const;
export type CreateProjectProjectsTarget = ClosedEnum<
  typeof CreateProjectProjectsTarget
>;

export type Alias = {
  configuredBy?: CreateProjectConfiguredBy | null | undefined;
  configuredChangedAt?: number | null | undefined;
  createdAt?: number | null | undefined;
  deployment: CreateProjectDeployment | null;
  domain: string;
  environment: CreateProjectEnvironment;
  gitBranch?: string | null | undefined;
  redirect?: string | null | undefined;
  redirectStatusCode?: number | null | undefined;
  target: CreateProjectProjectsTarget;
};

export type Analytics = {
  id: string;
  canceledAt?: number | null | undefined;
  disabledAt: number;
  enabledAt: number;
  paidAt?: number | undefined;
  sampleRatePercent?: number | null | undefined;
  spendLimitInDollars?: number | null | undefined;
};

export type SpeedInsights = {
  id: string;
  enabledAt?: number | undefined;
  disabledAt?: number | undefined;
  canceledAt?: number | undefined;
  hasData?: boolean | undefined;
  /**
   * When the first free (not Speed Insights Plus) production data point was observed, in ms. Set once by subscriber-analytics-events; projects that already had data before this field shipped get it backfilled on their next batch, so it reads "first free data point observed", not necessarily "first ever".
   */
  dataReceivedAt?: number | undefined;
  paidAt?: number | undefined;
};

export const CreateProjectEnvId2 = {
  Preview: "preview",
  Production: "production",
} as const;
export type CreateProjectEnvId2 = ClosedEnum<typeof CreateProjectEnvId2>;

export type CreateProjectEnvId = string | CreateProjectEnvId2;

export type CreateProjectAws = {
  subnetIds: Array<string>;
  securityGroupId?: string | undefined;
};

export type CreateProjectConnectConfigurations = {
  envId: string | CreateProjectEnvId2;
  connectConfigurationId: string;
  dc?: string | undefined;
  passive: boolean;
  buildsEnabled: boolean;
  aws?: CreateProjectAws | undefined;
  createdAt: number;
  updatedAt: number;
};

/**
 * The origin of this definition. 'api' means created via the API. Undefined means it originated from a deployment (vercel.json).
 */
export const CreateProjectSource = {
  Api: "api",
} as const;
/**
 * The origin of this definition. 'api' means created via the API. Undefined means it originated from a deployment (vercel.json).
 */
export type CreateProjectSource = ClosedEnum<typeof CreateProjectSource>;

export type Definitions = {
  /**
   * The hostname that should be used.
   */
  host: string;
  /**
   * The path that should be called for the cronjob.
   */
  path: string;
  /**
   * The cron expression.
   */
  schedule: string;
  /**
   * The origin of this definition. 'api' means created via the API. Undefined means it originated from a deployment (vercel.json).
   */
  source?: CreateProjectSource | undefined;
  /**
   * A human-readable description of what this cron job does.
   */
  description?: string | undefined;
  /**
   * Whether the host was inferred from the production deployment URL rather than explicitly provided.
   */
  hostInferred?: boolean | undefined;
};

export type CreateProjectCrons = {
  /**
   * The time the feature was enabled for this project. Note: It enables automatically with the first Deployment that outputs cronjobs.
   */
  enabledAt: number;
  /**
   * The time the feature was disabled for this project.
   */
  disabledAt: number | null;
  updatedAt: number;
  /**
   * The ID of the Deployment from which the definitions originated.
   */
  deploymentId: string | null;
  definitions: Array<Definitions>;
};

export type CreateProjectDataCache = {
  userDisabled: boolean;
  storageSizeBytes?: number | null | undefined;
  unlimited?: boolean | undefined;
};

/**
 * Retention policies for deployments. These are enforced at the project level, but we also maintain an instance of this at the team level as a default policy that gets applied to new projects.
 */
export type DeploymentExpiration = {
  /**
   * Number of days to keep non-production deployments (mostly preview deployments) before soft deletion.
   */
  expirationDays?: number | undefined;
  /**
   * Number of days to keep production deployments before soft deletion.
   */
  expirationDaysProduction?: number | undefined;
  /**
   * Number of days to keep canceled deployments before soft deletion.
   */
  expirationDaysCanceled?: number | undefined;
  /**
   * Number of days to keep errored deployments before soft deletion.
   */
  expirationDaysErrored?: number | undefined;
  /**
   * Minimum number of production deployments to keep for this project, even if they are over the production expiration limit.
   */
  deploymentsToKeep?: number | undefined;
};

export type Expiration2 = {
  /**
   * Unix ms timestamp when the project was locked.
   */
  lockedAt: number;
  /**
   * userId of the actor that triggered the lock (system or admin).
   */
  lockedBy: string;
};

export type Expiration1 = {
  /**
   * Unix ms timestamp when the project is scheduled to expire.
   */
  expiresAt: number;
};

export type CreateProjectExpiration = Expiration2 | Expiration1;

export const CreateProjectTarget2 = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
export type CreateProjectTarget2 = ClosedEnum<typeof CreateProjectTarget2>;

export const CreateProjectTarget1 = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
export type CreateProjectTarget1 = ClosedEnum<typeof CreateProjectTarget1>;

export type CreateProjectProjectsResponseTarget =
  | Array<CreateProjectTarget1>
  | CreateProjectTarget2;

export const CreateProjectProjectsResponseType = {
  Encrypted: "encrypted",
  Plain: "plain",
  Secret: "secret",
  Sensitive: "sensitive",
  System: "system",
} as const;
export type CreateProjectProjectsResponseType = ClosedEnum<
  typeof CreateProjectProjectsResponseType
>;

/**
 * User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
 */
export const CreateProjectVisibility = {
  Config: "config",
  Secret: "secret",
} as const;
/**
 * User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
 */
export type CreateProjectVisibility = ClosedEnum<
  typeof CreateProjectVisibility
>;

export type CreateProjectContentHint17 = {
  type: "flags-connection-string";
  projectId: string;
};

export type CreateProjectContentHint16 = {
  type: "integration-store-secret";
  storeId: string;
  integrationId: string;
  integrationProductId: string;
  integrationConfigurationId: string;
};

export type CreateProjectContentHint15 = {
  type: "postgres-url-no-ssl";
  storeId: string;
};

export type CreateProjectContentHint14 = {
  type: "postgres-database";
  storeId: string;
};

export type CreateProjectContentHint13 = {
  type: "postgres-password";
  storeId: string;
};

export type CreateProjectContentHint12 = {
  type: "postgres-host";
  storeId: string;
};

export type CreateProjectContentHint11 = {
  type: "postgres-user";
  storeId: string;
};

export type CreateProjectContentHint10 = {
  type: "postgres-prisma-url";
  storeId: string;
};

export type CreateProjectContentHint9 = {
  type: "postgres-url-non-pooling";
  storeId: string;
};

export type CreateProjectContentHint8 = {
  type: "postgres-url";
  storeId: string;
};

export type CreateProjectContentHint7 = {
  type: "blob-webhook-public-key";
  storeId: string;
};

export type CreateProjectContentHint6 = {
  type: "blob-store-id";
  storeId: string;
};

export type CreateProjectContentHint5 = {
  type: "blob-read-write-token";
  storeId: string;
};

export type CreateProjectContentHint4 = {
  type: "redis-rest-api-read-only-token";
  storeId: string;
};

export type CreateProjectContentHint3 = {
  type: "redis-rest-api-token";
  storeId: string;
};

export type CreateProjectContentHint2 = {
  type: "redis-rest-api-url";
  storeId: string;
};

export type CreateProjectContentHint1 = {
  type: "redis-url";
  storeId: string;
};

export type CreateProjectContentHint =
  | CreateProjectContentHint1
  | CreateProjectContentHint2
  | CreateProjectContentHint3
  | CreateProjectContentHint4
  | CreateProjectContentHint5
  | CreateProjectContentHint6
  | CreateProjectContentHint7
  | CreateProjectContentHint8
  | CreateProjectContentHint9
  | CreateProjectContentHint10
  | CreateProjectContentHint11
  | CreateProjectContentHint12
  | CreateProjectContentHint13
  | CreateProjectContentHint14
  | CreateProjectContentHint15
  | CreateProjectContentHint16
  | CreateProjectContentHint17;

export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType =
  {
    FlagsSecret: "flags-secret",
  } as const;
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType
  >;

/**
 * Similar to `contentHints`, but should not be exposed to the user.
 */
export type CreateProjectInternalContentHint = {
  type: CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType;
  /**
   * Contains the `value` of the env variable, encrypted with a special key to make decryption possible in the subscriber Lambda.
   */
  encryptedValue: string;
};

export type CreateProjectEnv = {
  target?: Array<CreateProjectTarget1> | CreateProjectTarget2 | undefined;
  type: CreateProjectProjectsResponseType;
  /**
   * This is used to identify variables that have been migrated from type secret to sensitive.
   */
  sunsetSecretId?: string | undefined;
  /**
   * Legacy now-encryption ciphertext, present after migration swaps value/vsmValue
   */
  legacyValue?: string | undefined;
  decrypted?: boolean | undefined;
  value: string;
  vsmValue?: string | undefined;
  id?: string | undefined;
  key: string;
  configurationId?: string | null | undefined;
  createdAt?: number | undefined;
  updatedAt?: number | undefined;
  createdBy?: string | null | undefined;
  updatedBy?: string | null | undefined;
  gitBranch?: string | undefined;
  /**
   * User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
   */
  visibility?: CreateProjectVisibility | undefined;
  edgeConfigId?: string | null | undefined;
  edgeConfigTokenId?: string | null | undefined;
  contentHint?:
    | CreateProjectContentHint1
    | CreateProjectContentHint2
    | CreateProjectContentHint3
    | CreateProjectContentHint4
    | CreateProjectContentHint5
    | CreateProjectContentHint6
    | CreateProjectContentHint7
    | CreateProjectContentHint8
    | CreateProjectContentHint9
    | CreateProjectContentHint10
    | CreateProjectContentHint11
    | CreateProjectContentHint12
    | CreateProjectContentHint13
    | CreateProjectContentHint14
    | CreateProjectContentHint15
    | CreateProjectContentHint16
    | CreateProjectContentHint17
    | null
    | undefined;
  /**
   * Similar to `contentHints`, but should not be exposed to the user.
   */
  internalContentHint?: CreateProjectInternalContentHint | null | undefined;
  comment?: string | undefined;
  customEnvironmentIds?: Array<string> | undefined;
};

/**
 * The type of environment (production, preview, or development)
 */
export const CreateProjectProjectsResponse200Type = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
/**
 * The type of environment (production, preview, or development)
 */
export type CreateProjectProjectsResponse200Type = ClosedEnum<
  typeof CreateProjectProjectsResponse200Type
>;

/**
 * The type of matching to perform
 */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType =
  {
    EndsWith: "endsWith",
    Equals: "equals",
    StartsWith: "startsWith",
  } as const;
/**
 * The type of matching to perform
 */
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType
  >;

/**
 * Configuration for matching git branches to this environment
 */
export type CreateProjectBranchMatcher = {
  /**
   * The type of matching to perform
   */
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType;
  /**
   * The pattern to match against branch names
   */
  pattern: string;
};

/**
 * A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete `POST /projects/:idOrName/domains/:domain/verify` to verify the domain. Possible challenges: - If `verification.type = TXT` the `verification.domain` will be checked for a TXT record matching `verification.value`.
 */
export type CreateProjectVerification = {
  type: string;
  domain: string;
  value: string;
  reason: string;
};

/**
 * List of domains associated with this environment
 */
export type CreateProjectDomains = {
  name: string;
  apexName: string;
  projectId: string;
  redirect?: string | null | undefined;
  redirectStatusCode?: number | null | undefined;
  gitBranch?: string | null | undefined;
  customEnvironmentId?: string | null | undefined;
  updatedAt?: number | undefined;
  createdAt?: number | undefined;
  /**
   * `true` if the domain is verified for use with the project. If `false` it will not be used as an alias on this project until the challenge in `verification` is completed.
   */
  verified: boolean;
  /**
   * A list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete `POST /projects/:idOrName/domains/:domain/verify` to verify the domain. Possible challenges: - If `verification.type = TXT` the `verification.domain` will be checked for a TXT record matching `verification.value`.
   */
  verification?: Array<CreateProjectVerification> | undefined;
};

/**
 * Internal representation of a custom environment with all required properties
 */
export type CreateProjectCustomEnvironments = {
  /**
   * Unique identifier for the custom environment (format: env_*)
   */
  id: string;
  /**
   * URL-friendly name of the environment
   */
  slug: string;
  /**
   * The type of environment (production, preview, or development)
   */
  type: CreateProjectProjectsResponse200Type;
  /**
   * Optional description of the environment's purpose
   */
  description?: string | undefined;
  /**
   * Configuration for matching git branches to this environment
   */
  branchMatcher?: CreateProjectBranchMatcher | undefined;
  /**
   * List of domains associated with this environment
   */
  domains?: Array<CreateProjectDomains> | undefined;
  /**
   * List of aliases for the current deployment
   */
  currentDeploymentAliases?: Array<string> | undefined;
  /**
   * Timestamp when the environment was created
   */
  createdAt: number;
  /**
   * Timestamp when the environment was last updated
   */
  updatedAt: number;
};

export const CreateProjectProjectsFramework = {
  ActixWeb: "actix-web",
  Angular: "angular",
  Ash: "ash",
  Astro: "astro",
  Axum: "axum",
  Blitzjs: "blitzjs",
  Brunch: "brunch",
  Bun: "bun",
  Container: "container",
  CreateReactApp: "create-react-app",
  Django: "django",
  Docusaurus: "docusaurus",
  Docusaurus2: "docusaurus-2",
  Dojo: "dojo",
  Eleventy: "eleventy",
  Elysia: "elysia",
  Ember: "ember",
  Eve: "eve",
  Express: "express",
  FactoryEve: "factory-eve",
  Fastapi: "fastapi",
  Fasthtml: "fasthtml",
  Fastify: "fastify",
  Flask: "flask",
  Gatsby: "gatsby",
  Go: "go",
  Gridsome: "gridsome",
  H3: "h3",
  Hexo: "hexo",
  Hono: "hono",
  Hugo: "hugo",
  Hydrogen: "hydrogen",
  IonicAngular: "ionic-angular",
  IonicReact: "ionic-react",
  Jekyll: "jekyll",
  Koa: "koa",
  Mastra: "mastra",
  Middleman: "middleman",
  Nestjs: "nestjs",
  Nextjs: "nextjs",
  Nitro: "nitro",
  Node: "node",
  Nuxtjs: "nuxtjs",
  Parcel: "parcel",
  Polymer: "polymer",
  Preact: "preact",
  Python: "python",
  ReactRouter: "react-router",
  Redwoodjs: "redwoodjs",
  Remix: "remix",
  Ruby: "ruby",
  Rust: "rust",
  Saber: "saber",
  Sanity: "sanity",
  SanityV2: "sanity-v2",
  Sapper: "sapper",
  Scully: "scully",
  Services: "services",
  Solidstart: "solidstart",
  Solidstart1: "solidstart-1",
  Stencil: "stencil",
  Storybook: "storybook",
  Svelte: "svelte",
  Sveltekit: "sveltekit",
  Sveltekit1: "sveltekit-1",
  TanstackStart: "tanstack-start",
  TanstackStartLovable: "tanstack-start-lovable",
  Umijs: "umijs",
  Vite: "vite",
  Vitepress: "vitepress",
  Vue: "vue",
  Vuepress: "vuepress",
  Xmcp: "xmcp",
  Zola: "zola",
} as const;
export type CreateProjectProjectsFramework = ClosedEnum<
  typeof CreateProjectProjectsFramework
>;

/**
 * Service kind (Service.type). Omitted for schemas that do not define one.
 */
export const CreateProjectServiceType = {
  Cron: "cron",
  Job: "job",
  Web: "web",
  Worker: "worker",
} as const;
/**
 * Service kind (Service.type). Omitted for schemas that do not define one.
 */
export type CreateProjectServiceType = ClosedEnum<
  typeof CreateProjectServiceType
>;

/**
 * Framework slug, when the service has one (omitted otherwise).
 */
export const CreateProjectProjectsResponseFramework = {
  ActixWeb: "actix-web",
  Angular: "angular",
  Ash: "ash",
  Astro: "astro",
  Axum: "axum",
  Blitzjs: "blitzjs",
  Brunch: "brunch",
  Bun: "bun",
  Container: "container",
  CreateReactApp: "create-react-app",
  Django: "django",
  Docusaurus: "docusaurus",
  Docusaurus2: "docusaurus-2",
  Dojo: "dojo",
  Eleventy: "eleventy",
  Elysia: "elysia",
  Ember: "ember",
  Eve: "eve",
  Express: "express",
  FactoryEve: "factory-eve",
  Fastapi: "fastapi",
  Fasthtml: "fasthtml",
  Fastify: "fastify",
  Flask: "flask",
  Gatsby: "gatsby",
  Go: "go",
  Gridsome: "gridsome",
  H3: "h3",
  Hexo: "hexo",
  Hono: "hono",
  Hugo: "hugo",
  Hydrogen: "hydrogen",
  IonicAngular: "ionic-angular",
  IonicReact: "ionic-react",
  Jekyll: "jekyll",
  Koa: "koa",
  Mastra: "mastra",
  Middleman: "middleman",
  Nestjs: "nestjs",
  Nextjs: "nextjs",
  Nitro: "nitro",
  Node: "node",
  Nuxtjs: "nuxtjs",
  Parcel: "parcel",
  Polymer: "polymer",
  Preact: "preact",
  Python: "python",
  ReactRouter: "react-router",
  Redwoodjs: "redwoodjs",
  Remix: "remix",
  Ruby: "ruby",
  Rust: "rust",
  Saber: "saber",
  Sanity: "sanity",
  SanityV2: "sanity-v2",
  Sapper: "sapper",
  Scully: "scully",
  Services: "services",
  Solidstart: "solidstart",
  Solidstart1: "solidstart-1",
  Stencil: "stencil",
  Storybook: "storybook",
  Svelte: "svelte",
  Sveltekit: "sveltekit",
  Sveltekit1: "sveltekit-1",
  TanstackStart: "tanstack-start",
  TanstackStartLovable: "tanstack-start-lovable",
  Umijs: "umijs",
  Vite: "vite",
  Vitepress: "vitepress",
  Vue: "vue",
  Vuepress: "vuepress",
  Xmcp: "xmcp",
  Zola: "zola",
} as const;
/**
 * Framework slug, when the service has one (omitted otherwise).
 */
export type CreateProjectProjectsResponseFramework = ClosedEnum<
  typeof CreateProjectProjectsResponseFramework
>;

export type CreateProjectServices = {
  /**
   * Service name from the deployment (Service.name).
   */
  serviceName: string;
  /**
   * Service kind (Service.type). Omitted for schemas that do not define one.
   */
  serviceType?: CreateProjectServiceType | undefined;
  /**
   * Framework slug, when the service has one (omitted otherwise).
   */
  framework?: CreateProjectProjectsResponseFramework | undefined;
  /**
   * Generic runtime, e.g. 'node' | 'python' | 'go' | 'ruby' | 'rust' (Service.runtime). Omitted for static builds.
   */
  runtime?: string | undefined;
};

export type CreateProjectIpBuckets = {
  bucket: string;
  default?: boolean | undefined;
  supportUntil?: number | undefined;
};

export type CreateProjectLint = {
  targets: Array<string>;
};

export type CreateProjectTypecheck = {
  targets: Array<string>;
};

export type CreateProjectMfeConfigPresent = {
  targets: Array<string>;
};

export type Jobs = {
  lint?: CreateProjectLint | undefined;
  typecheck?: CreateProjectTypecheck | undefined;
  mfeConfigPresent?: CreateProjectMfeConfigPresent | undefined;
};

export type AliasAssigned = number | boolean;

export type CreateProjectAliasError = {
  code: string;
  message: string;
};

/**
 * The type of matching to perform
 */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType =
  {
    EndsWith: "endsWith",
    Equals: "equals",
    StartsWith: "startsWith",
  } as const;
/**
 * The type of matching to perform
 */
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType
  >;

export type CreateProjectProjectsBranchMatcher = {
  /**
   * The type of matching to perform
   */
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType;
  /**
   * The pattern to match against branch names
   */
  pattern: string;
};

export type CreateProjectBuilds = {
  use: string;
  src?: string | undefined;
  dest?: string | undefined;
};

export const CreateProjectChecksConclusion = {
  Canceled: "canceled",
  Failed: "failed",
  Skipped: "skipped",
  Succeeded: "succeeded",
} as const;
export type CreateProjectChecksConclusion = ClosedEnum<
  typeof CreateProjectChecksConclusion
>;

export const CreateProjectChecksState = {
  Completed: "completed",
  Registered: "registered",
  Running: "running",
} as const;
export type CreateProjectChecksState = ClosedEnum<
  typeof CreateProjectChecksState
>;

export type CreateProjectProjectsCreator = {
  email: string;
  githubLogin?: string | undefined;
  gitlabLogin?: string | undefined;
  uid: string;
  username: string;
};

export type CreateProjectOidcTokenClaims = {
  iss: string;
  sub: string;
  scope: string;
  aud: string;
  owner: string;
  ownerId: string;
  project: string;
  projectId: string;
  environment: string;
  customEnvironmentId?: string | undefined;
  mfeGroupIds?: Array<string> | undefined;
  plan?: string | undefined;
};

export const CreateProjectPlan = {
  Enterprise: "enterprise",
  Hobby: "hobby",
  Pro: "pro",
} as const;
export type CreateProjectPlan = ClosedEnum<typeof CreateProjectPlan>;

export const CreateProjectReadyState = {
  Blocked: "BLOCKED",
  Building: "BUILDING",
  Canceled: "CANCELED",
  Error: "ERROR",
  Initializing: "INITIALIZING",
  Queued: "QUEUED",
  Ready: "READY",
} as const;
export type CreateProjectReadyState = ClosedEnum<
  typeof CreateProjectReadyState
>;

export const CreateProjectReadySubstate = {
  Promoted: "PROMOTED",
  Rolling: "ROLLING",
  Staged: "STAGED",
} as const;
export type CreateProjectReadySubstate = ClosedEnum<
  typeof CreateProjectReadySubstate
>;

export const CreateProjectProjectsResponse200ApplicationJSONType = {
  Lambdas: "LAMBDAS",
} as const;
export type CreateProjectProjectsResponse200ApplicationJSONType = ClosedEnum<
  typeof CreateProjectProjectsResponse200ApplicationJSONType
>;

export type LatestDeployments = {
  id: string;
  alias?: Array<string> | undefined;
  aliasAssigned?: number | boolean | null | undefined;
  aliasError?: CreateProjectAliasError | null | undefined;
  aliasFinal?: string | null | undefined;
  automaticAliases?: Array<string> | undefined;
  branchMatcher?: CreateProjectProjectsBranchMatcher | undefined;
  buildingAt?: number | undefined;
  builds?: Array<CreateProjectBuilds> | undefined;
  checksConclusion?: CreateProjectChecksConclusion | undefined;
  checksState?: CreateProjectChecksState | undefined;
  connectBuildsEnabled?: boolean | undefined;
  connectConfigurationId?: string | undefined;
  createdAt: number;
  createdIn: string;
  creator: CreateProjectProjectsCreator | null;
  deletedAt?: number | undefined;
  deploymentHostname: string;
  forced?: boolean | undefined;
  name: string;
  meta?: { [k: string]: string } | undefined;
  monorepoManager?: string | null | undefined;
  oidcTokenClaims?: CreateProjectOidcTokenClaims | undefined;
  plan: CreateProjectPlan;
  /**
   * Whether or not preview comments are enabled for the deployment
   */
  previewCommentsEnabled?: boolean | undefined;
  private: boolean;
  readyAt?: number | undefined;
  readyState: CreateProjectReadyState;
  readySubstate?: CreateProjectReadySubstate | undefined;
  requestedAt?: number | undefined;
  target?: string | null | undefined;
  teamId?: string | null | undefined;
  type: CreateProjectProjectsResponse200ApplicationJSONType;
  url: string;
  /**
   * Present for user creators; omitted for app/integration/system creators.
   */
  userId?: string | undefined;
  withCache?: boolean | undefined;
};

export type CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks =
  {
    createdAt?: number | undefined;
    id: string;
    name: string;
    ref: string;
    url: string;
  };

export type Link8 = {
  /**
   * Owner (namespace) slug, e.g. `acme`.
   */
  owner: string;
  repo: string;
  /**
   * Origin repository id.
   */
  repoId: string;
  /**
   * Origin namespace id (`ns_…`) of the owner.
   */
  ownerId: string;
  type: "cursor-origin";
  createdAt?: number | undefined;
  deployHooks: Array<
    CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks
  >;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link7 = {
  org: string;
  repo: string;
  repoId: string;
  type: "v0";
  createdAt?: number | undefined;
  deployHooks: Array<
    CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks
  >;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type CreateProjectLinkProjectsResponse200DeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link6 = {
  org: string;
  repo: string;
  repoId: string;
  type: "vercel";
  createdAt?: number | undefined;
  deployHooks: Array<CreateProjectLinkProjectsResponse200DeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type CreateProjectLinkProjectsResponseDeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link5 = {
  name: string;
  slug: string;
  owner: string;
  type: "bitbucket";
  uuid: string;
  workspaceUuid: string;
  createdAt?: number | undefined;
  deployHooks: Array<CreateProjectLinkProjectsResponseDeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type CreateProjectLinkProjectsDeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link4 = {
  projectId: string;
  projectName: string;
  projectNameWithNamespace: string;
  projectNamespace: string;
  /**
   * A new field, should be included in all new project links, is being added just in time when a deployment is created. This is needed for Protected Git scopes. This is the id of the top level group that a namespace belongs to. Gitlab supports group nesting (up to 20 levels).
   */
  projectOwnerId?: number | undefined;
  projectUrl: string;
  type: "gitlab";
  createdAt?: number | undefined;
  deployHooks: Array<CreateProjectLinkProjectsDeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type CreateProjectLinkDeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link3 = {
  org: string;
  /**
   * A new field, should be included in all new project links, is being added just in time when a deployment is created. This is needed for Protected Git scopes.
   */
  repoOwnerId?: number | undefined;
  repo?: string | undefined;
  repoId?: number | undefined;
  type: "github-custom-host";
  host: string;
  createdAt?: number | undefined;
  deployHooks: Array<CreateProjectLinkDeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type LinkDeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link2 = {
  type: "github-limited";
  repo?: string | undefined;
  repoId?: number | undefined;
  createdAt?: number | undefined;
  updatedAt?: number | undefined;
  org: string;
  /**
   * A new field, should be included in all new project links, is being added just in time when a deployment is created. This is needed for Protected Git scopes.
   */
  repoOwnerId?: number | undefined;
  deployHooks: Array<LinkDeployHooks>;
  gitCredentialId: string;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type DeployHooks = {
  createdAt?: number | undefined;
  id: string;
  name: string;
  ref: string;
  url: string;
};

export type Link1 = {
  org: string;
  /**
   * A new field, should be included in all new project links, is being added just in time when a deployment is created. This is needed for Protected Git scopes.
   */
  repoOwnerId?: number | undefined;
  repo?: string | undefined;
  repoId?: number | undefined;
  type: "github";
  createdAt?: number | undefined;
  deployHooks: Array<DeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type Link =
  | Link1
  | Link2
  | Link3
  | Link4
  | Link5
  | Link6
  | Link7
  | Link8;

export type Blobs = {
  /**
   * Marks the team-level, Vercel-managed default blob project (`vercel-blob-default-project`) that orphan blob stores are scoped to when connected without an explicit project. Set only by internal storage flows and immutable after creation — guards rely on it to protect the connected stores from being lost when the project is deleted or transferred.
   */
  isDefaultApp?: boolean | undefined;
};

export type CreateProjectMicrofrontends3 = {
  updatedAt: number;
  groupIds: Array<any>;
  enabled: false;
  freeProjectForLegacyLimits?: boolean | undefined;
};

export type CreateProjectMicrofrontends2 = {
  isDefaultApp?: false | undefined;
  /**
   * Whether observability data should be routed to this microfrontend project or a root project.
   */
  routeObservabilityToThisProject?: boolean | undefined;
  /**
   * Whether to add microfrontends routing to aliases. This means domains in this project will route as a microfrontend.
   */
  doNotRouteWithMicrofrontendsRouting?: boolean | undefined;
  /**
   * Timestamp when the microfrontends settings were last updated.
   */
  updatedAt: number;
  /**
   * The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
   */
  groupIds: Array<string>;
  /**
   * Whether microfrontends are enabled for this project.
   */
  enabled: true;
  /**
   * A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
   */
  defaultRoute?: string | undefined;
  /**
   * Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
   */
  freeProjectForLegacyLimits?: boolean | undefined;
};

export type CreateProjectMicrofrontends1 = {
  isDefaultApp: true;
  /**
   * Timestamp when the microfrontends settings were last updated.
   */
  updatedAt: number;
  /**
   * The group IDs of microfrontends that this project belongs to. Each microfrontend project must belong to a microfrontends group that is the set of microfrontends that are used together.
   */
  groupIds: Array<string>;
  /**
   * Whether microfrontends are enabled for this project.
   */
  enabled: true;
  /**
   * A path that is used to take screenshots and as the default path in preview links when a domain for this microfrontend is shown in the UI. Includes the leading slash, e.g. `/docs`
   */
  defaultRoute?: string | undefined;
  /**
   * Whether the project was part of the legacy limits for hobby and pro-trial before billing was added. This field is only set when the team is upgraded to a paid plan and we are backfilling the subscription status. We cap the subscription to 2 projects and set this field for the 3rd project. When this field is set, the project is not charged for and we do not call any billing APIs for this project.
   */
  freeProjectForLegacyLimits?: boolean | undefined;
};

export type CreateProjectMicrofrontends =
  | CreateProjectMicrofrontends1
  | CreateProjectMicrofrontends2
  | CreateProjectMicrofrontends3;

export const CreateProjectNodeVersion = {
  TenDotX: "10.x",
  TwelveDotX: "12.x",
  FourteenDotX: "14.x",
  SixteenDotX: "16.x",
  EighteenDotX: "18.x",
  TwentyDotX: "20.x",
  TwentyTwoDotX: "22.x",
  TwentyFourDotX: "24.x",
  EightDot10DotX: "8.10.x",
} as const;
export type CreateProjectNodeVersion = ClosedEnum<
  typeof CreateProjectNodeVersion
>;

export type CreateProjectPaths = {
  value: string;
};

export type CreateProjectOptionsAllowlist = {
  paths: Array<CreateProjectPaths>;
};

export type CreateProjectPasswordProtection = {};

/** @internal */
export const Target2$outboundSchema: z.ZodNativeEnum<typeof Target2> = z
  .nativeEnum(Target2);

/** @internal */
export const Target1$outboundSchema: z.ZodNativeEnum<typeof Target1> = z
  .nativeEnum(Target1);

/** @internal */
export type CreateProjectTarget$Outbound = string | Array<string>;

/** @internal */
export const CreateProjectTarget$outboundSchema: z.ZodType<
  CreateProjectTarget$Outbound,
  z.ZodTypeDef,
  CreateProjectTarget
> = smartUnion([Target1$outboundSchema, z.array(Target2$outboundSchema)]);

export function createProjectTargetToJSON(
  createProjectTarget: CreateProjectTarget,
): string {
  return JSON.stringify(
    CreateProjectTarget$outboundSchema.parse(createProjectTarget),
  );
}

/** @internal */
export const CreateProjectType$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectType
> = z.nativeEnum(CreateProjectType);

/** @internal */
export type EnvironmentVariables$Outbound = {
  key: string;
  target: string | Array<string>;
  gitBranch?: string | undefined;
  type?: string | undefined;
  value: string;
};

/** @internal */
export const EnvironmentVariables$outboundSchema: z.ZodType<
  EnvironmentVariables$Outbound,
  z.ZodTypeDef,
  EnvironmentVariables
> = z.object({
  key: z.string(),
  target: smartUnion([Target1$outboundSchema, z.array(Target2$outboundSchema)]),
  gitBranch: z.string().optional(),
  type: CreateProjectType$outboundSchema.optional(),
  value: z.string(),
});

export function environmentVariablesToJSON(
  environmentVariables: EnvironmentVariables,
): string {
  return JSON.stringify(
    EnvironmentVariables$outboundSchema.parse(environmentVariables),
  );
}

/** @internal */
export const CreateProjectFramework$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectFramework
> = z.nativeEnum(CreateProjectFramework);

/** @internal */
export const CreateProjectProjectsType$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectProjectsType
> = z.nativeEnum(CreateProjectProjectsType);

/** @internal */
export type GitRepository$Outbound = {
  repo: string;
  type: string;
};

/** @internal */
export const GitRepository$outboundSchema: z.ZodType<
  GitRepository$Outbound,
  z.ZodTypeDef,
  GitRepository
> = z.object({
  repo: z.string(),
  type: CreateProjectProjectsType$outboundSchema,
});

export function gitRepositoryToJSON(gitRepository: GitRepository): string {
  return JSON.stringify(GitRepository$outboundSchema.parse(gitRepository));
}

/** @internal */
export const CreateProjectDeploymentType$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectDeploymentType
> = z.nativeEnum(CreateProjectDeploymentType);

/** @internal */
export type CreateProjectSsoProtection$Outbound = {
  deploymentType: string;
};

/** @internal */
export const CreateProjectSsoProtection$outboundSchema: z.ZodType<
  CreateProjectSsoProtection$Outbound,
  z.ZodTypeDef,
  CreateProjectSsoProtection
> = z.object({
  deploymentType: CreateProjectDeploymentType$outboundSchema,
});

export function createProjectSsoProtectionToJSON(
  createProjectSsoProtection: CreateProjectSsoProtection,
): string {
  return JSON.stringify(
    CreateProjectSsoProtection$outboundSchema.parse(createProjectSsoProtection),
  );
}

/** @internal */
export const Region$outboundSchema: z.ZodNativeEnum<typeof Region> = z
  .nativeEnum(Region);

/** @internal */
export const CreateProjectFailoverRegions$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectFailoverRegions
> = z.nativeEnum(CreateProjectFailoverRegions);

/** @internal */
export type Sandbox$Outbound = {
  region?: string | undefined;
  failoverRegions?: Array<string> | undefined;
};

/** @internal */
export const Sandbox$outboundSchema: z.ZodType<
  Sandbox$Outbound,
  z.ZodTypeDef,
  Sandbox
> = z.object({
  region: Region$outboundSchema.optional(),
  failoverRegions: z.array(CreateProjectFailoverRegions$outboundSchema)
    .optional(),
});

export function sandboxToJSON(sandbox: Sandbox): string {
  return JSON.stringify(Sandbox$outboundSchema.parse(sandbox));
}

/** @internal */
export const CreateProjectIssuerMode$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectIssuerMode
> = z.nativeEnum(CreateProjectIssuerMode);

/** @internal */
export type OidcTokenConfig$Outbound = {
  enabled: boolean;
  issuerMode: string;
};

/** @internal */
export const OidcTokenConfig$outboundSchema: z.ZodType<
  OidcTokenConfig$Outbound,
  z.ZodTypeDef,
  OidcTokenConfig
> = z.object({
  enabled: z.boolean().default(true),
  issuerMode: CreateProjectIssuerMode$outboundSchema.default("team"),
});

export function oidcTokenConfigToJSON(
  oidcTokenConfig: OidcTokenConfig,
): string {
  return JSON.stringify(OidcTokenConfig$outboundSchema.parse(oidcTokenConfig));
}

/** @internal */
export const BuildMachineType$outboundSchema: z.ZodNativeEnum<
  typeof BuildMachineType
> = z.nativeEnum(BuildMachineType);

/** @internal */
export const FunctionDefaultMemoryType$outboundSchema: z.ZodNativeEnum<
  typeof FunctionDefaultMemoryType
> = z.nativeEnum(FunctionDefaultMemoryType);

/** @internal */
export const BuildMachineSelection$outboundSchema: z.ZodNativeEnum<
  typeof BuildMachineSelection
> = z.nativeEnum(BuildMachineSelection);

/** @internal */
export const BuildMachineElasticReason$outboundSchema: z.ZodNativeEnum<
  typeof BuildMachineElasticReason
> = z.nativeEnum(BuildMachineElasticReason);

/** @internal */
export const CreateProjectConfiguration$outboundSchema: z.ZodNativeEnum<
  typeof CreateProjectConfiguration
> = z.nativeEnum(CreateProjectConfiguration);

/** @internal */
export type CreateProjectBuildQueue$Outbound = {
  configuration?: string | undefined;
};

/** @internal */
export const CreateProjectBuildQueue$outboundSchema: z.ZodType<
  CreateProjectBuildQueue$Outbound,
  z.ZodTypeDef,
  CreateProjectBuildQueue
> = z.object({
  configuration: CreateProjectConfiguration$outboundSchema.optional(),
});

export function createProjectBuildQueueToJSON(
  createProjectBuildQueue: CreateProjectBuildQueue,
): string {
  return JSON.stringify(
    CreateProjectBuildQueue$outboundSchema.parse(createProjectBuildQueue),
  );
}

/** @internal */
export type CreateProjectResourceConfig$Outbound = {
  buildMachineType?: string | undefined;
  fluid?: boolean | undefined;
  functionDefaultRegions?: Array<string> | undefined;
  functionDefaultTimeout?: number | undefined;
  functionDefaultMemoryType?: string | undefined;
  functionZeroConfigFailover?: boolean | undefined;
  elasticConcurrencyEnabled?: boolean | undefined;
  buildMachineSelection?: string | undefined;
  buildMachineElasticLastUpdated?: number | undefined;
  buildMachineElasticReason?: string | undefined;
  isNSNBDisabled?: boolean | undefined;
  buildQueue?: CreateProjectBuildQueue$Outbound | undefined;
  enableFunctionsBeta?: boolean | undefined;
};

/** @internal */
export const CreateProjectResourceConfig$outboundSchema: z.ZodType<
  CreateProjectResourceConfig$Outbound,
  z.ZodTypeDef,
  CreateProjectResourceConfig
> = z.object({
  buildMachineType: BuildMachineType$outboundSchema.optional(),
  fluid: z.boolean().optional(),
  functionDefaultRegions: z.array(z.string()).optional(),
  functionDefaultTimeout: z.number().optional(),
  functionDefaultMemoryType: FunctionDefaultMemoryType$outboundSchema
    .optional(),
  functionZeroConfigFailover: z.boolean().optional(),
  elasticConcurrencyEnabled: z.boolean().optional(),
  buildMachineSelection: BuildMachineSelection$outboundSchema.optional(),
  buildMachineElasticLastUpdated: z.number().optional(),
  buildMachineElasticReason: BuildMachineElasticReason$outboundSchema
    .optional(),
  isNSNBDisabled: z.boolean().optional(),
  buildQueue: z.lazy(() => CreateProjectBuildQueue$outboundSchema).optional(),
  enableFunctionsBeta: z.boolean().optional(),
});

export function createProjectResourceConfigToJSON(
  createProjectResourceConfig: CreateProjectResourceConfig,
): string {
  return JSON.stringify(
    CreateProjectResourceConfig$outboundSchema.parse(
      createProjectResourceConfig,
    ),
  );
}

/** @internal */
export type CreateProjectRequestBody$Outbound = {
  enablePreviewFeedback?: boolean | null | undefined;
  enableProductionFeedback?: boolean | null | undefined;
  previewDeploymentsDisabled?: boolean | null | undefined;
  previewDeploymentSuffix?: string | null | undefined;
  buildCommand?: string | null | undefined;
  commandForIgnoringBuildStep?: string | null | undefined;
  devCommand?: string | null | undefined;
  environmentVariables?: Array<EnvironmentVariables$Outbound> | undefined;
  framework?: string | undefined;
  gitRepository?: GitRepository$Outbound | undefined;
  installCommand?: string | null | undefined;
  name: string;
  skipGitConnectDuringLink?: boolean | undefined;
  ssoProtection?: CreateProjectSsoProtection$Outbound | null | undefined;
  sandbox?: Sandbox$Outbound | undefined;
  outputDirectory?: string | null | undefined;
  publicSource?: boolean | null | undefined;
  rootDirectory?: string | null | undefined;
  serverlessFunctionRegion?: string | null | undefined;
  serverlessFunctionZeroConfigFailover?: boolean | undefined;
  oidcTokenConfig?: OidcTokenConfig$Outbound | undefined;
  enableAffectedProjectsDeployments?: boolean | undefined;
  resourceConfig?: CreateProjectResourceConfig$Outbound | undefined;
};

/** @internal */
export const CreateProjectRequestBody$outboundSchema: z.ZodType<
  CreateProjectRequestBody$Outbound,
  z.ZodTypeDef,
  CreateProjectRequestBody
> = z.object({
  enablePreviewFeedback: z.nullable(z.boolean()).optional(),
  enableProductionFeedback: z.nullable(z.boolean()).optional(),
  previewDeploymentsDisabled: z.nullable(z.boolean()).optional(),
  previewDeploymentSuffix: z.nullable(z.string()).optional(),
  buildCommand: z.nullable(z.string()).optional(),
  commandForIgnoringBuildStep: z.nullable(z.string()).optional(),
  devCommand: z.nullable(z.string()).optional(),
  environmentVariables: z.array(
    z.lazy(() => EnvironmentVariables$outboundSchema),
  ).optional(),
  framework: CreateProjectFramework$outboundSchema.optional(),
  gitRepository: z.lazy(() => GitRepository$outboundSchema).optional(),
  installCommand: z.nullable(z.string()).optional(),
  name: z.string(),
  skipGitConnectDuringLink: z.boolean().optional(),
  ssoProtection: z.nullable(
    z.lazy(() => CreateProjectSsoProtection$outboundSchema),
  ).optional(),
  sandbox: z.lazy(() => Sandbox$outboundSchema).optional(),
  outputDirectory: z.nullable(z.string()).optional(),
  publicSource: z.nullable(z.boolean()).optional(),
  rootDirectory: z.nullable(z.string()).optional(),
  serverlessFunctionRegion: z.nullable(z.string()).optional(),
  serverlessFunctionZeroConfigFailover: z.boolean().optional(),
  oidcTokenConfig: z.lazy(() => OidcTokenConfig$outboundSchema).optional(),
  enableAffectedProjectsDeployments: z.boolean().optional(),
  resourceConfig: z.lazy(() => CreateProjectResourceConfig$outboundSchema)
    .optional(),
});

export function createProjectRequestBodyToJSON(
  createProjectRequestBody: CreateProjectRequestBody,
): string {
  return JSON.stringify(
    CreateProjectRequestBody$outboundSchema.parse(createProjectRequestBody),
  );
}

/** @internal */
export type CreateProjectRequest$Outbound = {
  teamId?: string | undefined;
  slug?: string | undefined;
  RequestBody?: CreateProjectRequestBody$Outbound | undefined;
};

/** @internal */
export const CreateProjectRequest$outboundSchema: z.ZodType<
  CreateProjectRequest$Outbound,
  z.ZodTypeDef,
  CreateProjectRequest
> = z.object({
  teamId: z.string().optional(),
  slug: z.string().optional(),
  requestBody: z.lazy(() => CreateProjectRequestBody$outboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    requestBody: "RequestBody",
  });
});

export function createProjectRequestToJSON(
  createProjectRequest: CreateProjectRequest,
): string {
  return JSON.stringify(
    CreateProjectRequest$outboundSchema.parse(createProjectRequest),
  );
}

/** @internal */
export const Creator4$inboundSchema: z.ZodType<
  Creator4,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("system"),
});

export function creator4FromJSON(
  jsonString: string,
): SafeParseResult<Creator4, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Creator4$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Creator4' from JSON`,
  );
}

/** @internal */
export const CreatorIntegration$inboundSchema: z.ZodType<
  CreatorIntegration,
  z.ZodTypeDef,
  unknown
> = z.object({
  integrationId: types.string(),
  configurationId: types.string(),
});

export function creatorIntegrationFromJSON(
  jsonString: string,
): SafeParseResult<CreatorIntegration, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreatorIntegration$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreatorIntegration' from JSON`,
  );
}

/** @internal */
export const Creator3$inboundSchema: z.ZodType<
  Creator3,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("integration"),
  integration: z.lazy(() => CreatorIntegration$inboundSchema),
});

export function creator3FromJSON(
  jsonString: string,
): SafeParseResult<Creator3, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Creator3$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Creator3' from JSON`,
  );
}

/** @internal */
export const CreatorApp$inboundSchema: z.ZodType<
  CreatorApp,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  clientId: types.optional(types.string()),
});

export function creatorAppFromJSON(
  jsonString: string,
): SafeParseResult<CreatorApp, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreatorApp$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreatorApp' from JSON`,
  );
}

/** @internal */
export const Creator2$inboundSchema: z.ZodType<
  Creator2,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("app"),
  app: z.lazy(() => CreatorApp$inboundSchema),
});

export function creator2FromJSON(
  jsonString: string,
): SafeParseResult<Creator2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Creator2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Creator2' from JSON`,
  );
}

/** @internal */
export const ViaIntegration$inboundSchema: z.ZodType<
  ViaIntegration,
  z.ZodTypeDef,
  unknown
> = z.object({
  integrationId: types.string(),
  configurationId: types.string(),
});

export function viaIntegrationFromJSON(
  jsonString: string,
): SafeParseResult<ViaIntegration, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ViaIntegration$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ViaIntegration' from JSON`,
  );
}

/** @internal */
export const CreateProjectVia2$inboundSchema: z.ZodType<
  CreateProjectVia2,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("integration"),
  integration: z.lazy(() => ViaIntegration$inboundSchema),
});

export function createProjectVia2FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectVia2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectVia2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectVia2' from JSON`,
  );
}

/** @internal */
export const ViaApp$inboundSchema: z.ZodType<ViaApp, z.ZodTypeDef, unknown> = z
  .object({
    id: types.string(),
    clientId: types.optional(types.string()),
  });

export function viaAppFromJSON(
  jsonString: string,
): SafeParseResult<ViaApp, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ViaApp$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ViaApp' from JSON`,
  );
}

/** @internal */
export const CreateProjectVia1$inboundSchema: z.ZodType<
  CreateProjectVia1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("app"),
  app: z.lazy(() => ViaApp$inboundSchema),
});

export function createProjectVia1FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectVia1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectVia1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectVia1' from JSON`,
  );
}

/** @internal */
export const CreatorVia$inboundSchema: z.ZodType<
  CreatorVia,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => CreateProjectVia1$inboundSchema),
  z.lazy(() => CreateProjectVia2$inboundSchema),
]);

export function creatorViaFromJSON(
  jsonString: string,
): SafeParseResult<CreatorVia, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreatorVia$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreatorVia' from JSON`,
  );
}

/** @internal */
export const CreatorUser$inboundSchema: z.ZodType<
  CreatorUser,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
});

export function creatorUserFromJSON(
  jsonString: string,
): SafeParseResult<CreatorUser, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreatorUser$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreatorUser' from JSON`,
  );
}

/** @internal */
export const Creator1$inboundSchema: z.ZodType<
  Creator1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("user"),
  via: types.nullable(
    z.union([
      z.lazy(() => CreateProjectVia1$inboundSchema),
      z.lazy(() => CreateProjectVia2$inboundSchema),
    ]),
  ),
  user: z.lazy(() => CreatorUser$inboundSchema),
});

export function creator1FromJSON(
  jsonString: string,
): SafeParseResult<Creator1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Creator1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Creator1' from JSON`,
  );
}

/** @internal */
export const CreateProjectCreator$inboundSchema: z.ZodType<
  CreateProjectCreator,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => Creator1$inboundSchema),
  z.lazy(() => Creator2$inboundSchema),
  z.lazy(() => Creator3$inboundSchema),
  z.lazy(() => Creator4$inboundSchema),
]);

export function createProjectCreatorFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectCreator, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectCreator$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectCreator' from JSON`,
  );
}

/** @internal */
export const CreateProjectConfiguredBy$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectConfiguredBy
> = z.nativeEnum(CreateProjectConfiguredBy);

/** @internal */
export const CreateProjectProjectsAliasAssigned$inboundSchema: z.ZodType<
  CreateProjectProjectsAliasAssigned,
  z.ZodTypeDef,
  unknown
> = smartUnion([types.number(), types.boolean()]);

export function createProjectProjectsAliasAssignedFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectProjectsAliasAssigned, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsAliasAssigned$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectProjectsAliasAssigned' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponseAliasError$inboundSchema: z.ZodType<
  CreateProjectProjectsResponseAliasError,
  z.ZodTypeDef,
  unknown
> = z.object({
  code: types.string(),
  message: types.string(),
});

export function createProjectProjectsResponseAliasErrorFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectProjectsResponseAliasError,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponseAliasError$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectProjectsResponseAliasError' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType,
  );

/** @internal */
export const CreateProjectProjectsResponse200BranchMatcher$inboundSchema:
  z.ZodType<
    CreateProjectProjectsResponse200BranchMatcher,
    z.ZodTypeDef,
    unknown
  > = z.object({
    type:
      CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasDeploymentType$inboundSchema,
    pattern: types.string(),
  });

export function createProjectProjectsResponse200BranchMatcherFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectProjectsResponse200BranchMatcher,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponse200BranchMatcher$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectProjectsResponse200BranchMatcher' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponseBuilds$inboundSchema: z.ZodType<
  CreateProjectProjectsResponseBuilds,
  z.ZodTypeDef,
  unknown
> = z.object({
  use: types.string(),
  src: types.optional(types.string()),
  dest: types.optional(types.string()),
});

export function createProjectProjectsResponseBuildsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectProjectsResponseBuilds, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponseBuilds$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectProjectsResponseBuilds' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponseChecksConclusion$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponseChecksConclusion> = z
    .nativeEnum(CreateProjectProjectsResponseChecksConclusion);

/** @internal */
export const CreateProjectProjectsResponseChecksState$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponseChecksState> = z
    .nativeEnum(CreateProjectProjectsResponseChecksState);

/** @internal */
export const CreateProjectProjectsResponse200Creator$inboundSchema: z.ZodType<
  CreateProjectProjectsResponse200Creator,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  githubLogin: types.optional(types.string()),
  gitlabLogin: types.optional(types.string()),
  uid: types.string(),
  username: types.string(),
});

export function createProjectProjectsResponse200CreatorFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectProjectsResponse200Creator,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponse200Creator$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectProjectsResponse200Creator' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponseOidcTokenClaims$inboundSchema:
  z.ZodType<
    CreateProjectProjectsResponseOidcTokenClaims,
    z.ZodTypeDef,
    unknown
  > = z.object({
    iss: types.string(),
    sub: types.string(),
    scope: types.string(),
    aud: types.string(),
    owner: types.string(),
    owner_id: types.string(),
    project: types.string(),
    project_id: types.string(),
    environment: types.string(),
    custom_environment_id: types.optional(types.string()),
    mfe_group_ids: types.optional(z.array(types.string())),
    plan: types.optional(types.string()),
  }).transform((v) => {
    return remap$(v, {
      "owner_id": "ownerId",
      "project_id": "projectId",
      "custom_environment_id": "customEnvironmentId",
      "mfe_group_ids": "mfeGroupIds",
    });
  });

export function createProjectProjectsResponseOidcTokenClaimsFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectProjectsResponseOidcTokenClaims,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponseOidcTokenClaims$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectProjectsResponseOidcTokenClaims' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponsePlan$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectProjectsResponsePlan
> = z.nativeEnum(CreateProjectProjectsResponsePlan);

/** @internal */
export const CreateProjectProjectsResponseReadyState$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponseReadyState> = z
    .nativeEnum(CreateProjectProjectsResponseReadyState);

/** @internal */
export const CreateProjectProjectsResponseReadySubstate$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponseReadySubstate> = z
    .nativeEnum(CreateProjectProjectsResponseReadySubstate);

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType,
  );

/** @internal */
export const CreateProjectDeployment$inboundSchema: z.ZodType<
  CreateProjectDeployment,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  alias: types.optional(z.array(types.string())),
  aliasAssigned: z.nullable(smartUnion([types.number(), types.boolean()]))
    .optional(),
  aliasError: z.nullable(
    z.lazy(() => CreateProjectProjectsResponseAliasError$inboundSchema),
  ).optional(),
  aliasFinal: z.nullable(types.string()).optional(),
  automaticAliases: types.optional(z.array(types.string())),
  branchMatcher: types.optional(
    z.lazy(() => CreateProjectProjectsResponse200BranchMatcher$inboundSchema),
  ),
  buildingAt: types.optional(types.number()),
  builds: types.optional(
    z.array(z.lazy(() => CreateProjectProjectsResponseBuilds$inboundSchema)),
  ),
  checksConclusion: types.optional(
    CreateProjectProjectsResponseChecksConclusion$inboundSchema,
  ),
  checksState: types.optional(
    CreateProjectProjectsResponseChecksState$inboundSchema,
  ),
  connectBuildsEnabled: types.optional(types.boolean()),
  connectConfigurationId: types.optional(types.string()),
  createdAt: types.number(),
  createdIn: types.string(),
  creator: types.nullable(
    z.lazy(() => CreateProjectProjectsResponse200Creator$inboundSchema),
  ),
  deletedAt: types.optional(types.number()),
  deploymentHostname: types.string(),
  forced: types.optional(types.boolean()),
  name: types.string(),
  meta: types.optional(z.record(types.string())),
  monorepoManager: z.nullable(types.string()).optional(),
  oidcTokenClaims: types.optional(
    z.lazy(() => CreateProjectProjectsResponseOidcTokenClaims$inboundSchema),
  ),
  plan: CreateProjectProjectsResponsePlan$inboundSchema,
  previewCommentsEnabled: types.optional(types.boolean()),
  private: types.boolean(),
  readyAt: types.optional(types.number()),
  readyState: CreateProjectProjectsResponseReadyState$inboundSchema,
  readySubstate: types.optional(
    CreateProjectProjectsResponseReadySubstate$inboundSchema,
  ),
  requestedAt: types.optional(types.number()),
  target: z.nullable(types.string()).optional(),
  teamId: z.nullable(types.string()).optional(),
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyAliasType$inboundSchema,
  url: types.string(),
  userId: types.optional(types.string()),
  withCache: types.optional(types.boolean()),
});

export function createProjectDeploymentFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectDeployment, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectDeployment$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectDeployment' from JSON`,
  );
}

/** @internal */
export const CreateProjectEnvironment$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectEnvironment
> = z.nativeEnum(CreateProjectEnvironment);

/** @internal */
export const CreateProjectProjectsTarget$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectProjectsTarget
> = z.nativeEnum(CreateProjectProjectsTarget);

/** @internal */
export const Alias$inboundSchema: z.ZodType<Alias, z.ZodTypeDef, unknown> = z
  .object({
    configuredBy: z.nullable(CreateProjectConfiguredBy$inboundSchema)
      .optional(),
    configuredChangedAt: z.nullable(types.number()).optional(),
    createdAt: z.nullable(types.number()).optional(),
    deployment: types.nullable(
      z.lazy(() => CreateProjectDeployment$inboundSchema),
    ),
    domain: types.string(),
    environment: CreateProjectEnvironment$inboundSchema,
    gitBranch: z.nullable(types.string()).optional(),
    redirect: z.nullable(types.string()).optional(),
    redirectStatusCode: z.nullable(types.number()).optional(),
    target: CreateProjectProjectsTarget$inboundSchema,
  });

export function aliasFromJSON(
  jsonString: string,
): SafeParseResult<Alias, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Alias$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Alias' from JSON`,
  );
}

/** @internal */
export const Analytics$inboundSchema: z.ZodType<
  Analytics,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  canceledAt: z.nullable(types.number()).optional(),
  disabledAt: types.number(),
  enabledAt: types.number(),
  paidAt: types.optional(types.number()),
  sampleRatePercent: z.nullable(types.number()).optional(),
  spendLimitInDollars: z.nullable(types.number()).optional(),
});

export function analyticsFromJSON(
  jsonString: string,
): SafeParseResult<Analytics, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Analytics$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Analytics' from JSON`,
  );
}

/** @internal */
export const SpeedInsights$inboundSchema: z.ZodType<
  SpeedInsights,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  enabledAt: types.optional(types.number()),
  disabledAt: types.optional(types.number()),
  canceledAt: types.optional(types.number()),
  hasData: types.optional(types.boolean()),
  dataReceivedAt: types.optional(types.number()),
  paidAt: types.optional(types.number()),
});

export function speedInsightsFromJSON(
  jsonString: string,
): SafeParseResult<SpeedInsights, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => SpeedInsights$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'SpeedInsights' from JSON`,
  );
}

/** @internal */
export const CreateProjectEnvId2$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectEnvId2
> = z.nativeEnum(CreateProjectEnvId2);

/** @internal */
export const CreateProjectEnvId$inboundSchema: z.ZodType<
  CreateProjectEnvId,
  z.ZodTypeDef,
  unknown
> = smartUnion([types.string(), CreateProjectEnvId2$inboundSchema]);

export function createProjectEnvIdFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectEnvId, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectEnvId$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectEnvId' from JSON`,
  );
}

/** @internal */
export const CreateProjectAws$inboundSchema: z.ZodType<
  CreateProjectAws,
  z.ZodTypeDef,
  unknown
> = z.object({
  subnetIds: z.array(types.string()),
  securityGroupId: types.optional(types.string()),
});

export function createProjectAwsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectAws, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectAws$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectAws' from JSON`,
  );
}

/** @internal */
export const CreateProjectConnectConfigurations$inboundSchema: z.ZodType<
  CreateProjectConnectConfigurations,
  z.ZodTypeDef,
  unknown
> = z.object({
  envId: smartUnion([types.string(), CreateProjectEnvId2$inboundSchema]),
  connectConfigurationId: types.string(),
  dc: types.optional(types.string()),
  passive: types.boolean(),
  buildsEnabled: types.boolean(),
  aws: types.optional(z.lazy(() => CreateProjectAws$inboundSchema)),
  createdAt: types.number(),
  updatedAt: types.number(),
});

export function createProjectConnectConfigurationsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectConnectConfigurations, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectConnectConfigurations$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectConnectConfigurations' from JSON`,
  );
}

/** @internal */
export const CreateProjectSource$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectSource
> = z.nativeEnum(CreateProjectSource);

/** @internal */
export const Definitions$inboundSchema: z.ZodType<
  Definitions,
  z.ZodTypeDef,
  unknown
> = z.object({
  host: types.string(),
  path: types.string(),
  schedule: types.string(),
  source: types.optional(CreateProjectSource$inboundSchema),
  description: types.optional(types.string()),
  hostInferred: types.optional(types.boolean()),
});

export function definitionsFromJSON(
  jsonString: string,
): SafeParseResult<Definitions, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Definitions$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Definitions' from JSON`,
  );
}

/** @internal */
export const CreateProjectCrons$inboundSchema: z.ZodType<
  CreateProjectCrons,
  z.ZodTypeDef,
  unknown
> = z.object({
  enabledAt: types.number(),
  disabledAt: types.nullable(types.number()),
  updatedAt: types.number(),
  deploymentId: types.nullable(types.string()),
  definitions: z.array(z.lazy(() => Definitions$inboundSchema)),
});

export function createProjectCronsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectCrons, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectCrons$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectCrons' from JSON`,
  );
}

/** @internal */
export const CreateProjectDataCache$inboundSchema: z.ZodType<
  CreateProjectDataCache,
  z.ZodTypeDef,
  unknown
> = z.object({
  userDisabled: types.boolean(),
  storageSizeBytes: z.nullable(types.number()).optional(),
  unlimited: types.optional(types.boolean()),
});

export function createProjectDataCacheFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectDataCache, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectDataCache$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectDataCache' from JSON`,
  );
}

/** @internal */
export const DeploymentExpiration$inboundSchema: z.ZodType<
  DeploymentExpiration,
  z.ZodTypeDef,
  unknown
> = z.object({
  expirationDays: types.optional(types.number()),
  expirationDaysProduction: types.optional(types.number()),
  expirationDaysCanceled: types.optional(types.number()),
  expirationDaysErrored: types.optional(types.number()),
  deploymentsToKeep: types.optional(types.number()),
});

export function deploymentExpirationFromJSON(
  jsonString: string,
): SafeParseResult<DeploymentExpiration, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => DeploymentExpiration$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'DeploymentExpiration' from JSON`,
  );
}

/** @internal */
export const Expiration2$inboundSchema: z.ZodType<
  Expiration2,
  z.ZodTypeDef,
  unknown
> = z.object({
  lockedAt: types.number(),
  lockedBy: types.string(),
});

export function expiration2FromJSON(
  jsonString: string,
): SafeParseResult<Expiration2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Expiration2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Expiration2' from JSON`,
  );
}

/** @internal */
export const Expiration1$inboundSchema: z.ZodType<
  Expiration1,
  z.ZodTypeDef,
  unknown
> = z.object({
  expiresAt: types.number(),
});

export function expiration1FromJSON(
  jsonString: string,
): SafeParseResult<Expiration1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Expiration1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Expiration1' from JSON`,
  );
}

/** @internal */
export const CreateProjectExpiration$inboundSchema: z.ZodType<
  CreateProjectExpiration,
  z.ZodTypeDef,
  unknown
> = smartUnion([
  z.lazy(() => Expiration2$inboundSchema),
  z.lazy(() => Expiration1$inboundSchema),
]);

export function createProjectExpirationFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectExpiration, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectExpiration$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectExpiration' from JSON`,
  );
}

/** @internal */
export const CreateProjectTarget2$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectTarget2
> = z.nativeEnum(CreateProjectTarget2);

/** @internal */
export const CreateProjectTarget1$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectTarget1
> = z.nativeEnum(CreateProjectTarget1);

/** @internal */
export const CreateProjectProjectsResponseTarget$inboundSchema: z.ZodType<
  CreateProjectProjectsResponseTarget,
  z.ZodTypeDef,
  unknown
> = smartUnion([
  z.array(CreateProjectTarget1$inboundSchema),
  CreateProjectTarget2$inboundSchema,
]);

export function createProjectProjectsResponseTargetFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectProjectsResponseTarget, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsResponseTarget$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectProjectsResponseTarget' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponseType$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectProjectsResponseType
> = z.nativeEnum(CreateProjectProjectsResponseType);

/** @internal */
export const CreateProjectVisibility$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectVisibility
> = z.nativeEnum(CreateProjectVisibility);

/** @internal */
export const CreateProjectContentHint17$inboundSchema: z.ZodType<
  CreateProjectContentHint17,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("flags-connection-string"),
  projectId: types.string(),
});

export function createProjectContentHint17FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint17, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint17$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint17' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint16$inboundSchema: z.ZodType<
  CreateProjectContentHint16,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("integration-store-secret"),
  storeId: types.string(),
  integrationId: types.string(),
  integrationProductId: types.string(),
  integrationConfigurationId: types.string(),
});

export function createProjectContentHint16FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint16, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint16$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint16' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint15$inboundSchema: z.ZodType<
  CreateProjectContentHint15,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-url-no-ssl"),
  storeId: types.string(),
});

export function createProjectContentHint15FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint15, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint15$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint15' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint14$inboundSchema: z.ZodType<
  CreateProjectContentHint14,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-database"),
  storeId: types.string(),
});

export function createProjectContentHint14FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint14, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint14$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint14' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint13$inboundSchema: z.ZodType<
  CreateProjectContentHint13,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-password"),
  storeId: types.string(),
});

export function createProjectContentHint13FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint13, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint13$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint13' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint12$inboundSchema: z.ZodType<
  CreateProjectContentHint12,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-host"),
  storeId: types.string(),
});

export function createProjectContentHint12FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint12, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint12$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint12' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint11$inboundSchema: z.ZodType<
  CreateProjectContentHint11,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-user"),
  storeId: types.string(),
});

export function createProjectContentHint11FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint11, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint11$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint11' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint10$inboundSchema: z.ZodType<
  CreateProjectContentHint10,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-prisma-url"),
  storeId: types.string(),
});

export function createProjectContentHint10FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint10, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint10$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint10' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint9$inboundSchema: z.ZodType<
  CreateProjectContentHint9,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-url-non-pooling"),
  storeId: types.string(),
});

export function createProjectContentHint9FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint9, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint9$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint9' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint8$inboundSchema: z.ZodType<
  CreateProjectContentHint8,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("postgres-url"),
  storeId: types.string(),
});

export function createProjectContentHint8FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint8, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint8$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint8' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint7$inboundSchema: z.ZodType<
  CreateProjectContentHint7,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("blob-webhook-public-key"),
  storeId: types.string(),
});

export function createProjectContentHint7FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint7, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint7$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint7' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint6$inboundSchema: z.ZodType<
  CreateProjectContentHint6,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("blob-store-id"),
  storeId: types.string(),
});

export function createProjectContentHint6FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint6, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint6$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint6' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint5$inboundSchema: z.ZodType<
  CreateProjectContentHint5,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("blob-read-write-token"),
  storeId: types.string(),
});

export function createProjectContentHint5FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint5, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint5$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint5' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint4$inboundSchema: z.ZodType<
  CreateProjectContentHint4,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("redis-rest-api-read-only-token"),
  storeId: types.string(),
});

export function createProjectContentHint4FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint4, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint4$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint4' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint3$inboundSchema: z.ZodType<
  CreateProjectContentHint3,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("redis-rest-api-token"),
  storeId: types.string(),
});

export function createProjectContentHint3FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint3, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint3$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint3' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint2$inboundSchema: z.ZodType<
  CreateProjectContentHint2,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("redis-rest-api-url"),
  storeId: types.string(),
});

export function createProjectContentHint2FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint2' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint1$inboundSchema: z.ZodType<
  CreateProjectContentHint1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("redis-url"),
  storeId: types.string(),
});

export function createProjectContentHint1FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint1' from JSON`,
  );
}

/** @internal */
export const CreateProjectContentHint$inboundSchema: z.ZodType<
  CreateProjectContentHint,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => CreateProjectContentHint1$inboundSchema),
  z.lazy(() => CreateProjectContentHint2$inboundSchema),
  z.lazy(() => CreateProjectContentHint3$inboundSchema),
  z.lazy(() => CreateProjectContentHint4$inboundSchema),
  z.lazy(() => CreateProjectContentHint5$inboundSchema),
  z.lazy(() => CreateProjectContentHint6$inboundSchema),
  z.lazy(() => CreateProjectContentHint7$inboundSchema),
  z.lazy(() => CreateProjectContentHint8$inboundSchema),
  z.lazy(() => CreateProjectContentHint9$inboundSchema),
  z.lazy(() => CreateProjectContentHint10$inboundSchema),
  z.lazy(() => CreateProjectContentHint11$inboundSchema),
  z.lazy(() => CreateProjectContentHint12$inboundSchema),
  z.lazy(() => CreateProjectContentHint13$inboundSchema),
  z.lazy(() => CreateProjectContentHint14$inboundSchema),
  z.lazy(() => CreateProjectContentHint15$inboundSchema),
  z.lazy(() => CreateProjectContentHint16$inboundSchema),
  z.lazy(() => CreateProjectContentHint17$inboundSchema),
]);

export function createProjectContentHintFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectContentHint, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectContentHint$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectContentHint' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType,
  );

/** @internal */
export const CreateProjectInternalContentHint$inboundSchema: z.ZodType<
  CreateProjectInternalContentHint,
  z.ZodTypeDef,
  unknown
> = z.object({
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyEnvType$inboundSchema,
  encryptedValue: types.string(),
});

export function createProjectInternalContentHintFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectInternalContentHint, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectInternalContentHint$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectInternalContentHint' from JSON`,
  );
}

/** @internal */
export const CreateProjectEnv$inboundSchema: z.ZodType<
  CreateProjectEnv,
  z.ZodTypeDef,
  unknown
> = z.object({
  target: types.optional(
    smartUnion([
      z.array(CreateProjectTarget1$inboundSchema),
      CreateProjectTarget2$inboundSchema,
    ]),
  ),
  type: CreateProjectProjectsResponseType$inboundSchema,
  sunsetSecretId: types.optional(types.string()),
  legacyValue: types.optional(types.string()),
  decrypted: types.optional(types.boolean()),
  value: types.string(),
  vsmValue: types.optional(types.string()),
  id: types.optional(types.string()),
  key: types.string(),
  configurationId: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  updatedAt: types.optional(types.number()),
  createdBy: z.nullable(types.string()).optional(),
  updatedBy: z.nullable(types.string()).optional(),
  gitBranch: types.optional(types.string()),
  visibility: types.optional(CreateProjectVisibility$inboundSchema),
  edgeConfigId: z.nullable(types.string()).optional(),
  edgeConfigTokenId: z.nullable(types.string()).optional(),
  contentHint: z.nullable(
    z.union([
      z.lazy(() => CreateProjectContentHint1$inboundSchema),
      z.lazy(() => CreateProjectContentHint2$inboundSchema),
      z.lazy(() => CreateProjectContentHint3$inboundSchema),
      z.lazy(() => CreateProjectContentHint4$inboundSchema),
      z.lazy(() => CreateProjectContentHint5$inboundSchema),
      z.lazy(() => CreateProjectContentHint6$inboundSchema),
      z.lazy(() => CreateProjectContentHint7$inboundSchema),
      z.lazy(() => CreateProjectContentHint8$inboundSchema),
      z.lazy(() => CreateProjectContentHint9$inboundSchema),
      z.lazy(() => CreateProjectContentHint10$inboundSchema),
      z.lazy(() => CreateProjectContentHint11$inboundSchema),
      z.lazy(() => CreateProjectContentHint12$inboundSchema),
      z.lazy(() => CreateProjectContentHint13$inboundSchema),
      z.lazy(() => CreateProjectContentHint14$inboundSchema),
      z.lazy(() => CreateProjectContentHint15$inboundSchema),
      z.lazy(() => CreateProjectContentHint16$inboundSchema),
      z.lazy(() => CreateProjectContentHint17$inboundSchema),
    ]),
  ).optional(),
  internalContentHint: z.nullable(
    z.lazy(() => CreateProjectInternalContentHint$inboundSchema),
  ).optional(),
  comment: types.optional(types.string()),
  customEnvironmentIds: types.optional(z.array(types.string())),
});

export function createProjectEnvFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectEnv, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectEnv$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectEnv' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponse200Type$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponse200Type> = z.nativeEnum(
    CreateProjectProjectsResponse200Type,
  );

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType,
  );

/** @internal */
export const CreateProjectBranchMatcher$inboundSchema: z.ZodType<
  CreateProjectBranchMatcher,
  z.ZodTypeDef,
  unknown
> = z.object({
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyCustomEnvironmentsType$inboundSchema,
  pattern: types.string(),
});

export function createProjectBranchMatcherFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectBranchMatcher, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectBranchMatcher$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectBranchMatcher' from JSON`,
  );
}

/** @internal */
export const CreateProjectVerification$inboundSchema: z.ZodType<
  CreateProjectVerification,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.string(),
  domain: types.string(),
  value: types.string(),
  reason: types.string(),
});

export function createProjectVerificationFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectVerification, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectVerification$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectVerification' from JSON`,
  );
}

/** @internal */
export const CreateProjectDomains$inboundSchema: z.ZodType<
  CreateProjectDomains,
  z.ZodTypeDef,
  unknown
> = z.object({
  name: types.string(),
  apexName: types.string(),
  projectId: types.string(),
  redirect: z.nullable(types.string()).optional(),
  redirectStatusCode: z.nullable(types.number()).optional(),
  gitBranch: z.nullable(types.string()).optional(),
  customEnvironmentId: z.nullable(types.string()).optional(),
  updatedAt: types.optional(types.number()),
  createdAt: types.optional(types.number()),
  verified: types.boolean(),
  verification: types.optional(
    z.array(z.lazy(() => CreateProjectVerification$inboundSchema)),
  ),
});

export function createProjectDomainsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectDomains, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectDomains$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectDomains' from JSON`,
  );
}

/** @internal */
export const CreateProjectCustomEnvironments$inboundSchema: z.ZodType<
  CreateProjectCustomEnvironments,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  slug: types.string(),
  type: CreateProjectProjectsResponse200Type$inboundSchema,
  description: types.optional(types.string()),
  branchMatcher: types.optional(
    z.lazy(() => CreateProjectBranchMatcher$inboundSchema),
  ),
  domains: types.optional(
    z.array(z.lazy(() => CreateProjectDomains$inboundSchema)),
  ),
  currentDeploymentAliases: types.optional(z.array(types.string())),
  createdAt: types.number(),
  updatedAt: types.number(),
});

export function createProjectCustomEnvironmentsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectCustomEnvironments, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectCustomEnvironments$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectCustomEnvironments' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsFramework$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectProjectsFramework
> = z.nativeEnum(CreateProjectProjectsFramework);

/** @internal */
export const CreateProjectServiceType$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectServiceType
> = z.nativeEnum(CreateProjectServiceType);

/** @internal */
export const CreateProjectProjectsResponseFramework$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponseFramework> = z.nativeEnum(
    CreateProjectProjectsResponseFramework,
  );

/** @internal */
export const CreateProjectServices$inboundSchema: z.ZodType<
  CreateProjectServices,
  z.ZodTypeDef,
  unknown
> = z.object({
  serviceName: types.string(),
  serviceType: types.optional(CreateProjectServiceType$inboundSchema),
  framework: types.optional(
    CreateProjectProjectsResponseFramework$inboundSchema,
  ),
  runtime: types.optional(types.string()),
});

export function createProjectServicesFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectServices, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectServices$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectServices' from JSON`,
  );
}

/** @internal */
export const CreateProjectIpBuckets$inboundSchema: z.ZodType<
  CreateProjectIpBuckets,
  z.ZodTypeDef,
  unknown
> = z.object({
  bucket: types.string(),
  default: types.optional(types.boolean()),
  supportUntil: types.optional(types.number()),
});

export function createProjectIpBucketsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectIpBuckets, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectIpBuckets$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectIpBuckets' from JSON`,
  );
}

/** @internal */
export const CreateProjectLint$inboundSchema: z.ZodType<
  CreateProjectLint,
  z.ZodTypeDef,
  unknown
> = z.object({
  targets: z.array(types.string()),
});

export function createProjectLintFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectLint, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectLint$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectLint' from JSON`,
  );
}

/** @internal */
export const CreateProjectTypecheck$inboundSchema: z.ZodType<
  CreateProjectTypecheck,
  z.ZodTypeDef,
  unknown
> = z.object({
  targets: z.array(types.string()),
});

export function createProjectTypecheckFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectTypecheck, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectTypecheck$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectTypecheck' from JSON`,
  );
}

/** @internal */
export const CreateProjectMfeConfigPresent$inboundSchema: z.ZodType<
  CreateProjectMfeConfigPresent,
  z.ZodTypeDef,
  unknown
> = z.object({
  targets: z.array(types.string()),
});

export function createProjectMfeConfigPresentFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectMfeConfigPresent, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectMfeConfigPresent$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectMfeConfigPresent' from JSON`,
  );
}

/** @internal */
export const Jobs$inboundSchema: z.ZodType<Jobs, z.ZodTypeDef, unknown> = z
  .object({
    lint: types.optional(z.lazy(() => CreateProjectLint$inboundSchema)),
    typecheck: types.optional(
      z.lazy(() => CreateProjectTypecheck$inboundSchema),
    ),
    "mfe-config-present": types.optional(
      z.lazy(() => CreateProjectMfeConfigPresent$inboundSchema),
    ),
  }).transform((v) => {
    return remap$(v, {
      "mfe-config-present": "mfeConfigPresent",
    });
  });

export function jobsFromJSON(
  jsonString: string,
): SafeParseResult<Jobs, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Jobs$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Jobs' from JSON`,
  );
}

/** @internal */
export const AliasAssigned$inboundSchema: z.ZodType<
  AliasAssigned,
  z.ZodTypeDef,
  unknown
> = smartUnion([types.number(), types.boolean()]);

export function aliasAssignedFromJSON(
  jsonString: string,
): SafeParseResult<AliasAssigned, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => AliasAssigned$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'AliasAssigned' from JSON`,
  );
}

/** @internal */
export const CreateProjectAliasError$inboundSchema: z.ZodType<
  CreateProjectAliasError,
  z.ZodTypeDef,
  unknown
> = z.object({
  code: types.string(),
  message: types.string(),
});

export function createProjectAliasErrorFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectAliasError, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectAliasError$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectAliasError' from JSON`,
  );
}

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType,
  );

/** @internal */
export const CreateProjectProjectsBranchMatcher$inboundSchema: z.ZodType<
  CreateProjectProjectsBranchMatcher,
  z.ZodTypeDef,
  unknown
> = z.object({
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyLatestDeploymentsType$inboundSchema,
  pattern: types.string(),
});

export function createProjectProjectsBranchMatcherFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectProjectsBranchMatcher, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectProjectsBranchMatcher$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectProjectsBranchMatcher' from JSON`,
  );
}

/** @internal */
export const CreateProjectBuilds$inboundSchema: z.ZodType<
  CreateProjectBuilds,
  z.ZodTypeDef,
  unknown
> = z.object({
  use: types.string(),
  src: types.optional(types.string()),
  dest: types.optional(types.string()),
});

export function createProjectBuildsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectBuilds, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectBuilds$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectBuilds' from JSON`,
  );
}

/** @internal */
export const CreateProjectChecksConclusion$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectChecksConclusion
> = z.nativeEnum(CreateProjectChecksConclusion);

/** @internal */
export const CreateProjectChecksState$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectChecksState
> = z.nativeEnum(CreateProjectChecksState);

/** @internal */
export const CreateProjectProjectsCreator$inboundSchema: z.ZodType<
  CreateProjectProjectsCreator,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  githubLogin: types.optional(types.string()),
  gitlabLogin: types.optional(types.string()),
  uid: types.string(),
  username: types.string(),
});

export function createProjectProjectsCreatorFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectProjectsCreator, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectProjectsCreator$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectProjectsCreator' from JSON`,
  );
}

/** @internal */
export const CreateProjectOidcTokenClaims$inboundSchema: z.ZodType<
  CreateProjectOidcTokenClaims,
  z.ZodTypeDef,
  unknown
> = z.object({
  iss: types.string(),
  sub: types.string(),
  scope: types.string(),
  aud: types.string(),
  owner: types.string(),
  owner_id: types.string(),
  project: types.string(),
  project_id: types.string(),
  environment: types.string(),
  custom_environment_id: types.optional(types.string()),
  mfe_group_ids: types.optional(z.array(types.string())),
  plan: types.optional(types.string()),
}).transform((v) => {
  return remap$(v, {
    "owner_id": "ownerId",
    "project_id": "projectId",
    "custom_environment_id": "customEnvironmentId",
    "mfe_group_ids": "mfeGroupIds",
  });
});

export function createProjectOidcTokenClaimsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectOidcTokenClaims, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectOidcTokenClaims$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectOidcTokenClaims' from JSON`,
  );
}

/** @internal */
export const CreateProjectPlan$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectPlan
> = z.nativeEnum(CreateProjectPlan);

/** @internal */
export const CreateProjectReadyState$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectReadyState
> = z.nativeEnum(CreateProjectReadyState);

/** @internal */
export const CreateProjectReadySubstate$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectReadySubstate
> = z.nativeEnum(CreateProjectReadySubstate);

/** @internal */
export const CreateProjectProjectsResponse200ApplicationJSONType$inboundSchema:
  z.ZodNativeEnum<typeof CreateProjectProjectsResponse200ApplicationJSONType> =
    z.nativeEnum(CreateProjectProjectsResponse200ApplicationJSONType);

/** @internal */
export const LatestDeployments$inboundSchema: z.ZodType<
  LatestDeployments,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  alias: types.optional(z.array(types.string())),
  aliasAssigned: z.nullable(smartUnion([types.number(), types.boolean()]))
    .optional(),
  aliasError: z.nullable(z.lazy(() => CreateProjectAliasError$inboundSchema))
    .optional(),
  aliasFinal: z.nullable(types.string()).optional(),
  automaticAliases: types.optional(z.array(types.string())),
  branchMatcher: types.optional(
    z.lazy(() => CreateProjectProjectsBranchMatcher$inboundSchema),
  ),
  buildingAt: types.optional(types.number()),
  builds: types.optional(
    z.array(z.lazy(() => CreateProjectBuilds$inboundSchema)),
  ),
  checksConclusion: types.optional(CreateProjectChecksConclusion$inboundSchema),
  checksState: types.optional(CreateProjectChecksState$inboundSchema),
  connectBuildsEnabled: types.optional(types.boolean()),
  connectConfigurationId: types.optional(types.string()),
  createdAt: types.number(),
  createdIn: types.string(),
  creator: types.nullable(
    z.lazy(() => CreateProjectProjectsCreator$inboundSchema),
  ),
  deletedAt: types.optional(types.number()),
  deploymentHostname: types.string(),
  forced: types.optional(types.boolean()),
  name: types.string(),
  meta: types.optional(z.record(types.string())),
  monorepoManager: z.nullable(types.string()).optional(),
  oidcTokenClaims: types.optional(
    z.lazy(() => CreateProjectOidcTokenClaims$inboundSchema),
  ),
  plan: CreateProjectPlan$inboundSchema,
  previewCommentsEnabled: types.optional(types.boolean()),
  private: types.boolean(),
  readyAt: types.optional(types.number()),
  readyState: CreateProjectReadyState$inboundSchema,
  readySubstate: types.optional(CreateProjectReadySubstate$inboundSchema),
  requestedAt: types.optional(types.number()),
  target: z.nullable(types.string()).optional(),
  teamId: z.nullable(types.string()).optional(),
  type: CreateProjectProjectsResponse200ApplicationJSONType$inboundSchema,
  url: types.string(),
  userId: types.optional(types.string()),
  withCache: types.optional(types.boolean()),
});

export function latestDeploymentsFromJSON(
  jsonString: string,
): SafeParseResult<LatestDeployments, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => LatestDeployments$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'LatestDeployments' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema:
  z.ZodType<
    CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks,
    z.ZodTypeDef,
    unknown
  > = z.object({
    createdAt: types.optional(types.number()),
    id: types.string(),
    name: types.string(),
    ref: types.string(),
    url: types.string(),
  });

export function createProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema
        .parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link8$inboundSchema: z.ZodType<Link8, z.ZodTypeDef, unknown> = z
  .object({
    owner: types.string(),
    repo: types.string(),
    repoId: types.string(),
    ownerId: types.string(),
    type: types.literal("cursor-origin"),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() =>
        CreateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema
      ),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link8FromJSON(
  jsonString: string,
): SafeParseResult<Link8, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link8$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link8' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema:
  z.ZodType<
    CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks,
    z.ZodTypeDef,
    unknown
  > = z.object({
    createdAt: types.optional(types.number()),
    id: types.string(),
    name: types.string(),
    ref: types.string(),
    url: types.string(),
  });

export function createProjectLinkProjectsResponse200ApplicationJSONDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema
        .parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link7$inboundSchema: z.ZodType<Link7, z.ZodTypeDef, unknown> = z
  .object({
    org: types.string(),
    repo: types.string(),
    repoId: types.string(),
    type: types.literal("v0"),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() =>
        CreateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema
      ),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link7FromJSON(
  jsonString: string,
): SafeParseResult<Link7, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link7$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link7' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkProjectsResponse200DeployHooks$inboundSchema:
  z.ZodType<
    CreateProjectLinkProjectsResponse200DeployHooks,
    z.ZodTypeDef,
    unknown
  > = z.object({
    createdAt: types.optional(types.number()),
    id: types.string(),
    name: types.string(),
    ref: types.string(),
    url: types.string(),
  });

export function createProjectLinkProjectsResponse200DeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectLinkProjectsResponse200DeployHooks,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectLinkProjectsResponse200DeployHooks$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectLinkProjectsResponse200DeployHooks' from JSON`,
  );
}

/** @internal */
export const Link6$inboundSchema: z.ZodType<Link6, z.ZodTypeDef, unknown> = z
  .object({
    org: types.string(),
    repo: types.string(),
    repoId: types.string(),
    type: types.literal("vercel"),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() =>
        CreateProjectLinkProjectsResponse200DeployHooks$inboundSchema
      ),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link6FromJSON(
  jsonString: string,
): SafeParseResult<Link6, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link6$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link6' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkProjectsResponseDeployHooks$inboundSchema:
  z.ZodType<
    CreateProjectLinkProjectsResponseDeployHooks,
    z.ZodTypeDef,
    unknown
  > = z.object({
    createdAt: types.optional(types.number()),
    id: types.string(),
    name: types.string(),
    ref: types.string(),
    url: types.string(),
  });

export function createProjectLinkProjectsResponseDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<
  CreateProjectLinkProjectsResponseDeployHooks,
  SDKValidationError
> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectLinkProjectsResponseDeployHooks$inboundSchema.parse(
        JSON.parse(x),
      ),
    `Failed to parse 'CreateProjectLinkProjectsResponseDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link5$inboundSchema: z.ZodType<Link5, z.ZodTypeDef, unknown> = z
  .object({
    name: types.string(),
    slug: types.string(),
    owner: types.string(),
    type: types.literal("bitbucket"),
    uuid: types.string(),
    workspaceUuid: types.string(),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() => CreateProjectLinkProjectsResponseDeployHooks$inboundSchema),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link5FromJSON(
  jsonString: string,
): SafeParseResult<Link5, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link5$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link5' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkProjectsDeployHooks$inboundSchema: z.ZodType<
  CreateProjectLinkProjectsDeployHooks,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.optional(types.number()),
  id: types.string(),
  name: types.string(),
  ref: types.string(),
  url: types.string(),
});

export function createProjectLinkProjectsDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectLinkProjectsDeployHooks, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) =>
      CreateProjectLinkProjectsDeployHooks$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectLinkProjectsDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link4$inboundSchema: z.ZodType<Link4, z.ZodTypeDef, unknown> = z
  .object({
    projectId: types.string(),
    projectName: types.string(),
    projectNameWithNamespace: types.string(),
    projectNamespace: types.string(),
    projectOwnerId: types.optional(types.number()),
    projectUrl: types.string(),
    type: types.literal("gitlab"),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() => CreateProjectLinkProjectsDeployHooks$inboundSchema),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link4FromJSON(
  jsonString: string,
): SafeParseResult<Link4, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link4$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link4' from JSON`,
  );
}

/** @internal */
export const CreateProjectLinkDeployHooks$inboundSchema: z.ZodType<
  CreateProjectLinkDeployHooks,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.optional(types.number()),
  id: types.string(),
  name: types.string(),
  ref: types.string(),
  url: types.string(),
});

export function createProjectLinkDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectLinkDeployHooks, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectLinkDeployHooks$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectLinkDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link3$inboundSchema: z.ZodType<Link3, z.ZodTypeDef, unknown> = z
  .object({
    org: types.string(),
    repoOwnerId: types.optional(types.number()),
    repo: types.optional(types.string()),
    repoId: types.optional(types.number()),
    type: types.literal("github-custom-host"),
    host: types.string(),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(
      z.lazy(() => CreateProjectLinkDeployHooks$inboundSchema),
    ),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link3FromJSON(
  jsonString: string,
): SafeParseResult<Link3, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link3$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link3' from JSON`,
  );
}

/** @internal */
export const LinkDeployHooks$inboundSchema: z.ZodType<
  LinkDeployHooks,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.optional(types.number()),
  id: types.string(),
  name: types.string(),
  ref: types.string(),
  url: types.string(),
});

export function linkDeployHooksFromJSON(
  jsonString: string,
): SafeParseResult<LinkDeployHooks, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => LinkDeployHooks$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'LinkDeployHooks' from JSON`,
  );
}

/** @internal */
export const Link2$inboundSchema: z.ZodType<Link2, z.ZodTypeDef, unknown> = z
  .object({
    type: types.literal("github-limited"),
    repo: types.optional(types.string()),
    repoId: types.optional(types.number()),
    createdAt: types.optional(types.number()),
    updatedAt: types.optional(types.number()),
    org: types.string(),
    repoOwnerId: types.optional(types.number()),
    deployHooks: z.array(z.lazy(() => LinkDeployHooks$inboundSchema)),
    gitCredentialId: types.string(),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link2FromJSON(
  jsonString: string,
): SafeParseResult<Link2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link2' from JSON`,
  );
}

/** @internal */
export const DeployHooks$inboundSchema: z.ZodType<
  DeployHooks,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.optional(types.number()),
  id: types.string(),
  name: types.string(),
  ref: types.string(),
  url: types.string(),
});

export function deployHooksFromJSON(
  jsonString: string,
): SafeParseResult<DeployHooks, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => DeployHooks$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'DeployHooks' from JSON`,
  );
}

/** @internal */
export const Link1$inboundSchema: z.ZodType<Link1, z.ZodTypeDef, unknown> = z
  .object({
    org: types.string(),
    repoOwnerId: types.optional(types.number()),
    repo: types.optional(types.string()),
    repoId: types.optional(types.number()),
    type: types.literal("github"),
    createdAt: types.optional(types.number()),
    deployHooks: z.array(z.lazy(() => DeployHooks$inboundSchema)),
    gitCredentialId: types.string(),
    updatedAt: types.optional(types.number()),
    sourceless: types.optional(types.boolean()),
    productionBranch: types.string(),
  });

export function link1FromJSON(
  jsonString: string,
): SafeParseResult<Link1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link1' from JSON`,
  );
}

/** @internal */
export const Link$inboundSchema: z.ZodType<Link, z.ZodTypeDef, unknown> = z
  .union([
    z.lazy(() => Link1$inboundSchema),
    z.lazy(() => Link2$inboundSchema),
    z.lazy(() => Link3$inboundSchema),
    z.lazy(() => Link4$inboundSchema),
    z.lazy(() => Link5$inboundSchema),
    z.lazy(() => Link6$inboundSchema),
    z.lazy(() => Link7$inboundSchema),
    z.lazy(() => Link8$inboundSchema),
  ]);

export function linkFromJSON(
  jsonString: string,
): SafeParseResult<Link, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Link$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Link' from JSON`,
  );
}

/** @internal */
export const Blobs$inboundSchema: z.ZodType<Blobs, z.ZodTypeDef, unknown> = z
  .object({
    isDefaultApp: types.optional(types.boolean()),
  });

export function blobsFromJSON(
  jsonString: string,
): SafeParseResult<Blobs, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Blobs$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Blobs' from JSON`,
  );
}

/** @internal */
export const CreateProjectMicrofrontends3$inboundSchema: z.ZodType<
  CreateProjectMicrofrontends3,
  z.ZodTypeDef,
  unknown
> = z.object({
  updatedAt: types.number(),
  groupIds: z.array(z.any()),
  enabled: types.literal(false),
  freeProjectForLegacyLimits: types.optional(types.boolean()),
});

export function createProjectMicrofrontends3FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectMicrofrontends3, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectMicrofrontends3$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectMicrofrontends3' from JSON`,
  );
}

/** @internal */
export const CreateProjectMicrofrontends2$inboundSchema: z.ZodType<
  CreateProjectMicrofrontends2,
  z.ZodTypeDef,
  unknown
> = z.object({
  isDefaultApp: types.optional(types.literal(false)),
  routeObservabilityToThisProject: types.optional(types.boolean()),
  doNotRouteWithMicrofrontendsRouting: types.optional(types.boolean()),
  updatedAt: types.number(),
  groupIds: z.array(types.string()),
  enabled: types.literal(true),
  defaultRoute: types.optional(types.string()),
  freeProjectForLegacyLimits: types.optional(types.boolean()),
});

export function createProjectMicrofrontends2FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectMicrofrontends2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectMicrofrontends2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectMicrofrontends2' from JSON`,
  );
}

/** @internal */
export const CreateProjectMicrofrontends1$inboundSchema: z.ZodType<
  CreateProjectMicrofrontends1,
  z.ZodTypeDef,
  unknown
> = z.object({
  isDefaultApp: types.literal(true),
  updatedAt: types.number(),
  groupIds: z.array(types.string()),
  enabled: types.literal(true),
  defaultRoute: types.optional(types.string()),
  freeProjectForLegacyLimits: types.optional(types.boolean()),
});

export function createProjectMicrofrontends1FromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectMicrofrontends1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectMicrofrontends1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectMicrofrontends1' from JSON`,
  );
}

/** @internal */
export const CreateProjectMicrofrontends$inboundSchema: z.ZodType<
  CreateProjectMicrofrontends,
  z.ZodTypeDef,
  unknown
> = smartUnion([
  z.lazy(() => CreateProjectMicrofrontends1$inboundSchema),
  z.lazy(() => CreateProjectMicrofrontends2$inboundSchema),
  z.lazy(() => CreateProjectMicrofrontends3$inboundSchema),
]);

export function createProjectMicrofrontendsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectMicrofrontends, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectMicrofrontends$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectMicrofrontends' from JSON`,
  );
}

/** @internal */
export const CreateProjectNodeVersion$inboundSchema: z.ZodNativeEnum<
  typeof CreateProjectNodeVersion
> = z.nativeEnum(CreateProjectNodeVersion);

/** @internal */
export const CreateProjectPaths$inboundSchema: z.ZodType<
  CreateProjectPaths,
  z.ZodTypeDef,
  unknown
> = z.object({
  value: types.string(),
});

export function createProjectPathsFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectPaths, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectPaths$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectPaths' from JSON`,
  );
}

/** @internal */
export const CreateProjectOptionsAllowlist$inboundSchema: z.ZodType<
  CreateProjectOptionsAllowlist,
  z.ZodTypeDef,
  unknown
> = z.object({
  paths: z.array(z.lazy(() => CreateProjectPaths$inboundSchema)),
});

export function createProjectOptionsAllowlistFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectOptionsAllowlist, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectOptionsAllowlist$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectOptionsAllowlist' from JSON`,
  );
}

/** @internal */
export const CreateProjectPasswordProtection$inboundSchema: z.ZodType<
  CreateProjectPasswordProtection,
  z.ZodTypeDef,
  unknown
> = z.object({});

export function createProjectPasswordProtectionFromJSON(
  jsonString: string,
): SafeParseResult<CreateProjectPasswordProtection, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CreateProjectPasswordProtection$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CreateProjectPasswordProtection' from JSON`,
  );
}