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>

5,148 lines 167 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 { ACLAction, ACLAction$inboundSchema } from "./aclaction.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 = {
  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",
  Vitepress: "vitepress",
  Vuepress: "vuepress",
  Parcel: "parcel",
  Fastapi: "fastapi",
  Flask: "flask",
  Fasthtml: "fasthtml",
  Django: "django",
  Ash: "ash",
  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",
} 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;
};

/**
 * 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 = {
  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 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;
  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;
  /**
   * 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 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;
  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 CreateProjectProjectsTarget =
  | Array<CreateProjectTarget1>
  | CreateProjectTarget2;

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

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;
  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 CreateProjectProjectsResponse200ApplicationJSONResponseBodyType = {
  EndsWith: "endsWith",
  Equals: "equals",
  StartsWith: "startsWith",
} as const;
/**
 * The type of matching to perform
 */
export type CreateProjectProjectsResponse200ApplicationJSONResponseBodyType =
  ClosedEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyType
  >;

/**
 * Configuration for matching git branches to this environment
 */
export type CreateProjectBranchMatcher = {
  /**
   * The type of matching to perform
   */
  type: CreateProjectProjectsResponse200ApplicationJSONResponseBodyType;
  /**
   * 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 CustomEnvironments = {
  /**
   * 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",
  CreateReactApp: "create-react-app",
  Django: "django",
  Docusaurus: "docusaurus",
  Docusaurus2: "docusaurus-2",
  Dojo: "dojo",
  Eleventy: "eleventy",
  Elysia: "elysia",
  Ember: "ember",
  Eve: "eve",
  Express: "express",
  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",
  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",
  CreateReactApp: "create-react-app",
  Django: "django",
  Docusaurus: "docusaurus",
  Docusaurus2: "docusaurus-2",
  Dojo: "dojo",
  Eleventy: "eleventy",
  Elysia: "elysia",
  Ember: "ember",
  Eve: "eve",
  Express: "express",
  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",
  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 Services = {
  /**
   * 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 CreateProjectBuilds = {
  use: string;
  src?: string | undefined;
  dest?: string | undefined;
};

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

export type LatestDeployments = {
  alias?: Array<string> | undefined;
  aliasAssigned?: number | boolean | null | undefined;
  builds?: Array<CreateProjectBuilds> | undefined;
  createdAt: number;
  createdIn: string;
  creator: CreateProjectCreator | null;
  deploymentHostname: string;
  name: string;
  forced?: boolean | undefined;
  id: string;
  meta?: { [k: string]: string } | undefined;
  plan: string;
  private: boolean;
  readyState: string;
  requestedAt?: number | undefined;
  target?: string | null | undefined;
  teamId?: string | null | undefined;
  type: string;
  url: string;
  userId: string;
  withCache?: boolean | undefined;
};

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

export type Link6 = {
  org: string;
  repo: 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;

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 = {};

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

export type CreateProjectPassport = {
  deploymentType: CreateProjectProjectsDeploymentType;
  connectorId: string;
};

export type SandboxUrls = {
  inheritDeploymentProtection?: boolean | undefined;
};

export type ProtectionConfig = {
  sandboxUrls?: SandboxUrls | undefined;
};

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

export const CreateProjectBuildMachineType = {
  Enhanced: "enhanced",
  Standard: "standard",
  Turbo: "turbo",
} as const;
export type CreateProjectBuildMachineType = ClosedEnum<
  typeof CreateProjectBuildMachineType
>;

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

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

export type CreateProjectProjectsBuildQueue = {
  configuration?: CreateProjectProjectsConfiguration | undefined;
};

export type CreateProjectProjectsResourceConfig = {
  elasticConcurrencyEnabled?: boolean | undefined;
  fluid?: boolean | undefined;
  functionDefaultRegions: Array<string>;
  functionDefaultTimeout?: number | undefined;
  functionDefaultMemoryType?:
    | CreateProjectFunctionDefaultMemoryType
    | undefined;
  functionZeroConfigFailover?: boolean | undefined;
  buildMachineType?: CreateProjectBuildMachineType | undefined;
  buildMachineSelection?: CreateProjectBuildMachineSelection | undefined;
  buildMachineElasticLastUpdated?: number | undefined;
  isNSNBDisabled?: boolean | undefined;
  buildQueue?: CreateProjectProjectsBuildQueue | undefined;
  enableFunctionsBeta?: boolean | undefined;
};

/**
 * Description of why a project was rolled back, and by whom. Note that lastAliasRequest contains the from/to details of the rollback.
 */
export type CreateProjectRollbackDescription = {
  /**
   * The user who rolled back the project.
   */
  userId: string;
  /**
   * The username of the user who rolled back the project.
   */
  username: string;
  /**
   * User-supplied explanation of why they rolled back the project. Limited to 250 characters.
   */
  description: string;
  /**
   * Timestamp of when the rollback was requested.
   */
  createdAt: number;
};

/**
 * An array of all the stages required during a deployment release. Each stage defines a target percentage and advancement rules. The final stage must always have targetPercentage: 100.
 */
export type Stages = {
  /**
   * The percentage of traffic to serve to the canary deployment (0-100)
   */
  targetPercentage: number;
  /**
   * Whether or not this stage requires manual approval to proceed
   */
  requireApproval?: boolean | undefined;
  /**
   * Duration in minutes for automatic advancement to the next stage
   */
  duration?: number | undefined;
  /**
   * Whether to linearly shift traffic over the duration of this stage
   */
  linearShift?: boolean | undefined;
};

/**
 * Project-level rolling release configuration that defines how deployments should be gradually rolled out
 */
export type RollingRelease = {
  /**
   * The environment that the release targets, currently only supports production. Adding in case we want to configure with alias groups or custom environments.
   */
  target: string;
  /**
   * An array of all the stages required during a deployment release. Each stage defines a target percentage and advancement rules. The final stage must always have targetPercentage: 100.
   */
  stages?: Array<Stages> | null | undefined;
  /**
   * Whether the request served by a canary deployment should return a header indicating a canary was served. Defaults to `false` when omitted.
   */
  canaryResponseHeader?: boolean | undefined;
};

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

export const CreateProjectProjectsBuildMachineType = {
  Enhanced: "enhanced",
  Standard: "standard",
  Turbo: "turbo",
} as const;
export type CreateProjectProjectsBuildMachineType = ClosedEnum<
  typeof CreateProjectProjectsBuildMachineType
>;

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

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

export type CreateProjectProjectsResponseBuildQueue = {
  configuration?: CreateProjectProjectsResponseConfiguration | undefined;
};

export type DefaultResourceConfig = {
  elasticConcurrencyEnabled?: boolean | undefined;
  fluid?: boolean | undefined;
  functionDefaultRegions: Array<string>;
  functionDefaultTimeout?: number | undefined;
  functionDefaultMemoryType?:
    | CreateProjectProjectsFunctionDefaultMemoryType
    | undefined;
  functionZeroConfigFailover?: boolean | undefined;
  buildMachineType?: CreateProjectProjectsBuildMachineType | undefined;
  buildMachineSelection?:
    | CreateProjectProjectsBuildMachineSelection
    | undefined;
  buildMachineElasticLastUpdated?: number | undefined;
  isNSNBDisabled?: boolean | undefined;
  buildQueue?: CreateProjectProjectsResponseBuildQueue | undefined;
  enableFunctionsBeta?: boolean | undefined;
};

export type CreateProjectStaticIps = {
  builds: boolean;
  enabled: boolean;
  regions: Array<string>;
};

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

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

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

export type CreateProjectProjectsSsoProtection = {
  deploymentType: CreateProjectProjectsResponseDeploymentType;
  cve55182MigrationAppliedFrom?:
    | CreateProjectCve55182MigrationAppliedFrom
    | null
    | undefined;
  april2026SecurityIncidentMigrationAppliedFrom?:
    | CreateProjectApril2026SecurityIncidentMigrationAppliedFrom
    | null
    | undefined;
};

export type CreateProjectAliasAssigned = number | boolean;

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

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

export type CreateProjectTargets = {
  alias?: Array<string> | undefined;
  aliasAssigned?: number | boolean | null | undefined;
  builds?: Array<CreateProjectProjectsBuilds> | undefined;
  createdAt: number;
  createdIn: string;
  creator: CreateProjectProjectsCreator | null;
  deploymentHostname: string;
  name: string;
  forced?: boolean | undefined;
  id: string;
  meta?: { [k: string]: string } | undefined;
  plan: string;
  private: boolean;
  readyState: string;
  requestedAt?: number | undefined;
  target?: string | null | undefined;
  teamId?: string | null | undefined;
  type: string;
  url: string;
  userId: string;
  withCache?: boolean | undefined;
};

export type CreateProjectPermissions = {
  oauth2Connection?: Array<ACLAction> | undefined;
  user?: Array<ACLAction> | undefined;
  userConnection?: Array<ACLAction> | undefined;
  userMfaConfiguration?: Array<ACLAction> | undefined;
  userPreference?: Array<ACLAction> | undefined;
  userSudo?: Array<ACLAction> | undefined;
  webAuthn?: Array<ACLAction> | undefined;
  accessGroup?: Array<ACLAction> | undefined;
  agent?: Array<ACLAction> | undefined;
  aiGatewayRules?: Array<ACLAction> | undefined;
  aiGatewayUsage?: Array<ACLAction> | undefined;
  alerts?: Array<ACLAction> | undefined;
  alertRules?: Array<ACLAction> | undefined;
  aliasGlobal?: Array<ACLAction> | undefined;
  analyticsSampling?: Array<ACLAction> | undefined;
  analyticsUsage?: Array<ACLAction> | undefined;
  apiKey?: Array<ACLAction> | undefined;
  apiKeyAiGateway?: Array<ACLAction> | undefined;
  apiKeyOwnedBySelf?: Array<ACLAction> | undefined;
  oauth2Application?: Array<ACLAction> | undefined;
  vercelAppInstallation?: Array<ACLAction> | undefined;
  vercelAppInstallationRequest?: Array<ACLAction> | undefined;
  auditLog?: Array<ACLAction> | undefined;
  billingAddress?: Array<ACLAction> | undefined;
  billingInformation?: Array<ACLAction> | undefined;
  billingInvoice?: Array<ACLAction> | undefined;
  billingInvoiceEmailRecipient?: Array<ACLAction> | undefined;
  billingInvoiceLanguage?: Array<ACLAction> | undefined;
  billingPlan?: Array<ACLAction> | undefined;
  billingPurchaseOrder?: Array<ACLAction> | undefined;
  billingRefund?: Array<ACLAction> | undefined;
  billingTaxId?: Array<ACLAction> | undefined;
  blob?: Array<ACLAction> | undefined;
  blobStoreTokenSet?: Array<ACLAction> | undefined;
  budget?: Array<ACLAction> | undefined;
  cacheArtifact?: Array<ACLAction> | undefined;
  cacheArtifactUsageEvent?: Array<ACLAction> | undefined;
  codeChecks?: Array<ACLAction> | undefined;
  ciInvocations?: Array<ACLAction> | undefined;
  ciLogs?: Array<ACLAction> | undefined;
  concurrentBuilds?: Array<ACLAction> | undefined;
  connect?: Array<ACLAction> | undefined;
  connectConfiguration?: Array<ACLAction> | undefined;
  connexClient?: Array<ACLAction> | undefined;
  connexClientProject?: Array<ACLAction> | undefined;
  connexToken?: Array<ACLAction> | undefined;
  buildMachineDefault?: Array<ACLAction> | undefined;
  dataCacheBillingSettings?: Array<ACLAction> | undefined;
  defaultDeploymentProtection?: Array<ACLAction> | undefined;
  deploymentPolicy?: Array<ACLAction> | undefined;
  domain?: Array<ACLAction> | undefined;
  domainAcceptDelegation?: Array<ACLAction> | undefined;
  domainAuthCodes?: Array<ACLAction> | undefined;
  domainCertificate?: Array<ACLAction> | undefined;
  domainCheckConfig?: Array<ACLAction> | undefined;
  domainMove?: Array<ACLAction> | undefined;
  domainPurchase?: Array<ACLAction> | undefined;
  domainRecord?: Array<ACLAction> | undefined;
  domainTransferIn?: Array<ACLAction> | undefined;
  drain?: Array<ACLAction> | undefined;
  edgeConfig?: Array<ACLAction> | undefined;
  edgeConfigItem?: Array<ACLAction> | undefined;
  edgeConfigSchema?: Array<ACLAction> | undefined;
  edgeConfigToken?: Array<ACLAction> | undefined;
  endpointVerification?: Array<ACLAction> | undefined;
  event?: Array<ACLAction> | undefined;
  fileUpload?: Array<ACLAction> | undefined;
  flagsExplorerSubscription?: Array<ACLAction> | undefined;
  gitRepository?: Array<ACLAction> | undefined;
  imageOptimizationNewPrice?: Array<ACLAction> | undefined;
  integration?: Array<ACLAction> | undefined;
  integrationAccount?: Array<ACLAction> | undefined;
  integrationConfiguration?: Array<ACLAction> | undefined;
  integrationConfigurationProjects?: Array<ACLAction> | undefined;
  integrationConfigurationRole?: Array<ACLAction> | undefined;
  integrationConfigurationTransfer?: Array<ACLAction> | undefined;
  integrationDeploymentAction?: Array<ACLAction> | undefined;
  integrationEvent?: Array<ACLAction> | undefined;
  integrationLog?: Array<ACLAction> | undefined;
  integrationResource?: Array<ACLAction> | undefined;
  integrationResourceData?: Array<ACLAction> | undefined;
  integrationResourceReplCommand?: Array<ACLAction> | undefined;
  integrationResourceSecrets?: Array<ACLAction> | undefined;
  integrationSSOSession?: Array<ACLAction> | undefined;
  integrationStrict?: Array<ACLAction> | undefined;
  integrationStoreTokenSet?: Array<ACLAction> | undefined;
  integrationVercelConfigurationOverride?: Array<ACLAction> | undefined;
  integrationPullRequest?: Array<ACLAction> | undefined;
  ipBlocking?: Array<ACLAction> | undefined;
  jobGlobal?: Array<ACLAction> | undefined;
  kmsIssuer?: Array<ACLAction> | undefined;
  kmsProjectGrant?: Array<ACLAction> | undefined;
  logDrain?: Array<ACLAction> | undefined;
  marketplaceBillingData?: Array<ACLAction> | undefined;
  marketplaceExperimentationEdgeConfigData?: Array<ACLAction> | undefined;
  marketplaceExperimentationItem?: Array<ACLAction> | undefined;
  marketplaceInstallationMember?: Array<ACLAction> | undefined;
  marketplaceInvoice?: Array<ACLAction> | undefined;
  marketplaceSettings?: Array<ACLAction> | undefined;
  monitoring?: Array<ACLAction> | undefined;
  monitoringAlert?: Array<ACLAction> | undefined;
  monitoringChart?: Array<ACLAction> | undefined;
  monitoringQuery?: Array<ACLAction> | undefined;
  monitoringSettings?: Array<ACLAction> | undefined;
  notificationCustomerBudget?: Array<ACLAction> | undefined;
  notificationDeploymentFailed?: Array<ACLAction> | undefined;
  notificationDomainConfiguration?: Array<ACLAction> | undefined;
  notificationDomainExpire?: Array<ACLAction> | undefined;
  notificationDomainMoved?: Array<ACLAction> | undefined;
  notificationDomainPurchase?: Array<ACLAction> | undefined;
  notificationDomainRenewal?: Array<ACLAction> | undefined;
  notificationDomainTransfer?: Array<ACLAction> | undefined;
  notificationDomainUnverified?: Array<ACLAction> | undefined;
  notificationMonitoringAlert?: Array<ACLAction> | undefined;
  notificationPaymentFailed?: Array<ACLAction> | undefined;
  notificationPreferences?: Array<ACLAction> | undefined;
  notificationStatementOfReasons?: Array<ACLAction> | undefined;
  notificationUsageAlert?: Array<ACLAction> | undefined;
  oidcFederationPolicy?: Array<ACLAction> | undefined;
  observabilityConfiguration?: Array<ACLAction> | undefined;
  observabilityFunnel?: Array<ACLAction> | undefined;
  observabilityNotebook?: Array<ACLAction> | undefined;
  openTelemetryEndpoint?: Array<ACLAction> | undefined;
  ownEvent?: Array<ACLAction> | undefined;
  organization?: Array<ACLAction> | undefined;
  organizationDomain?: Array<ACLAction> | undefined;
  organizationTeam?: Array<ACLAction> | undefined;
  passwordProtectionInvoiceItem?: Array<ACLAction> | undefined;
  paymentMethod?: Array<ACLAction> | undefined;
  permissions?: Array<ACLAction> | undefined;
  postgres?: Array<ACLAction> | undefined;
  postgresStoreTokenSet?: Array<ACLAction> | undefined;
  previewDeploymentSuffix?: Array<ACLAction> | undefined;
  privateCloudAccount?: Array<ACLAction> | undefined;
  projectTransferIn?: Array<ACLAction> | undefined;
  proTrialOnboarding?: Array<ACLAction> | undefined;
  rateLimit?: Array<ACLAction> | undefined;
  redis?: Array<ACLAction> | undefined;
  redisStoreTokenSet?: Array<ACLAction> | undefined;
  remoteCaching?: Array<ACLAction> | undefined;
  repository?: Array<ACLAction> | undefined;
  samlConfig?: Array<ACLAction> | undefined;
  secret?: Array<ACLAction> | undefined;
  sensitiveEnvironmentVariablePolicy?: Array<ACLAction> | undefined;
  sharedEnvVars?: Array<ACLAction> | undefined;
  sharedEnvVarsProduction?: Array<ACLAction> | undefined;
  space?: Array<ACLAction> | undefined;
  spaceRun?: Array<ACLAction> | undefined;
  storeIsLocked?: Array<ACLAction> | undefined;
  storeTokenSetSensitive?: Array<ACLAction> | undefined;
  storeTransfer?: Array<ACLAction> | undefined;
  supportCase?: Array<ACLAction> | undefined;
  supportCaseComment?: Array<ACLAction> | undefined;
  team?: Array<ACLAction> | undefined;
  teamAccessRequest?: Array<ACLAction> | undefined;
  teamFellowMembership?: Array<ACLAction> | undefined;
  teamGitExclusivity?: Array<ACLAction> | undefined;
  teamInvite?: Array<ACLAction> | undefined;
  teamInviteCode?: Array<ACLAction> | undefined;
  teamInviteLink?: Array<ACLAction> | undefined;
  teamJoin?: Array<ACLAction> | undefined;
  teamMemberMfaStatus?: Array<ACLAction> | undefined;
  teamMicrofrontends?: Array<ACLAction> | undefined;
  teamOwnMembership?: Array<ACLAction> | undefined;
  teamOwnMembershipDisconnectSAML?: Array<ACLAction> | undefined;
  teamSudo?: Array<ACLAction> | undefined;
  teamTokenInvalidation?: Array<ACLAction> | undefined;
  token?: Array<ACLAction> | undefined;
  toolbarComment?: Array<ACLAction> | undefined;
  usage?: Array<ACLAction> | undefined;
  usageCycle?: Array<ACLAction> | undefined;
  vcrRepository?: Array<ACLAction> | undefined;
  vercelRun?: Array<ACLAction> | undefined;
  vpcPeeringConnection?: Array<ACLAction> | undefined;
  webAnalyticsPlan?: Array<ACLAction> | undefined;
  webhook?: Array<ACLAction> | undefined;
  webhookEvent?: Array<ACLAction> | undefined;
  aliasProject?: Array<ACLAction> | undefined;
  aliasProtectionBypass?: Array<ACLAction> | undefined;
  bulkRedirects?: Array<ACLAction> | undefined;
  buildMachine?: Array<ACLAction> | undefined;
  connectConfigurationLink?: Array<ACLAction> | undefined;
  dataCacheNamespace?: Array<ACLAction> | undefined;
  deployment?: Array<ACLAction> | undefined;
  deploymentBuildLogs?: Array<ACLAction> | undefined;
  deploymentCheck?: Array<ACLAction> | undefined;
  deploymentCheckPreview?: Array<ACLAction> | undefined;
  deploymentCheckReRunFromProductionBranch?: Array<ACLAction> | undefined;
  deploymentProductionGit?: Array<ACLAction> | undefined;
  deploymentV0?: Array<ACLAction> | undefined;
  deploymentPreview?: Array<ACLAction> | undefined;
  deploymentPrivate?: Array<ACLAction> | undefined;
  deploymentPromote?: Array<ACLAction> | undefined;
  deploymentRollback?: Array<ACLAction> | undefined;
  edgeCacheNamespace?: Array<ACLAction> | undefined;
  environments?: Array<ACLAction> | undefined;
  job?: Array<ACLAction> | undefined;
  logs?: Array<ACLAction> | undefined;
  logsPreset?: Array<ACLAction> | undefined;
  observabilityData?: Array<ACLAction> | undefined;
  onDemandBuild?: Array<ACLAction> | undefined;
  onDemandConcurrency?: Array<ACLAction> | undefined;
  optionsAllowlist?: Array<ACLAction> | undefined;
  passwordProtection?: Array<ACLAction> | undefined;
  privateLinkEndpoint?: Array<ACLAction> | undefined;
  productionAliasProtectionBypass?: Array<ACLAction> | undefined;
  project?: Array<ACLAction> | undefined;
  projectAccessGroup?: Array<ACLAction> | undefined;
  projectAnalyticsSampling?: Array<ACLAction> | undefined;
  projectAnalyticsUsage?: Array<ACLAction> | undefined;
  projectCheck?: Array<ACLAction> | undefined;
  projectCheckRun?: Array<ACLAction> | undefined;
  projectDeploymentExpiration?: Array<ACLAction> | undefined;
  projectDeploymentHook?: Array<ACLAction> | undefined;
  projectDeploymentProtectionStrict?: Array<ACLAction> | undefined;
  projectDomain?: Array<ACLAction> | undefined;
  projectDomainCheckConfig?: Array<ACLAction> | undefined;
  projectDomainMove?: Array<ACLAction> | undefined;
  projectEvent?: Array<ACLAction> | undefined;
  projectEnvVars?: Array<ACLAction> | undefined;
  projectEnvVarsProduction?: Array<ACLAction> | undefined;
  projectEnvVarsUnownedByIntegration?: Array<ACLAction> | undefined;
  projectFlags?: Array<ACLAction> | undefined;
  projectFlagsProduction?: Array<ACLAction> | undefined;
  projectFlagsSDKKey?: Array<ACLAction> | undefined;
  projectFromV0?: Array<ACLAction> | undefined;
  projectId?: Array<ACLAction> | undefined;
  projectIntegrationConfiguration?: Array<ACLAction> | undefined;
  projectLink?: Array<ACLAction> | undefined;
  projectMember?: Array<ACLAction> | undefined;
  projectMonitoring?: Array<ACLAction> | undefined;
  projectOIDCToken?: Array<ACLAction> | undefined;
  projectPermissions?: Array<ACLAction> | undefined;
  projectProductionBranch?: Array<ACLAction> | undefined;
  projectProtectionBypass?: Array<ACLAction> | undefined;
  projectRollingRelease?: Array<ACLAction> | undefined;
  projectRoutes?: Array<ACLAction> | undefined;
  projectSupportCase?: Array<ACLAction> | undefined;
  projectSupportCaseComment?: Array<ACLAction> | undefined;
  projectTier?: Array<ACLAction> | undefined;
  projectTransfer?: Array<ACLAction> | undefined;
  projectTransferOut?: Array<ACLAction> | undefined;
  projectUsage?: Array<ACLAction> | undefined;
  pageIntegrity?: Array<ACLAction> | undefined;
  seawallConfig?: Array<ACLAction> | undefined;
  securityPlusConfiguration?: Array<ACLAction> | undefined;
  shareableLinkStrict?: Array<ACLAction> | undefined;
  sharedEnvVarConnection?: Array<ACLAction> | undefined;
  skewProtection?: Array<ACLAction> | undefined;
  analytics?: Array<ACLAction> | undefined;
  trustedIps?: Array<ACLAction> | undefined;
  trustedSources?: Array<ACLAction> | undefined;
  v0Chat?: Array<ACLAction> | undefined;
  webAnalytics?: Array<ACLAction> | undefined;
};

export type LastRollbackTarget = {};

export const JobStatus = {
  Failed: "failed",
  InProgress: "in-progress",
  Pending: "pending",
  Skipped: "skipped",
  Succeeded: "succeeded",
} as const;
export type JobStatus = ClosedEnum<typeof JobStatus>;

export const CreateProjectProjectsResponse200ApplicationJSONType = {
  Promote: "promote",
  Rollback: "rollback",
} as const;
export type CreateProjectProjectsResponse200ApplicationJSONType = ClosedEnum<
  typeof CreateProjectProjectsResponse200ApplicationJSONType
>;

export type LastAliasRequest = {
  fromDeploymentId: string | null;
  toDeploymentId: string;
  /**
   * If rolling back from a rolling release, fromDeploymentId captures the "base" of that rolling release, and fromRollingReleaseId captures the "target" of that rolling release.
   */
  fromRollingReleaseId?: string | undefined;
  jobStatus: JobStatus;
  requestedAt: number;
  type: CreateProjectProjectsResponse200ApplicationJSONType;
};

export type ProtectionBypass2 = {
  createdAt: number;
  createdBy: string;
  scope: "automation-bypass";
  /**
   * When there was only one bypass, it was automatically set as an env var on deployments. With multiple bypasses, there is always one bypass that is selected as the default, and gets set as an env var on deployments. As this is a new field, undefined means that the bypass is the env var. If there are any automation bypasses, exactly one must be the env var.
   */
  isEnvVar?: boolean | undefined;
  /**
   * Optional note about the bypass to be displayed in the UI
   */
  note?: string | undefined;
};

export type ProtectionBypass1 = {
  createdAt: number;
  createdBy: string;
  scope: "integration-automation-bypass";
  integrationId: string;
  configurationId: string;
};

export type ProtectionBypass = ProtectionBypass1 | ProtectionBypass2;

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

export type TrustedIps2 = {
  deploymentType: CreateProjectTrustedIpsDeploymentType;
};

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

export type TrustedIpsAddresses = {
  value: string;
  note?: string | undefined;
};

export const TrustedIpsProtectionMode = {
  Additional: "additional",
  Exclusive: "exclusive",
} as const;
export type TrustedIpsProtectionMode = ClosedEnum<
  typeof TrustedIpsProtectionMode
>;

export type TrustedIps1 = {
  deploymentType: TrustedIpsDeploymentType;
  addresses: Array<TrustedIpsAddresses>;
  protectionMode: TrustedIpsProtectionMode;
};

export type CreateProjectTrustedIps = TrustedIps1 | TrustedIps2;

export const CreateProjectFromPreset = {
  AllCustom: "all-custom",
} as const;
export type CreateProjectFromPreset = ClosedEnum<
  typeof CreateProjectFromPreset
>;

/**
 * The source envs on the trusted project that are allowed to access `to`.
 */
export type CreateProjectFrom2 = {
  /**
   * System environment slugs (`production`, `preview`) and/or custom environment slugs defined on the referenced project.
   */
  slugs?: Array<string> | undefined;
  preset: CreateProjectFromPreset;
};

export const CreateProjectFromProjectsPreset = {
  AllCustom: "all-custom",
} as const;
export type CreateProjectFromProjectsPreset = ClosedEnum<
  typeof CreateProjectFromProjectsPreset
>;

/**
 * The source envs on the trusted project that are allowed to access `to`.
 */
export type CreateProjectFrom1 = {
  /**
   * System environment slugs (`production`, `preview`) and/or custom environment slugs defined on the referenced project.
   */
  slugs: Array<string>;
  preset?: CreateProjectFromProjectsPreset | undefined;
};

export type CreateProjectFrom = CreateProjectFrom1 | CreateProjectFrom2;

export const CreateProjectToProjectsResponse200Preset = {
  AllCustom: "all-custom",
} as const;
export type CreateProjectToProjectsResponse200Preset = ClosedEnum<
  typeof CreateProjectToProjectsResponse200Preset
>;

/**
 * The target envs on the current project that may be accessed.
 */
export type CreateProjectToProjects2 = {
  /**
   * System environment slugs (`production`, `preview`) and/or custom environment slugs defined on the referenced project.
   */
  slugs?: Array<string> | undefined;
  preset: CreateProjectToProjectsResponse200Preset;
};

export const CreateProjectToProjectsResponsePreset = {
  AllCustom: "all-custom",
} as const;
export type CreateProjectToProjectsResponsePreset = ClosedEnum<
  typeof CreateProjectToProjectsResponsePreset
>;

/** @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 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 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;
  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(),
  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;
  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(),
  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 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()),
  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 CreateProjectProjectsTarget$inboundSchema: z.ZodType<
  CreateProjectProjectsTarget,
  z.ZodTypeDef,
  unknown
> = smartUnion([
  z.array(CreateProjectTarget1$inboundSchema),
  CreateProjectTarget2$inboundSchema,
]);

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

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

/** @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()),
  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 CreateProjectProjectsResponse200ApplicationJSONResponseBodyType$inboundSchema:
  z.ZodNativeEnum<
    typeof CreateProjectProjectsResponse200ApplicationJSONResponseBodyType
  > = z.nativeEnum(
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyType,
  );

/** @internal */
export const CreateProjectBranchMatcher$inboundSchema: z.ZodType<
  CreateProjectBranchMatcher,
  z.ZodTypeDef,
  unknown
> = z.object({
  type:
    CreateProjectProjectsResponse200ApplicationJSONResponseBodyType$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 CustomEnvironments$inboundSchema: z.ZodType<
  CustomEnvironments,
  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 customEnvironmentsFromJSON(
  jsonString: string,
): SafeParseResult<CustomEnvironments, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => CustomEnvironments$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'CustomEnvironments' 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 Services$inboundSchema: z.ZodType<
  Services,
  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 servicesFromJSON(
  jsonString: string,
): SafeParseResult<Services, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => Services$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'Services' 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 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 CreateProjectCreator$inboundSchema: z.ZodType<
  CreateProjectCreator,
  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 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 LatestDeployments$inboundSchema: z.ZodType<
  LatestDeployments,
  z.ZodTypeDef,
  unknown
> = z.object({
  alias: types.optional(z.array(types.string())),
  aliasAssigned: z.nullable(smartUnion([types.number(), types.boolean()]))
    .optional(),
  builds: types.optional(
    z.array(z.lazy(() => CreateProjectBuilds$inboundSchema)),
  ),
  createdAt: types.number(),
  createdIn: types.string(),
  creator: types.nullable(z.lazy(() => CreateProjectCreator$inboundSchema)),
  deploymentHostname: types.string(),
  name: types.string(),
  forced: types.optional(types.boolean()),
  id: types.string(),
  meta: types.optional(z.record(types.string())),
  plan: types.string(),
  private: types.boolean(),
  readyState: types.string(),
  requestedAt: types.optional(types.number()),
  target: z.nullable(types.string()).optional(),
  teamId: z.nullable(types.string()).optional(),
  type: types.string(),
  url: types.string(),
  userId: 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 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(),
    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),
  ]);

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 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`,
  );
}

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

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

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

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

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

/** @internal */
export const ProtectionConfig$inboundSchema: z.ZodType<
  ProtectionConfig,
  z.ZodTypeDef,
  unknown
> = z.object({
  sandboxUrls: types.optional(z.lazy(() => SandboxUrls$inboundSchema)),
});

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

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

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

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

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

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

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

/** @internal */
export const CreateProjectProjectsResourceConfig$inboundSchema: z.ZodType<
  CreateProjectProjectsResourceConfig,
  z.ZodTypeDef,
  unknown
> = z.object({
  elasticConcurrencyEnabled: types.optional(types.boolean()),
  fluid: types.optional(types.boolean()),
  functionDefaultRegions: z.array(types.string()),
  functionDefaultTimeout: types.optional(types.number()),
  functionDefaultMemoryType: types.optional(
    CreateProjectFunctionDefaultMemoryType$inboundSchema,
  ),
  functionZeroConfigFailover: types.optional(types.boolean()),
  buildMachineType: types.optional(CreateProjectBuildMachineType$inboundSchema),
  buildMachineSelection: types.optional(
    CreateProjectBuildMachineSelection$inboundSchema,
  ),
  buildMachineElasticLastUpdated: types.optional(types.number()),
  isNSNBDisabled: types.optional(types.boolean()),
  buildQueue: types.optional(
    z.lazy(() => CreateProjectProjectsBuildQueue$inboundSchema),
  ),
  enableFunctionsBeta: types.optional(types.boolean()),
});

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

/** @internal */
export const CreateProjectRollbackDescription$inboundSchema: z.ZodType<
  CreateProjectRollbackDescription,
  z.ZodTypeDef,
  unknown
> = z.object({
  userId: types.string(),
  username: types.string(),
  description: types.string(),
  createdAt: types.number(),
});

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

/** @internal */
export const Stages$inboundSchema: z.ZodType<Stages, z.ZodTypeDef, unknown> = z
  .object({
    targetPercentage: types.number(),
    requireApproval: types.optional(types.boolean()),
    duration: types.optional(types.number()),
    linearShift: types.optional(types.boolean()),
  });

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

/** @internal */
export const RollingRelease$inboundSchema: z.ZodType<
  RollingRelease,
  z.ZodTypeDef,
  unknown
> = z.object({
  target: types.string(),
  stages: z.nullable(z.array(z.lazy(() => Stages$inboundSchema))).optional(),
  canaryResponseHeader: types.optional(types.boolean()),
});

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

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

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

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

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

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

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

/** @internal */
export const DefaultResourceConfig$inboundSchema: z.ZodType<
  DefaultResourceConfig,
  z.ZodTypeDef,
  unknown
> = z.object({
  elasticConcurrencyEnabled: types.optional(types.boolean()),
  fluid: types.optional(types.boolean()),
  functionDefaultRegions: z.array(types.string()),
  functionDefaultTimeout: types.optional(types.number()),
  functionDefaultMemoryType: types.optional(
    CreateProjectProjectsFunctionDefaultMemoryType$inboundSchema,
  ),
  functionZeroConfigFailover: types.optional(types.boolean()),
  buildMachineType: types.optional(
    CreateProjectProjectsBuildMachineType$inboundSchema,
  ),
  buildMachineSelection: types.optional(
    CreateProjectProjectsBuildMachineSelection$inboundSchema,
  ),
  buildMachineElasticLastUpdated: types.optional(types.number()),
  isNSNBDisabled: types.optional(types.boolean()),
  buildQueue: types.optional(
    z.lazy(() => CreateProjectProjectsResponseBuildQueue$inboundSchema),
  ),
  enableFunctionsBeta: types.optional(types.boolean()),
});

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

/** @internal */
export const CreateProjectStaticIps$inboundSchema: z.ZodType<
  CreateProjectStaticIps,
  z.ZodTypeDef,
  unknown
> = z.object({
  builds: types.boolean(),
  enabled: types.boolean(),
  regions: z.array(types.string()),
});

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

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

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

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

/** @internal */
export const CreateProjectProjectsSsoProtection$inboundSchema: z.ZodType<
  CreateProjectProjectsSsoProtection,
  z.ZodTypeDef,
  unknown
> = z.object({
  deploymentType: CreateProjectProjectsResponseDeploymentType$inboundSchema,
  cve55182MigrationAppliedFrom: z.nullable(
    CreateProjectCve55182MigrationAppliedFrom$inboundSchema,
  ).optional(),
  april2026SecurityIncidentMigrationAppliedFrom: z.nullable(
    CreateProjectApril2026SecurityIncidentMigrationAppliedFrom$inboundSchema,
  ).optional(),
});

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

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

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

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

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

/** @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 CreateProjectTargets$inboundSchema: z.ZodType<
  CreateProjectTargets,
  z.ZodTypeDef,
  unknown
> = z.object({
  alias: types.optional(z.array(types.string())),
  aliasAssigned: z.nullable(smartUnion([types.number(), types.boolean()]))
    .optional(),
  builds: types.optional(
    z.array(z.lazy(() => CreateProjectProjectsBuilds$inboundSchema)),
  ),
  createdAt: types.number(),
  createdIn: types.string(),
  creator: types.nullable(
    z.lazy(() => CreateProjectProjectsCreator$inboundSchema),
  ),
  deploymentHostname: types.string(),
  name: types.string(),
  forced: types.optional(types.boolean()),
  id: types.string(),
  meta: types.optional(z.record(types.string())),
  plan: types.string(),
  private: types.boolean(),
  readyState: types.string(),
  requestedAt: types.optional(types.number()),
  target: z.nullable(types.string()).optional(),
  teamId: z.nullable(types.string()).optional(),
  type: types.string(),
  url: types.string(),
  userId: types.string(),
  withCache: types.optional(types.boolean()),
});

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

/** @internal */
export const CreateProjectPermissions$inboundSchema: z.ZodType<
  CreateProjectPermissions,
  z.ZodTypeDef,
  unknown
> = z.object({
  oauth2Connection: types.optional(z.array(ACLAction$inboundSchema)),
  user: types.optional(z.array(ACLAction$inboundSchema)),
  userConnection: types.optional(z.array(ACLAction$inboundSchema)),
  userMfaConfiguration: types.optional(z.array(ACLAction$inboundSchema)),
  userPreference: types.optional(z.array(ACLAction$inboundSchema)),
  userSudo: types.optional(z.array(ACLAction$inboundSchema)),
  webAuthn: types.optional(z.array(ACLAction$inboundSchema)),
  accessGroup: types.optional(z.array(ACLAction$inboundSchema)),
  agent: types.optional(z.array(ACLAction$inboundSchema)),
  aiGatewayRules: types.optional(z.array(ACLAction$inboundSchema)),
  aiGatewayUsage: types.optional(z.array(ACLAction$inboundSchema)),
  alerts: types.optional(z.array(ACLAction$inboundSchema)),
  alertRules: types.optional(z.array(ACLAction$inboundSchema)),
  aliasGlobal: types.optional(z.array(ACLAction$inboundSchema)),
  analyticsSampling: types.optional(z.array(ACLAction$inboundSchema)),
  analyticsUsage: types.optional(z.array(ACLAction$inboundSchema)),
  apiKey: types.optional(z.array(ACLAction$inboundSchema)),
  apiKeyAiGateway: types.optional(z.array(ACLAction$inboundSchema)),
  apiKeyOwnedBySelf: types.optional(z.array(ACLAction$inboundSchema)),
  oauth2Application: types.optional(z.array(ACLAction$inboundSchema)),
  vercelAppInstallation: types.optional(z.array(ACLAction$inboundSchema)),
  vercelAppInstallationRequest: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  auditLog: types.optional(z.array(ACLAction$inboundSchema)),
  billingAddress: types.optional(z.array(ACLAction$inboundSchema)),
  billingInformation: types.optional(z.array(ACLAction$inboundSchema)),
  billingInvoice: types.optional(z.array(ACLAction$inboundSchema)),
  billingInvoiceEmailRecipient: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  billingInvoiceLanguage: types.optional(z.array(ACLAction$inboundSchema)),
  billingPlan: types.optional(z.array(ACLAction$inboundSchema)),
  billingPurchaseOrder: types.optional(z.array(ACLAction$inboundSchema)),
  billingRefund: types.optional(z.array(ACLAction$inboundSchema)),
  billingTaxId: types.optional(z.array(ACLAction$inboundSchema)),
  blob: types.optional(z.array(ACLAction$inboundSchema)),
  blobStoreTokenSet: types.optional(z.array(ACLAction$inboundSchema)),
  budget: types.optional(z.array(ACLAction$inboundSchema)),
  cacheArtifact: types.optional(z.array(ACLAction$inboundSchema)),
  cacheArtifactUsageEvent: types.optional(z.array(ACLAction$inboundSchema)),
  codeChecks: types.optional(z.array(ACLAction$inboundSchema)),
  ciInvocations: types.optional(z.array(ACLAction$inboundSchema)),
  ciLogs: types.optional(z.array(ACLAction$inboundSchema)),
  concurrentBuilds: types.optional(z.array(ACLAction$inboundSchema)),
  connect: types.optional(z.array(ACLAction$inboundSchema)),
  connectConfiguration: types.optional(z.array(ACLAction$inboundSchema)),
  connexClient: types.optional(z.array(ACLAction$inboundSchema)),
  connexClientProject: types.optional(z.array(ACLAction$inboundSchema)),
  connexToken: types.optional(z.array(ACLAction$inboundSchema)),
  buildMachineDefault: types.optional(z.array(ACLAction$inboundSchema)),
  dataCacheBillingSettings: types.optional(z.array(ACLAction$inboundSchema)),
  defaultDeploymentProtection: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentPolicy: types.optional(z.array(ACLAction$inboundSchema)),
  domain: types.optional(z.array(ACLAction$inboundSchema)),
  domainAcceptDelegation: types.optional(z.array(ACLAction$inboundSchema)),
  domainAuthCodes: types.optional(z.array(ACLAction$inboundSchema)),
  domainCertificate: types.optional(z.array(ACLAction$inboundSchema)),
  domainCheckConfig: types.optional(z.array(ACLAction$inboundSchema)),
  domainMove: types.optional(z.array(ACLAction$inboundSchema)),
  domainPurchase: types.optional(z.array(ACLAction$inboundSchema)),
  domainRecord: types.optional(z.array(ACLAction$inboundSchema)),
  domainTransferIn: types.optional(z.array(ACLAction$inboundSchema)),
  drain: types.optional(z.array(ACLAction$inboundSchema)),
  edgeConfig: types.optional(z.array(ACLAction$inboundSchema)),
  edgeConfigItem: types.optional(z.array(ACLAction$inboundSchema)),
  edgeConfigSchema: types.optional(z.array(ACLAction$inboundSchema)),
  edgeConfigToken: types.optional(z.array(ACLAction$inboundSchema)),
  endpointVerification: types.optional(z.array(ACLAction$inboundSchema)),
  event: types.optional(z.array(ACLAction$inboundSchema)),
  fileUpload: types.optional(z.array(ACLAction$inboundSchema)),
  flagsExplorerSubscription: types.optional(z.array(ACLAction$inboundSchema)),
  gitRepository: types.optional(z.array(ACLAction$inboundSchema)),
  imageOptimizationNewPrice: types.optional(z.array(ACLAction$inboundSchema)),
  integration: types.optional(z.array(ACLAction$inboundSchema)),
  integrationAccount: types.optional(z.array(ACLAction$inboundSchema)),
  integrationConfiguration: types.optional(z.array(ACLAction$inboundSchema)),
  integrationConfigurationProjects: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  integrationConfigurationRole: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  integrationConfigurationTransfer: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  integrationDeploymentAction: types.optional(z.array(ACLAction$inboundSchema)),
  integrationEvent: types.optional(z.array(ACLAction$inboundSchema)),
  integrationLog: types.optional(z.array(ACLAction$inboundSchema)),
  integrationResource: types.optional(z.array(ACLAction$inboundSchema)),
  integrationResourceData: types.optional(z.array(ACLAction$inboundSchema)),
  integrationResourceReplCommand: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  integrationResourceSecrets: types.optional(z.array(ACLAction$inboundSchema)),
  integrationSSOSession: types.optional(z.array(ACLAction$inboundSchema)),
  integrationStrict: types.optional(z.array(ACLAction$inboundSchema)),
  integrationStoreTokenSet: types.optional(z.array(ACLAction$inboundSchema)),
  integrationVercelConfigurationOverride: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  integrationPullRequest: types.optional(z.array(ACLAction$inboundSchema)),
  ipBlocking: types.optional(z.array(ACLAction$inboundSchema)),
  jobGlobal: types.optional(z.array(ACLAction$inboundSchema)),
  kmsIssuer: types.optional(z.array(ACLAction$inboundSchema)),
  kmsProjectGrant: types.optional(z.array(ACLAction$inboundSchema)),
  logDrain: types.optional(z.array(ACLAction$inboundSchema)),
  marketplaceBillingData: types.optional(z.array(ACLAction$inboundSchema)),
  marketplaceExperimentationEdgeConfigData: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  marketplaceExperimentationItem: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  marketplaceInstallationMember: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  marketplaceInvoice: types.optional(z.array(ACLAction$inboundSchema)),
  marketplaceSettings: types.optional(z.array(ACLAction$inboundSchema)),
  Monitoring: types.optional(z.array(ACLAction$inboundSchema)),
  monitoringAlert: types.optional(z.array(ACLAction$inboundSchema)),
  monitoringChart: types.optional(z.array(ACLAction$inboundSchema)),
  monitoringQuery: types.optional(z.array(ACLAction$inboundSchema)),
  monitoringSettings: types.optional(z.array(ACLAction$inboundSchema)),
  notificationCustomerBudget: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDeploymentFailed: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  notificationDomainConfiguration: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  notificationDomainExpire: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDomainMoved: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDomainPurchase: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDomainRenewal: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDomainTransfer: types.optional(z.array(ACLAction$inboundSchema)),
  notificationDomainUnverified: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  NotificationMonitoringAlert: types.optional(z.array(ACLAction$inboundSchema)),
  notificationPaymentFailed: types.optional(z.array(ACLAction$inboundSchema)),
  notificationPreferences: types.optional(z.array(ACLAction$inboundSchema)),
  notificationStatementOfReasons: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  notificationUsageAlert: types.optional(z.array(ACLAction$inboundSchema)),
  oidcFederationPolicy: types.optional(z.array(ACLAction$inboundSchema)),
  observabilityConfiguration: types.optional(z.array(ACLAction$inboundSchema)),
  observabilityFunnel: types.optional(z.array(ACLAction$inboundSchema)),
  observabilityNotebook: types.optional(z.array(ACLAction$inboundSchema)),
  openTelemetryEndpoint: types.optional(z.array(ACLAction$inboundSchema)),
  ownEvent: types.optional(z.array(ACLAction$inboundSchema)),
  organization: types.optional(z.array(ACLAction$inboundSchema)),
  organizationDomain: types.optional(z.array(ACLAction$inboundSchema)),
  organizationTeam: types.optional(z.array(ACLAction$inboundSchema)),
  passwordProtectionInvoiceItem: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  paymentMethod: types.optional(z.array(ACLAction$inboundSchema)),
  permissions: types.optional(z.array(ACLAction$inboundSchema)),
  postgres: types.optional(z.array(ACLAction$inboundSchema)),
  postgresStoreTokenSet: types.optional(z.array(ACLAction$inboundSchema)),
  previewDeploymentSuffix: types.optional(z.array(ACLAction$inboundSchema)),
  privateCloudAccount: types.optional(z.array(ACLAction$inboundSchema)),
  projectTransferIn: types.optional(z.array(ACLAction$inboundSchema)),
  proTrialOnboarding: types.optional(z.array(ACLAction$inboundSchema)),
  rateLimit: types.optional(z.array(ACLAction$inboundSchema)),
  redis: types.optional(z.array(ACLAction$inboundSchema)),
  redisStoreTokenSet: types.optional(z.array(ACLAction$inboundSchema)),
  remoteCaching: types.optional(z.array(ACLAction$inboundSchema)),
  repository: types.optional(z.array(ACLAction$inboundSchema)),
  samlConfig: types.optional(z.array(ACLAction$inboundSchema)),
  secret: types.optional(z.array(ACLAction$inboundSchema)),
  sensitiveEnvironmentVariablePolicy: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  sharedEnvVars: types.optional(z.array(ACLAction$inboundSchema)),
  sharedEnvVarsProduction: types.optional(z.array(ACLAction$inboundSchema)),
  space: types.optional(z.array(ACLAction$inboundSchema)),
  spaceRun: types.optional(z.array(ACLAction$inboundSchema)),
  storeIsLocked: types.optional(z.array(ACLAction$inboundSchema)),
  storeTokenSetSensitive: types.optional(z.array(ACLAction$inboundSchema)),
  storeTransfer: types.optional(z.array(ACLAction$inboundSchema)),
  supportCase: types.optional(z.array(ACLAction$inboundSchema)),
  supportCaseComment: types.optional(z.array(ACLAction$inboundSchema)),
  team: types.optional(z.array(ACLAction$inboundSchema)),
  teamAccessRequest: types.optional(z.array(ACLAction$inboundSchema)),
  teamFellowMembership: types.optional(z.array(ACLAction$inboundSchema)),
  teamGitExclusivity: types.optional(z.array(ACLAction$inboundSchema)),
  teamInvite: types.optional(z.array(ACLAction$inboundSchema)),
  teamInviteCode: types.optional(z.array(ACLAction$inboundSchema)),
  teamInviteLink: types.optional(z.array(ACLAction$inboundSchema)),
  teamJoin: types.optional(z.array(ACLAction$inboundSchema)),
  teamMemberMfaStatus: types.optional(z.array(ACLAction$inboundSchema)),
  teamMicrofrontends: types.optional(z.array(ACLAction$inboundSchema)),
  teamOwnMembership: types.optional(z.array(ACLAction$inboundSchema)),
  teamOwnMembershipDisconnectSAML: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  teamSudo: types.optional(z.array(ACLAction$inboundSchema)),
  teamTokenInvalidation: types.optional(z.array(ACLAction$inboundSchema)),
  token: types.optional(z.array(ACLAction$inboundSchema)),
  toolbarComment: types.optional(z.array(ACLAction$inboundSchema)),
  usage: types.optional(z.array(ACLAction$inboundSchema)),
  usageCycle: types.optional(z.array(ACLAction$inboundSchema)),
  vcrRepository: types.optional(z.array(ACLAction$inboundSchema)),
  vercelRun: types.optional(z.array(ACLAction$inboundSchema)),
  vpcPeeringConnection: types.optional(z.array(ACLAction$inboundSchema)),
  webAnalyticsPlan: types.optional(z.array(ACLAction$inboundSchema)),
  webhook: types.optional(z.array(ACLAction$inboundSchema)),
  "webhook-event": types.optional(z.array(ACLAction$inboundSchema)),
  aliasProject: types.optional(z.array(ACLAction$inboundSchema)),
  aliasProtectionBypass: types.optional(z.array(ACLAction$inboundSchema)),
  bulkRedirects: types.optional(z.array(ACLAction$inboundSchema)),
  buildMachine: types.optional(z.array(ACLAction$inboundSchema)),
  connectConfigurationLink: types.optional(z.array(ACLAction$inboundSchema)),
  dataCacheNamespace: types.optional(z.array(ACLAction$inboundSchema)),
  deployment: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentBuildLogs: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentCheck: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentCheckPreview: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentCheckReRunFromProductionBranch: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  deploymentProductionGit: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentV0: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentPreview: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentPrivate: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentPromote: types.optional(z.array(ACLAction$inboundSchema)),
  deploymentRollback: types.optional(z.array(ACLAction$inboundSchema)),
  edgeCacheNamespace: types.optional(z.array(ACLAction$inboundSchema)),
  environments: types.optional(z.array(ACLAction$inboundSchema)),
  job: types.optional(z.array(ACLAction$inboundSchema)),
  logs: types.optional(z.array(ACLAction$inboundSchema)),
  logsPreset: types.optional(z.array(ACLAction$inboundSchema)),
  observabilityData: types.optional(z.array(ACLAction$inboundSchema)),
  onDemandBuild: types.optional(z.array(ACLAction$inboundSchema)),
  onDemandConcurrency: types.optional(z.array(ACLAction$inboundSchema)),
  optionsAllowlist: types.optional(z.array(ACLAction$inboundSchema)),
  passwordProtection: types.optional(z.array(ACLAction$inboundSchema)),
  privateLinkEndpoint: types.optional(z.array(ACLAction$inboundSchema)),
  productionAliasProtectionBypass: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  project: types.optional(z.array(ACLAction$inboundSchema)),
  projectAccessGroup: types.optional(z.array(ACLAction$inboundSchema)),
  projectAnalyticsSampling: types.optional(z.array(ACLAction$inboundSchema)),
  projectAnalyticsUsage: types.optional(z.array(ACLAction$inboundSchema)),
  projectCheck: types.optional(z.array(ACLAction$inboundSchema)),
  projectCheckRun: types.optional(z.array(ACLAction$inboundSchema)),
  projectDeploymentExpiration: types.optional(z.array(ACLAction$inboundSchema)),
  projectDeploymentHook: types.optional(z.array(ACLAction$inboundSchema)),
  projectDeploymentProtectionStrict: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  projectDomain: types.optional(z.array(ACLAction$inboundSchema)),
  projectDomainCheckConfig: types.optional(z.array(ACLAction$inboundSchema)),
  projectDomainMove: types.optional(z.array(ACLAction$inboundSchema)),
  projectEvent: types.optional(z.array(ACLAction$inboundSchema)),
  projectEnvVars: types.optional(z.array(ACLAction$inboundSchema)),
  projectEnvVarsProduction: types.optional(z.array(ACLAction$inboundSchema)),
  projectEnvVarsUnownedByIntegration: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  projectFlags: types.optional(z.array(ACLAction$inboundSchema)),
  projectFlagsProduction: types.optional(z.array(ACLAction$inboundSchema)),
  projectFlagsSdkKey: types.optional(z.array(ACLAction$inboundSchema)),
  projectFromV0: types.optional(z.array(ACLAction$inboundSchema)),
  projectId: types.optional(z.array(ACLAction$inboundSchema)),
  projectIntegrationConfiguration: types.optional(
    z.array(ACLAction$inboundSchema),
  ),
  projectLink: types.optional(z.array(ACLAction$inboundSchema)),
  projectMember: types.optional(z.array(ACLAction$inboundSchema)),
  projectMonitoring: types.optional(z.array(ACLAction$inboundSchema)),
  projectOIDCToken: types.optional(z.array(ACLAction$inboundSchema)),
  projectPermissions: types.optional(z.array(ACLAction$inboundSchema)),
  projectProductionBranch: types.optional(z.array(ACLAction$inboundSchema)),
  projectProtectionBypass: types.optional(z.array(ACLAction$inboundSchema)),
  projectRollingRelease: types.optional(z.array(ACLAction$inboundSchema)),
  projectRoutes: types.optional(z.array(ACLAction$inboundSchema)),
  projectSupportCase: types.optional(z.array(ACLAction$inboundSchema)),
  projectSupportCaseComment: types.optional(z.array(ACLAction$inboundSchema)),
  projectTier: types.optional(z.array(ACLAction$inboundSchema)),
  projectTransfer: types.optional(z.array(ACLAction$inboundSchema)),
  projectTransferOut: types.optional(z.array(ACLAction$inboundSchema)),
  projectUsage: types.optional(z.array(ACLAction$inboundSchema)),
  pageIntegrity: types.optional(z.array(ACLAction$inboundSchema)),
  seawallConfig: types.optional(z.array(ACLAction$inboundSchema)),
  securityPlusConfiguration: types.optional(z.array(ACLAction$inboundSchema)),
  shareableLinkStrict: types.optional(z.array(ACLAction$inboundSchema)),
  sharedEnvVarConnection: types.optional(z.array(ACLAction$inboundSchema)),
  skewProtection: types.optional(z.array(ACLAction$inboundSchema)),
  analytics: types.optional(z.array(ACLAction$inboundSchema)),
  trustedIps: types.optional(z.array(ACLAction$inboundSchema)),
  trustedSources: types.optional(z.array(ACLAction$inboundSchema)),
  v0Chat: types.optional(z.array(ACLAction$inboundSchema)),
  webAnalytics: types.optional(z.array(ACLAction$inboundSchema)),
}).transform((v) => {
  return remap$(v, {
    "Monitoring": "monitoring",
    "NotificationMonitoringAlert": "notificationMonitoringAlert",
    "webhook-event": "webhookEvent",
    "projectFlagsSdkKey": "projectFlagsSDKKey",
  });
});

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

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

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

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

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

/** @internal */
export const LastAliasRequest$inboundSchema: z.ZodType<
  LastAliasRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  fromDeploymentId: types.nullable(types.string()),
  toDeploymentId: types.string(),
  fromRollingReleaseId: types.optional(types.string()),
  jobStatus: JobStatus$inboundSchema,
  requestedAt: types.number(),
  type: CreateProjectProjectsResponse200ApplicationJSONType$inboundSchema,
});

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

/** @internal */
export const ProtectionBypass2$inboundSchema: z.ZodType<
  ProtectionBypass2,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.number(),
  createdBy: types.string(),
  scope: types.literal("automation-bypass"),
  isEnvVar: types.optional(types.boolean()),
  note: types.optional(types.string()),
});

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

/** @internal */
export const ProtectionBypass1$inboundSchema: z.ZodType<
  ProtectionBypass1,
  z.ZodTypeDef,
  unknown
> = z.object({
  createdAt: types.number(),
  createdBy: types.string(),
  scope: types.literal("integration-automation-bypass"),
  integrationId: types.string(),
  configurationId: types.string(),
});

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const TrustedIps1$inboundSchema: z.ZodType<
  TrustedIps1,
  z.ZodTypeDef,
  unknown
> = z.object({
  deploymentType: TrustedIpsDeploymentType$inboundSchema,
  addresses: z.array(z.lazy(() => TrustedIpsAddresses$inboundSchema)),
  protectionMode: TrustedIpsProtectionMode$inboundSchema,
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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