UNPKG

@vercel/sdk

Version:

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

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

import * as z from "zod/v3";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

/**
 * The framework that is being used for this project. When `null` is used no framework is selected
 */
export const UpdateProjectFramework = {
  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 UpdateProjectFramework = ClosedEnum<typeof UpdateProjectFramework>;

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

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

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

export type UpdateProjectBuildQueue = {
  configuration?: UpdateProjectConfiguration | undefined;
};

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

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

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

/**
 * Manage Static IPs for this project
 */
export type UpdateProjectStaticIps = {
  /**
   * Opt-in to Static IPs for this project
   */
  enabled: boolean;
};

/**
 * Environment to apply sampling to
 */
export const UpdateProjectEnv = {
  Production: "production",
  Preview: "preview",
} as const;
/**
 * Environment to apply sampling to
 */
export type UpdateProjectEnv = ClosedEnum<typeof UpdateProjectEnv>;

export type SamplingRules = {
  /**
   * Sampling rate from 0 to 1
   */
  rate: number;
  /**
   * Environment to apply sampling to
   */
  env?: UpdateProjectEnv | undefined;
  /**
   * Request path prefix to apply the sampling rule to
   */
  requestPath?: string | undefined;
};

/**
 * Tracing configuration for this project
 */
export type Tracing = {
  /**
   * Comma-separated list of drain endpoint domains
   */
  domains?: string | undefined;
  /**
   * Paths to ignore for tracing
   */
  ignorePaths?: Array<string> | undefined;
  /**
   * Sampling rules for trace collection
   */
  samplingRules?: Array<SamplingRules> | undefined;
};

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

/**
 * OpenID Connect JSON Web Token generation configuration.
 */
export type UpdateProjectOidcTokenConfig = {
  /**
   * 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?: UpdateProjectIssuerMode | undefined;
};

/**
 * Specify if the password will apply to every Deployment Target or just Preview
 */
export const UpdateProjectDeploymentType = {
  All: "all",
  Preview: "preview",
  ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
  AllExceptCustomDomains: "all_except_custom_domains",
} as const;
/**
 * Specify if the password will apply to every Deployment Target or just Preview
 */
export type UpdateProjectDeploymentType = ClosedEnum<
  typeof UpdateProjectDeploymentType
>;

/**
 * Allows to protect project deployments with a password
 */
export type UpdateProjectPasswordProtection = {
  /**
   * Specify if the password will apply to every Deployment Target or just Preview
   */
  deploymentType: UpdateProjectDeploymentType;
  /**
   * The password that will be used to protect Project Deployments
   */
  password?: string | null | undefined;
};

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

/**
 * Passport configuration for the project.
 */
export type UpdateProjectPassport = {
  connectorId: string;
  deploymentType: UpdateProjectProjectsDeploymentType;
};

/**
 * Specify if the Vercel Authentication (SSO Protection) will apply to every Deployment Target or just Preview
 */
export const UpdateProjectProjectsRequestDeploymentType = {
  All: "all",
  Preview: "preview",
  ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
  AllExceptCustomDomains: "all_except_custom_domains",
} as const;
/**
 * Specify if the Vercel Authentication (SSO Protection) will apply to every Deployment Target or just Preview
 */
export type UpdateProjectProjectsRequestDeploymentType = ClosedEnum<
  typeof UpdateProjectProjectsRequestDeploymentType
>;

/**
 * Ensures visitors to your Preview Deployments are logged into Vercel and have a minimum of Viewer access on your team
 */
export type UpdateProjectSsoProtection = {
  /**
   * Specify if the Vercel Authentication (SSO Protection) will apply to every Deployment Target or just Preview
   */
  deploymentType?: UpdateProjectProjectsRequestDeploymentType | undefined;
};

/**
 * Specify if the Trusted IPs will apply to every Deployment Target or just Preview
 */
export const UpdateProjectProjectsRequestRequestBodyDeploymentType = {
  All: "all",
  Preview: "preview",
  Production: "production",
  ProdDeploymentUrlsAndAllPreviews: "prod_deployment_urls_and_all_previews",
  AllExceptCustomDomains: "all_except_custom_domains",
} as const;
/**
 * Specify if the Trusted IPs will apply to every Deployment Target or just Preview
 */
export type UpdateProjectProjectsRequestRequestBodyDeploymentType = ClosedEnum<
  typeof UpdateProjectProjectsRequestRequestBodyDeploymentType
>;

export type Addresses = {
  /**
   * The IP addresses that are allowlisted. Supports IPv4 addresses and CIDR notations. IPv6 is not supported
   */
  value: string;
  /**
   * An optional note explaining what the IP address or subnet is used for
   */
  note?: string | undefined;
};

/**
 * exclusive: ip match is enough to bypass deployment protection (regardless of other settings). additional: ip must match + any other protection should be also provided (password, vercel auth, shareable link, automation bypass header, automation bypass query param)
 */
export const ProtectionMode = {
  Exclusive: "exclusive",
  Additional: "additional",
} as const;
/**
 * exclusive: ip match is enough to bypass deployment protection (regardless of other settings). additional: ip must match + any other protection should be also provided (password, vercel auth, shareable link, automation bypass header, automation bypass query param)
 */
export type ProtectionMode = ClosedEnum<typeof ProtectionMode>;

/**
 * Restricts access to deployments based on the incoming request IP address
 */
export type UpdateProjectTrustedIps = {
  /**
   * Specify if the Trusted IPs will apply to every Deployment Target or just Preview
   */
  deploymentType: UpdateProjectProjectsRequestRequestBodyDeploymentType;
  addresses: Array<Addresses>;
  /**
   * exclusive: ip match is enough to bypass deployment protection (regardless of other settings). additional: ip must match + any other protection should be also provided (password, vercel auth, shareable link, automation bypass header, automation bypass query param)
   */
  protectionMode: ProtectionMode;
};

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

export type To2 = {
  slugs?: Array<string> | undefined;
  preset: ToPreset;
};

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

export type To1 = {
  slugs: Array<string>;
  preset?: Preset | undefined;
};

/**
 * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
 */
export type To = To1 | To2;

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

export type From2 = {
  slugs?: Array<string> | undefined;
  preset: UpdateProjectFromPreset;
};

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

export type From1 = {
  slugs: Array<string>;
  preset?: FromPreset | undefined;
};

/**
 * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
 */
export type From = From1 | From2;

export type CustomAllow = {
  /**
   * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
   */
  to: To1 | To2;
  /**
   * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
   */
  from: From1 | From2;
};

export type UpdateProjectProjects = {
  /**
   * The label or description of the trusted source
   */
  label?: string | undefined;
  /**
   * Optional overrides for the default same-env-by-slug matching.
   */
  customAllow?: Array<CustomAllow> | undefined;
};

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

export type UpdateProjectTo2 = {
  slugs?: Array<string> | undefined;
  preset: UpdateProjectToProjectsPreset;
};

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

export type UpdateProjectTo1 = {
  slugs: Array<string>;
  preset?: UpdateProjectToPreset | undefined;
};

/**
 * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
 */
export type UpdateProjectTo = UpdateProjectTo1 | UpdateProjectTo2;

export type OidcProviders = {
  /**
   * The label or description of the trusted source
   */
  label?: string | undefined;
  /**
   * A set of environments, expressed as explicit slugs, a named preset, or both. At least one of `slugs` or `preset` must be set.
   */
  to: UpdateProjectTo1 | UpdateProjectTo2;
  claims: { [k: string]: Array<string> };
};

/**
 * Deployment Protection Trusted Sources
 */
export type TrustedSources = {
  projects?: { [k: string]: UpdateProjectProjects } | undefined;
  oidcProviders?: { [k: string]: Array<OidcProviders> } | undefined;
};

export type UpdateProjectEnvironmentsProjects2 = {
  type: "custom";
  environmentId: string;
};

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

export type UpdateProjectEnvironmentsProjects1 = {
  type: "system";
  target: UpdateProjectEnvironmentsProjectsTarget;
};

export type GitSourcesEnvironments =
  | UpdateProjectEnvironmentsProjects1
  | UpdateProjectEnvironmentsProjects2;

export type UpdateProjectSources2 = {
  provider: "gitlab";
  namespace: string;
  project?: string | undefined;
};

export const UpdateProjectSourcesProjectsProvider = {
  Github: "github",
  Bitbucket: "bitbucket",
} as const;
export type UpdateProjectSourcesProjectsProvider = ClosedEnum<
  typeof UpdateProjectSourcesProjectsProvider
>;

export type UpdateProjectSources1 = {
  provider: UpdateProjectSourcesProjectsProvider;
  org: string;
  repo?: string | undefined;
};

export type GitSourcesSources =
  | (UpdateProjectSources1 & { provider: "github" })
  | (UpdateProjectSources1 & { provider: "bitbucket" })
  | UpdateProjectSources2;

export type GitSources1 = {
  enabled: boolean;
  environments: Array<
    UpdateProjectEnvironmentsProjects1 | UpdateProjectEnvironmentsProjects2
  >;
  sources: Array<
    | (UpdateProjectSources1 & { provider: "github" })
    | (UpdateProjectSources1 & { provider: "bitbucket" })
    | UpdateProjectSources2
  >;
};

export type DeploymentPolicyGitSources = Array<GitSources1> | string;

export type UpdateProjectEnvironments2 = {
  type: "custom";
  environmentId: string;
};

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

export type UpdateProjectEnvironments1 = {
  type: "system";
  target: UpdateProjectEnvironmentsTarget;
};

export type DeploymentSourcesEnvironments =
  | UpdateProjectEnvironments1
  | UpdateProjectEnvironments2;

export const DeploymentSourcesSources = {
  Git: "git",
  Cli: "cli",
  RestApi: "rest-api",
  DeployHook: "deploy-hook",
  Integration: "integration",
  V0: "v0",
} as const;
export type DeploymentSourcesSources = ClosedEnum<
  typeof DeploymentSourcesSources
>;

export type DeploymentSources1 = {
  enabled: boolean;
  environments: Array<UpdateProjectEnvironments1 | UpdateProjectEnvironments2>;
  sources: Array<DeploymentSourcesSources>;
};

export type DeploymentPolicyDeploymentSources =
  | Array<DeploymentSources1>
  | string;

/**
 * Composable deployment-time policy. Each rule type holds a list of rules, one per environment scope.
 */
export type DeploymentPolicy1 = {
  gitSources?: Array<GitSources1> | string | undefined;
  deploymentSources?: Array<DeploymentSources1> | string | undefined;
};

export type UpdateProjectDeploymentPolicy = DeploymentPolicy1 | string;

export type UpdateProjectPaths = {
  /**
   * The regex path that should not be protected by Deployment Protection
   */
  value: string;
};

/**
 * Specify a list of paths that should not be protected by Deployment Protection to enable Cors preflight requests
 */
export type UpdateProjectOptionsAllowlist = {
  paths: Array<UpdateProjectPaths>;
};

export type ConnectConfigurations1 = {
  /**
   * The ID of the environment
   */
  envId: string;
  /**
   * The ID of the Secure Compute network
   */
  connectConfigurationId: string;
  /**
   * Whether the configuration should be passive, meaning builds will not run there and only passive Serverless Functions will be deployed
   */
  passive: boolean;
  /**
   * Flag saying if project builds should use Secure Compute
   */
  buildsEnabled: boolean;
};

export type ConnectConfigurations = ConnectConfigurations1;

/**
 * Whether the toast was dismissed, the action was accepted, or the dismissal with this key should be removed
 */
export const UpdateProjectAction = {
  Cancel: "cancel",
  Accept: "accept",
  Delete: "delete",
} as const;
/**
 * Whether the toast was dismissed, the action was accepted, or the dismissal with this key should be removed
 */
export type UpdateProjectAction = ClosedEnum<typeof UpdateProjectAction>;

export type PreviousValue = number | boolean | string;

export type CurrentValue = number | boolean | string;

export type Value5 = {
  previousValue: number | boolean | string;
  currentValue: number | boolean | string;
};

export type UpdateProjectDismissedToasts = {
  /**
   * unique identifier for the dismissed toast
   */
  key: string;
  /**
   * unix timestamp representing the time the toast was dimissed
   */
  dismissedAt: number;
  /**
   * Whether the toast was dismissed, the action was accepted, or the dismissal with this key should be removed
   */
  action: UpdateProjectAction;
  value?: any | undefined;
};

export type UpdateProjectRequestBody = {
  autoExposeSystemEnvs?: boolean | undefined;
  autoAssignCustomDomains?: boolean | undefined;
  autoAssignCustomDomainsUpdatedBy?: string | 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;
  /**
   * Specifies whether customer support can see git source for a deployment
   */
  customerSupportCodeVisibility?: boolean | undefined;
  /**
   * The dev command for this project. When `null` is used this value will be automatically detected
   */
  devCommand?: string | null | undefined;
  directoryListing?: boolean | undefined;
  /**
   * The framework that is being used for this project. When `null` is used no framework is selected
   */
  framework?: UpdateProjectFramework | null | undefined;
  /**
   * Specifies whether PRs from Git forks should require a team member's authorization before it can be deployed
   */
  gitForkProtection?: boolean | undefined;
  /**
   * Specifies whether Git LFS is enabled for this project.
   */
  gitLFS?: boolean | undefined;
  /**
   * Specifies whether sourcemaps are protected and require authentication to access.
   */
  protectedSourcemaps?: boolean | 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 | undefined;
  nodeVersion?: UpdateProjectNodeVersion | undefined;
  /**
   * The output directory of the project. When `null` is used this value will be automatically detected
   */
  outputDirectory?: string | 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;
  /**
   * Specifies resource override configuration for the project
   */
  resourceConfig?: UpdateProjectResourceConfig | 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;
  /**
   * Deployments created before this absolute datetime have Skew Protection disabled. Value is in milliseconds since epoch to match \"createdAt\" fields.
   */
  skewProtectionBoundaryAt?: number | undefined;
  /**
   * Deployments created before this rolling window have Skew Protection disabled. Value is in seconds to match \"revalidate\" fields.
   */
  skewProtectionMaxAge?: number | undefined;
  /**
   * Cross-site domains allowed to fetch skew-protected assets (hostnames, optionally with leading wildcard like *.example.com).
   */
  skewProtectionAllowedDomains?: Array<string> | undefined;
  /**
   * 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;
  /**
   * Indicates if there are source files outside of the root directory
   */
  sourceFilesOutsideRootDirectory?: boolean | undefined;
  /**
   * 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;
  /**
   * Opt-in to skip deployments when there are no changes to the root directory and its dependencies
   */
  enableAffectedProjectsDeployments?: boolean | undefined;
  /**
   * Specifies whether external rewrite caching is enabled for this project.
   */
  enableExternalRewriteCaching?: boolean | undefined;
  /**
   * Manage Static IPs for this project
   */
  staticIps?: UpdateProjectStaticIps | undefined;
  /**
   * Tracing configuration for this project
   */
  tracing?: Tracing | null | undefined;
  /**
   * OpenID Connect JSON Web Token generation configuration.
   */
  oidcTokenConfig?: UpdateProjectOidcTokenConfig | undefined;
  /**
   * Allows to protect project deployments with a password
   */
  passwordProtection?: UpdateProjectPasswordProtection | null | undefined;
  /**
   * Passport configuration for the project.
   */
  passport?: UpdateProjectPassport | null | undefined;
  /**
   * Ensures visitors to your Preview Deployments are logged into Vercel and have a minimum of Viewer access on your team
   */
  ssoProtection?: UpdateProjectSsoProtection | null | undefined;
  /**
   * Restricts access to deployments based on the incoming request IP address
   */
  trustedIps?: UpdateProjectTrustedIps | null | undefined;
  /**
   * Deployment Protection Trusted Sources
   */
  trustedSources?: TrustedSources | null | undefined;
  deploymentPolicy?: DeploymentPolicy1 | string | undefined;
  /**
   * Specify a list of paths that should not be protected by Deployment Protection to enable Cors preflight requests
   */
  optionsAllowlist?: UpdateProjectOptionsAllowlist | null | undefined;
  /**
   * The list of connections from project environment to Secure Compute network
   */
  connectConfigurations?: Array<ConnectConfigurations1> | null | undefined;
  /**
   * An array of objects representing a Dismissed Toast in regards to a Project. Objects are either merged with existing toasts (on key match), or added to the `dimissedToasts` array.`
   */
  dismissedToasts?: Array<UpdateProjectDismissedToasts> | undefined;
};

export type UpdateProjectRequest = {
  /**
   * The unique project identifier or the project name
   */
  idOrName: string;
  /**
   * 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: UpdateProjectRequestBody;
};

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

export type UpdateProjectSpeedInsights = {
  id: string;
  enabledAt?: number | undefined;
  disabledAt?: number | undefined;
  canceledAt?: number | undefined;
  hasData?: boolean | undefined;
  paidAt?: number | undefined;
};

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

export type UpdateProjectEnvId = string | UpdateProjectEnvId2;

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

export type UpdateProjectConnectConfigurations = {
  envId: string | UpdateProjectEnvId2;
  connectConfigurationId: string;
  dc?: string | undefined;
  passive: boolean;
  buildsEnabled: boolean;
  aws?: UpdateProjectAws | 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 UpdateProjectSource = {
  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 UpdateProjectSource = ClosedEnum<typeof UpdateProjectSource>;

export type UpdateProjectDefinitions = {
  /**
   * 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?: UpdateProjectSource | 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 UpdateProjectCrons = {
  /**
   * 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<UpdateProjectDefinitions>;
};

export type UpdateProjectDataCache = {
  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 UpdateProjectDeploymentExpiration = {
  /**
   * 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 UpdateProjectExpiration2 = {
  /**
   * 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 UpdateProjectExpiration1 = {
  /**
   * Unix ms timestamp when the project is scheduled to expire.
   */
  expiresAt: number;
};

export type UpdateProjectExpiration =
  | UpdateProjectExpiration2
  | UpdateProjectExpiration1;

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

export type UpdateProjectTarget = Array<string> | UpdateProjectTarget2;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

export type UpdateProjectContentHint =
  | UpdateProjectContentHint1
  | UpdateProjectContentHint2
  | UpdateProjectContentHint3
  | UpdateProjectContentHint4
  | UpdateProjectContentHint5
  | UpdateProjectContentHint6
  | UpdateProjectContentHint7
  | UpdateProjectContentHint8
  | UpdateProjectContentHint9
  | UpdateProjectContentHint10
  | UpdateProjectContentHint11
  | UpdateProjectContentHint12
  | UpdateProjectContentHint13
  | UpdateProjectContentHint14
  | UpdateProjectContentHint15
  | UpdateProjectContentHint16
  | UpdateProjectContentHint17;

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

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

export type UpdateProjectProjectsEnv = {
  target?: Array<string> | UpdateProjectTarget2 | undefined;
  type: UpdateProjectType;
  /**
   * 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?:
    | UpdateProjectContentHint1
    | UpdateProjectContentHint2
    | UpdateProjectContentHint3
    | UpdateProjectContentHint4
    | UpdateProjectContentHint5
    | UpdateProjectContentHint6
    | UpdateProjectContentHint7
    | UpdateProjectContentHint8
    | UpdateProjectContentHint9
    | UpdateProjectContentHint10
    | UpdateProjectContentHint11
    | UpdateProjectContentHint12
    | UpdateProjectContentHint13
    | UpdateProjectContentHint14
    | UpdateProjectContentHint15
    | UpdateProjectContentHint16
    | UpdateProjectContentHint17
    | null
    | undefined;
  /**
   * Similar to `contentHints`, but should not be exposed to the user.
   */
  internalContentHint?: UpdateProjectInternalContentHint | null | undefined;
  comment?: string | undefined;
  customEnvironmentIds?: Array<string> | undefined;
};

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

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

/**
 * Configuration for matching git branches to this environment
 */
export type UpdateProjectBranchMatcher = {
  /**
   * The type of matching to perform
   */
  type: UpdateProjectProjectsResponse200Type;
  /**
   * 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 UpdateProjectVerification = {
  type: string;
  domain: string;
  value: string;
  reason: string;
};

/**
 * List of domains associated with this environment
 */
export type UpdateProjectDomains = {
  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<UpdateProjectVerification> | undefined;
};

/**
 * Internal representation of a custom environment with all required properties
 */
export type UpdateProjectCustomEnvironments = {
  /**
   * 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: UpdateProjectProjectsType;
  /**
   * Optional description of the environment's purpose
   */
  description?: string | undefined;
  /**
   * Configuration for matching git branches to this environment
   */
  branchMatcher?: UpdateProjectBranchMatcher | undefined;
  /**
   * List of domains associated with this environment
   */
  domains?: Array<UpdateProjectDomains> | 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 UpdateProjectProjectsFramework = {
  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 UpdateProjectProjectsFramework = ClosedEnum<
  typeof UpdateProjectProjectsFramework
>;

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

/**
 * Framework slug, when the service has one (omitted otherwise).
 */
export const UpdateProjectProjectsResponseFramework = {
  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 UpdateProjectProjectsResponseFramework = ClosedEnum<
  typeof UpdateProjectProjectsResponseFramework
>;

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

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

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

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

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

export type UpdateProjectJobs = {
  lint?: UpdateProjectLint | undefined;
  typecheck?: UpdateProjectTypecheck | undefined;
  mfeConfigPresent?: UpdateProjectMfeConfigPresent | undefined;
};

export type UpdateProjectAliasAssigned = number | boolean;

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

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

export type UpdateProjectLatestDeployments = {
  alias?: Array<string> | undefined;
  aliasAssigned?: number | boolean | null | undefined;
  builds?: Array<UpdateProjectBuilds> | undefined;
  createdAt: number;
  createdIn: string;
  creator: UpdateProjectCreator | 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 UpdateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks =
  {
    createdAt?: number | undefined;
    id: string;
    name: string;
    ref: string;
    url: string;
  };

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

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

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

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

export type UpdateProjectLink4 = {
  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<UpdateProjectLinkProjectsResponse200DeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

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

export type UpdateProjectLink3 = {
  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<UpdateProjectLinkProjectsResponseDeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

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

export type UpdateProjectLink2 = {
  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<UpdateProjectLinkProjectsDeployHooks>;
  gitCredentialId: string;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

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

export type UpdateProjectLink1 = {
  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<UpdateProjectLinkDeployHooks>;
  gitCredentialId: string;
  updatedAt?: number | undefined;
  sourceless?: boolean | undefined;
  productionBranch: string;
};

export type UpdateProjectLink =
  | UpdateProjectLink1
  | UpdateProjectLink2
  | UpdateProjectLink3
  | UpdateProjectLink4
  | UpdateProjectLink5
  | UpdateProjectLink6;

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

export type UpdateProjectMicrofrontends2 = {
  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 UpdateProjectMicrofrontends1 = {
  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 UpdateProjectMicrofrontends =
  | UpdateProjectMicrofrontends1
  | UpdateProjectMicrofrontends2
  | UpdateProjectMicrofrontends3;

export const UpdateProjectProjectsNodeVersion = {
  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 UpdateProjectProjectsNodeVersion = ClosedEnum<
  typeof UpdateProjectProjectsNodeVersion
>;

export type UpdateProjectProjectsPaths = {
  value: string;
};

export type UpdateProjectProjectsOptionsAllowlist = {
  paths: Array<UpdateProjectProjectsPaths>;
};

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

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

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

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

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

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

export function updateProjectBuildQueueToJSON(
  updateProjectBuildQueue: UpdateProjectBuildQueue,
): string {
  return JSON.stringify(
    UpdateProjectBuildQueue$outboundSchema.parse(updateProjectBuildQueue),
  );
}

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

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

/** @internal */
export type UpdateProjectResourceConfig$Outbound = {
  buildMachineType?: string | undefined;
  buildQueue?: UpdateProjectBuildQueue$Outbound | 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;
  enableFunctionsBeta?: boolean | undefined;
};

/** @internal */
export const UpdateProjectResourceConfig$outboundSchema: z.ZodType<
  UpdateProjectResourceConfig$Outbound,
  z.ZodTypeDef,
  UpdateProjectResourceConfig
> = z.object({
  buildMachineType: UpdateProjectBuildMachineType$outboundSchema.optional(),
  buildQueue: z.lazy(() => UpdateProjectBuildQueue$outboundSchema).optional(),
  fluid: z.boolean().optional(),
  functionDefaultRegions: z.array(z.string()).optional(),
  functionDefaultTimeout: z.number().optional(),
  functionDefaultMemoryType:
    UpdateProjectFunctionDefaultMemoryType$outboundSchema.optional(),
  functionZeroConfigFailover: z.boolean().optional(),
  elasticConcurrencyEnabled: z.boolean().optional(),
  buildMachineSelection: UpdateProjectBuildMachineSelection$outboundSchema
    .optional(),
  buildMachineElasticLastUpdated: z.number().optional(),
  isNSNBDisabled: z.boolean().optional(),
  enableFunctionsBeta: z.boolean().optional(),
});

export function updateProjectResourceConfigToJSON(
  updateProjectResourceConfig: UpdateProjectResourceConfig,
): string {
  return JSON.stringify(
    UpdateProjectResourceConfig$outboundSchema.parse(
      updateProjectResourceConfig,
    ),
  );
}

/** @internal */
export type UpdateProjectStaticIps$Outbound = {
  enabled: boolean;
};

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

export function updateProjectStaticIpsToJSON(
  updateProjectStaticIps: UpdateProjectStaticIps,
): string {
  return JSON.stringify(
    UpdateProjectStaticIps$outboundSchema.parse(updateProjectStaticIps),
  );
}

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

/** @internal */
export type SamplingRules$Outbound = {
  rate: number;
  env?: string | undefined;
  requestPath?: string | undefined;
};

/** @internal */
export const SamplingRules$outboundSchema: z.ZodType<
  SamplingRules$Outbound,
  z.ZodTypeDef,
  SamplingRules
> = z.object({
  rate: z.number(),
  env: UpdateProjectEnv$outboundSchema.optional(),
  requestPath: z.string().optional(),
});

export function samplingRulesToJSON(samplingRules: SamplingRules): string {
  return JSON.stringify(SamplingRules$outboundSchema.parse(samplingRules));
}

/** @internal */
export type Tracing$Outbound = {
  domains?: string | undefined;
  ignorePaths?: Array<string> | undefined;
  samplingRules?: Array<SamplingRules$Outbound> | undefined;
};

/** @internal */
export const Tracing$outboundSchema: z.ZodType<
  Tracing$Outbound,
  z.ZodTypeDef,
  Tracing
> = z.object({
  domains: z.string().optional(),
  ignorePaths: z.array(z.string()).optional(),
  samplingRules: z.array(z.lazy(() => SamplingRules$outboundSchema)).optional(),
});

export function tracingToJSON(tracing: Tracing): string {
  return JSON.stringify(Tracing$outboundSchema.parse(tracing));
}

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

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

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

export function updateProjectOidcTokenConfigToJSON(
  updateProjectOidcTokenConfig: UpdateProjectOidcTokenConfig,
): string {
  return JSON.stringify(
    UpdateProjectOidcTokenConfig$outboundSchema.parse(
      updateProjectOidcTokenConfig,
    ),
  );
}

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

/** @internal */
export type UpdateProjectPasswordProtection$Outbound = {
  deploymentType: string;
  password?: string | null | undefined;
};

/** @internal */
export const UpdateProjectPasswordProtection$outboundSchema: z.ZodType<
  UpdateProjectPasswordProtection$Outbound,
  z.ZodTypeDef,
  UpdateProjectPasswordProtection
> = z.object({
  deploymentType: UpdateProjectDeploymentType$outboundSchema,
  password: z.nullable(z.string()).optional(),
});

export function updateProjectPasswordProtectionToJSON(
  updateProjectPasswordProtection: UpdateProjectPasswordProtection,
): string {
  return JSON.stringify(
    UpdateProjectPasswordProtection$outboundSchema.parse(
      updateProjectPasswordProtection,
    ),
  );
}

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

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

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

export function updateProjectPassportToJSON(
  updateProjectPassport: UpdateProjectPassport,
): string {
  return JSON.stringify(
    UpdateProjectPassport$outboundSchema.parse(updateProjectPassport),
  );
}

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

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

/** @internal */
export const UpdateProjectSsoProtection$outboundSchema: z.ZodType<
  UpdateProjectSsoProtection$Outbound,
  z.ZodTypeDef,
  UpdateProjectSsoProtection
> = z.object({
  deploymentType: UpdateProjectProjectsRequestDeploymentType$outboundSchema
    .default("preview"),
});

export function updateProjectSsoProtectionToJSON(
  updateProjectSsoProtection: UpdateProjectSsoProtection,
): string {
  return JSON.stringify(
    UpdateProjectSsoProtection$outboundSchema.parse(updateProjectSsoProtection),
  );
}

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

/** @internal */
export type Addresses$Outbound = {
  value: string;
  note?: string | undefined;
};

/** @internal */
export const Addresses$outboundSchema: z.ZodType<
  Addresses$Outbound,
  z.ZodTypeDef,
  Addresses
> = z.object({
  value: z.string(),
  note: z.string().optional(),
});

export function addressesToJSON(addresses: Addresses): string {
  return JSON.stringify(Addresses$outboundSchema.parse(addresses));
}

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

/** @internal */
export type UpdateProjectTrustedIps$Outbound = {
  deploymentType: string;
  addresses: Array<Addresses$Outbound>;
  protectionMode: string;
};

/** @internal */
export const UpdateProjectTrustedIps$outboundSchema: z.ZodType<
  UpdateProjectTrustedIps$Outbound,
  z.ZodTypeDef,
  UpdateProjectTrustedIps
> = z.object({
  deploymentType:
    UpdateProjectProjectsRequestRequestBodyDeploymentType$outboundSchema,
  addresses: z.array(z.lazy(() => Addresses$outboundSchema)),
  protectionMode: ProtectionMode$outboundSchema,
});

export function updateProjectTrustedIpsToJSON(
  updateProjectTrustedIps: UpdateProjectTrustedIps,
): string {
  return JSON.stringify(
    UpdateProjectTrustedIps$outboundSchema.parse(updateProjectTrustedIps),
  );
}

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

/** @internal */
export type To2$Outbound = {
  slugs?: Array<string> | undefined;
  preset: string;
};

/** @internal */
export const To2$outboundSchema: z.ZodType<To2$Outbound, z.ZodTypeDef, To2> = z
  .object({
    slugs: z.array(z.string()).optional(),
    preset: ToPreset$outboundSchema,
  });

export function to2ToJSON(to2: To2): string {
  return JSON.stringify(To2$outboundSchema.parse(to2));
}

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

/** @internal */
export type To1$Outbound = {
  slugs: Array<string>;
  preset?: string | undefined;
};

/** @internal */
export const To1$outboundSchema: z.ZodType<To1$Outbound, z.ZodTypeDef, To1> = z
  .object({
    slugs: z.array(z.string()),
    preset: Preset$outboundSchema.optional(),
  });

export function to1ToJSON(to1: To1): string {
  return JSON.stringify(To1$outboundSchema.parse(to1));
}

/** @internal */
export type To$Outbound = To1$Outbound | To2$Outbound;

/** @internal */
export const To$outboundSchema: z.ZodType<To$Outbound, z.ZodTypeDef, To> =
  smartUnion([
    z.lazy(() => To1$outboundSchema),
    z.lazy(() => To2$outboundSchema),
  ]);

export function toToJSON(to: To): string {
  return JSON.stringify(To$outboundSchema.parse(to));
}

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

/** @internal */
export type From2$Outbound = {
  slugs?: Array<string> | undefined;
  preset: string;
};

/** @internal */
export const From2$outboundSchema: z.ZodType<
  From2$Outbound,
  z.ZodTypeDef,
  From2
> = z.object({
  slugs: z.array(z.string()).optional(),
  preset: UpdateProjectFromPreset$outboundSchema,
});

export function from2ToJSON(from2: From2): string {
  return JSON.stringify(From2$outboundSchema.parse(from2));
}

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

/** @internal */
export type From1$Outbound = {
  slugs: Array<string>;
  preset?: string | undefined;
};

/** @internal */
export const From1$outboundSchema: z.ZodType<
  From1$Outbound,
  z.ZodTypeDef,
  From1
> = z.object({
  slugs: z.array(z.string()),
  preset: FromPreset$outboundSchema.optional(),
});

export function from1ToJSON(from1: From1): string {
  return JSON.stringify(From1$outboundSchema.parse(from1));
}

/** @internal */
export type From$Outbound = From1$Outbound | From2$Outbound;

/** @internal */
export const From$outboundSchema: z.ZodType<From$Outbound, z.ZodTypeDef, From> =
  smartUnion([
    z.lazy(() => From1$outboundSchema),
    z.lazy(() => From2$outboundSchema),
  ]);

export function fromToJSON(from: From): string {
  return JSON.stringify(From$outboundSchema.parse(from));
}

/** @internal */
export type CustomAllow$Outbound = {
  to: To1$Outbound | To2$Outbound;
  from: From1$Outbound | From2$Outbound;
};

/** @internal */
export const CustomAllow$outboundSchema: z.ZodType<
  CustomAllow$Outbound,
  z.ZodTypeDef,
  CustomAllow
> = z.object({
  to: smartUnion([
    z.lazy(() => To1$outboundSchema),
    z.lazy(() => To2$outboundSchema),
  ]),
  from: smartUnion([
    z.lazy(() => From1$outboundSchema),
    z.lazy(() => From2$outboundSchema),
  ]),
});

export function customAllowToJSON(customAllow: CustomAllow): string {
  return JSON.stringify(CustomAllow$outboundSchema.parse(customAllow));
}

/** @internal */
export type UpdateProjectProjects$Outbound = {
  label?: string | undefined;
  customAllow?: Array<CustomAllow$Outbound> | undefined;
};

/** @internal */
export const UpdateProjectProjects$outboundSchema: z.ZodType<
  UpdateProjectProjects$Outbound,
  z.ZodTypeDef,
  UpdateProjectProjects
> = z.object({
  label: z.string().optional(),
  customAllow: z.array(z.lazy(() => CustomAllow$outboundSchema)).optional(),
});

export function updateProjectProjectsToJSON(
  updateProjectProjects: UpdateProjectProjects,
): string {
  return JSON.stringify(
    UpdateProjectProjects$outboundSchema.parse(updateProjectProjects),
  );
}

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

/** @internal */
export type UpdateProjectTo2$Outbound = {
  slugs?: Array<string> | undefined;
  preset: string;
};

/** @internal */
export const UpdateProjectTo2$outboundSchema: z.ZodType<
  UpdateProjectTo2$Outbound,
  z.ZodTypeDef,
  UpdateProjectTo2
> = z.object({
  slugs: z.array(z.string()).optional(),
  preset: UpdateProjectToProjectsPreset$outboundSchema,
});

export function updateProjectTo2ToJSON(
  updateProjectTo2: UpdateProjectTo2,
): string {
  return JSON.stringify(
    UpdateProjectTo2$outboundSchema.parse(updateProjectTo2),
  );
}

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

/** @internal */
export type UpdateProjectTo1$Outbound = {
  slugs: Array<string>;
  preset?: string | undefined;
};

/** @internal */
export const UpdateProjectTo1$outboundSchema: z.ZodType<
  UpdateProjectTo1$Outbound,
  z.ZodTypeDef,
  UpdateProjectTo1
> = z.object({
  slugs: z.array(z.string()),
  preset: UpdateProjectToPreset$outboundSchema.optional(),
});

export function updateProjectTo1ToJSON(
  updateProjectTo1: UpdateProjectTo1,
): string {
  return JSON.stringify(
    UpdateProjectTo1$outboundSchema.parse(updateProjectTo1),
  );
}

/** @internal */
export type UpdateProjectTo$Outbound =
  | UpdateProjectTo1$Outbound
  | UpdateProjectTo2$Outbound;

/** @internal */
export const UpdateProjectTo$outboundSchema: z.ZodType<
  UpdateProjectTo$Outbound,
  z.ZodTypeDef,
  UpdateProjectTo
> = smartUnion([
  z.lazy(() => UpdateProjectTo1$outboundSchema),
  z.lazy(() => UpdateProjectTo2$outboundSchema),
]);

export function updateProjectToToJSON(
  updateProjectTo: UpdateProjectTo,
): string {
  return JSON.stringify(UpdateProjectTo$outboundSchema.parse(updateProjectTo));
}

/** @internal */
export type OidcProviders$Outbound = {
  label?: string | undefined;
  to: UpdateProjectTo1$Outbound | UpdateProjectTo2$Outbound;
  claims: { [k: string]: Array<string> };
};

/** @internal */
export const OidcProviders$outboundSchema: z.ZodType<
  OidcProviders$Outbound,
  z.ZodTypeDef,
  OidcProviders
> = z.object({
  label: z.string().optional(),
  to: smartUnion([
    z.lazy(() => UpdateProjectTo1$outboundSchema),
    z.lazy(() => UpdateProjectTo2$outboundSchema),
  ]),
  claims: z.record(z.array(z.string())),
});

export function oidcProvidersToJSON(oidcProviders: OidcProviders): string {
  return JSON.stringify(OidcProviders$outboundSchema.parse(oidcProviders));
}

/** @internal */
export type TrustedSources$Outbound = {
  projects?: { [k: string]: UpdateProjectProjects$Outbound } | undefined;
  oidcProviders?: { [k: string]: Array<OidcProviders$Outbound> } | undefined;
};

/** @internal */
export const TrustedSources$outboundSchema: z.ZodType<
  TrustedSources$Outbound,
  z.ZodTypeDef,
  TrustedSources
> = z.object({
  projects: z.record(z.lazy(() => UpdateProjectProjects$outboundSchema))
    .optional(),
  oidcProviders: z.record(z.array(z.lazy(() => OidcProviders$outboundSchema)))
    .optional(),
});

export function trustedSourcesToJSON(trustedSources: TrustedSources): string {
  return JSON.stringify(TrustedSources$outboundSchema.parse(trustedSources));
}

/** @internal */
export type UpdateProjectEnvironmentsProjects2$Outbound = {
  type: "custom";
  environmentId: string;
};

/** @internal */
export const UpdateProjectEnvironmentsProjects2$outboundSchema: z.ZodType<
  UpdateProjectEnvironmentsProjects2$Outbound,
  z.ZodTypeDef,
  UpdateProjectEnvironmentsProjects2
> = z.object({
  type: z.literal("custom"),
  environmentId: z.string(),
});

export function updateProjectEnvironmentsProjects2ToJSON(
  updateProjectEnvironmentsProjects2: UpdateProjectEnvironmentsProjects2,
): string {
  return JSON.stringify(
    UpdateProjectEnvironmentsProjects2$outboundSchema.parse(
      updateProjectEnvironmentsProjects2,
    ),
  );
}

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

/** @internal */
export type UpdateProjectEnvironmentsProjects1$Outbound = {
  type: "system";
  target: string;
};

/** @internal */
export const UpdateProjectEnvironmentsProjects1$outboundSchema: z.ZodType<
  UpdateProjectEnvironmentsProjects1$Outbound,
  z.ZodTypeDef,
  UpdateProjectEnvironmentsProjects1
> = z.object({
  type: z.literal("system"),
  target: UpdateProjectEnvironmentsProjectsTarget$outboundSchema,
});

export function updateProjectEnvironmentsProjects1ToJSON(
  updateProjectEnvironmentsProjects1: UpdateProjectEnvironmentsProjects1,
): string {
  return JSON.stringify(
    UpdateProjectEnvironmentsProjects1$outboundSchema.parse(
      updateProjectEnvironmentsProjects1,
    ),
  );
}

/** @internal */
export type GitSourcesEnvironments$Outbound =
  | UpdateProjectEnvironmentsProjects1$Outbound
  | UpdateProjectEnvironmentsProjects2$Outbound;

/** @internal */
export const GitSourcesEnvironments$outboundSchema: z.ZodType<
  GitSourcesEnvironments$Outbound,
  z.ZodTypeDef,
  GitSourcesEnvironments
> = z.union([
  z.lazy(() => UpdateProjectEnvironmentsProjects1$outboundSchema),
  z.lazy(() => UpdateProjectEnvironmentsProjects2$outboundSchema),
]);

export function gitSourcesEnvironmentsToJSON(
  gitSourcesEnvironments: GitSourcesEnvironments,
): string {
  return JSON.stringify(
    GitSourcesEnvironments$outboundSchema.parse(gitSourcesEnvironments),
  );
}

/** @internal */
export type UpdateProjectSources2$Outbound = {
  provider: "gitlab";
  namespace: string;
  project?: string | undefined;
};

/** @internal */
export const UpdateProjectSources2$outboundSchema: z.ZodType<
  UpdateProjectSources2$Outbound,
  z.ZodTypeDef,
  UpdateProjectSources2
> = z.object({
  provider: z.literal("gitlab"),
  namespace: z.string(),
  project: z.string().optional(),
});

export function updateProjectSources2ToJSON(
  updateProjectSources2: UpdateProjectSources2,
): string {
  return JSON.stringify(
    UpdateProjectSources2$outboundSchema.parse(updateProjectSources2),
  );
}

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

/** @internal */
export type UpdateProjectSources1$Outbound = {
  provider: string;
  org: string;
  repo?: string | undefined;
};

/** @internal */
export const UpdateProjectSources1$outboundSchema: z.ZodType<
  UpdateProjectSources1$Outbound,
  z.ZodTypeDef,
  UpdateProjectSources1
> = z.object({
  provider: UpdateProjectSourcesProjectsProvider$outboundSchema,
  org: z.string(),
  repo: z.string().optional(),
});

export function updateProjectSources1ToJSON(
  updateProjectSources1: UpdateProjectSources1,
): string {
  return JSON.stringify(
    UpdateProjectSources1$outboundSchema.parse(updateProjectSources1),
  );
}

/** @internal */
export type GitSourcesSources$Outbound =
  | (UpdateProjectSources1$Outbound & { provider: "github" })
  | (UpdateProjectSources1$Outbound & { provider: "bitbucket" })
  | UpdateProjectSources2$Outbound;

/** @internal */
export const GitSourcesSources$outboundSchema: z.ZodType<
  GitSourcesSources$Outbound,
  z.ZodTypeDef,
  GitSourcesSources
> = z.union([
  z.lazy(() => UpdateProjectSources1$outboundSchema).and(
    z.object({ provider: z.literal("github") }),
  ),
  z.lazy(() => UpdateProjectSources1$outboundSchema).and(
    z.object({ provider: z.literal("bitbucket") }),
  ),
  z.lazy(() => UpdateProjectSources2$outboundSchema),
]);

export function gitSourcesSourcesToJSON(
  gitSourcesSources: GitSourcesSources,
): string {
  return JSON.stringify(
    GitSourcesSources$outboundSchema.parse(gitSourcesSources),
  );
}

/** @internal */
export type GitSources1$Outbound = {
  enabled: boolean;
  environments: Array<
    | UpdateProjectEnvironmentsProjects1$Outbound
    | UpdateProjectEnvironmentsProjects2$Outbound
  >;
  sources: Array<
    | (UpdateProjectSources1$Outbound & { provider: "github" })
    | (UpdateProjectSources1$Outbound & { provider: "bitbucket" })
    | UpdateProjectSources2$Outbound
  >;
};

/** @internal */
export const GitSources1$outboundSchema: z.ZodType<
  GitSources1$Outbound,
  z.ZodTypeDef,
  GitSources1
> = z.object({
  enabled: z.boolean(),
  environments: z.array(
    z.union([
      z.lazy(() => UpdateProjectEnvironmentsProjects1$outboundSchema),
      z.lazy(() => UpdateProjectEnvironmentsProjects2$outboundSchema),
    ]),
  ),
  sources: z.array(
    z.union([
      z.lazy(() => UpdateProjectSources1$outboundSchema).and(
        z.object({ provider: z.literal("github") }),
      ),
      z.lazy(() => UpdateProjectSources1$outboundSchema).and(
        z.object({ provider: z.literal("bitbucket") }),
      ),
      z.lazy(() => UpdateProjectSources2$outboundSchema),
    ]),
  ),
});

export function gitSources1ToJSON(gitSources1: GitSources1): string {
  return JSON.stringify(GitSources1$outboundSchema.parse(gitSources1));
}

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

/** @internal */
export const DeploymentPolicyGitSources$outboundSchema: z.ZodType<
  DeploymentPolicyGitSources$Outbound,
  z.ZodTypeDef,
  DeploymentPolicyGitSources
> = smartUnion([z.array(z.lazy(() => GitSources1$outboundSchema)), z.string()]);

export function deploymentPolicyGitSourcesToJSON(
  deploymentPolicyGitSources: DeploymentPolicyGitSources,
): string {
  return JSON.stringify(
    DeploymentPolicyGitSources$outboundSchema.parse(deploymentPolicyGitSources),
  );
}

/** @internal */
export type UpdateProjectEnvironments2$Outbound = {
  type: "custom";
  environmentId: string;
};

/** @internal */
export const UpdateProjectEnvironments2$outboundSchema: z.ZodType<
  UpdateProjectEnvironments2$Outbound,
  z.ZodTypeDef,
  UpdateProjectEnvironments2
> = z.object({
  type: z.literal("custom"),
  environmentId: z.string(),
});

export function updateProjectEnvironments2ToJSON(
  updateProjectEnvironments2: UpdateProjectEnvironments2,
): string {
  return JSON.stringify(
    UpdateProjectEnvironments2$outboundSchema.parse(updateProjectEnvironments2),
  );
}

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

/** @internal */
export type UpdateProjectEnvironments1$Outbound = {
  type: "system";
  target: string;
};

/** @internal */
export const UpdateProjectEnvironments1$outboundSchema: z.ZodType<
  UpdateProjectEnvironments1$Outbound,
  z.ZodTypeDef,
  UpdateProjectEnvironments1
> = z.object({
  type: z.literal("system"),
  target: UpdateProjectEnvironmentsTarget$outboundSchema,
});

export function updateProjectEnvironments1ToJSON(
  updateProjectEnvironments1: UpdateProjectEnvironments1,
): string {
  return JSON.stringify(
    UpdateProjectEnvironments1$outboundSchema.parse(updateProjectEnvironments1),
  );
}

/** @internal */
export type DeploymentSourcesEnvironments$Outbound =
  | UpdateProjectEnvironments1$Outbound
  | UpdateProjectEnvironments2$Outbound;

/** @internal */
export const DeploymentSourcesEnvironments$outboundSchema: z.ZodType<
  DeploymentSourcesEnvironments$Outbound,
  z.ZodTypeDef,
  DeploymentSourcesEnvironments
> = z.union([
  z.lazy(() => UpdateProjectEnvironments1$outboundSchema),
  z.lazy(() => UpdateProjectEnvironments2$outboundSchema),
]);

export function deploymentSourcesEnvironmentsToJSON(
  deploymentSourcesEnvironments: DeploymentSourcesEnvironments,
): string {
  return JSON.stringify(
    DeploymentSourcesEnvironments$outboundSchema.parse(
      deploymentSourcesEnvironments,
    ),
  );
}

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

/** @internal */
export type DeploymentSources1$Outbound = {
  enabled: boolean;
  environments: Array<
    UpdateProjectEnvironments1$Outbound | UpdateProjectEnvironments2$Outbound
  >;
  sources: Array<string>;
};

/** @internal */
export const DeploymentSources1$outboundSchema: z.ZodType<
  DeploymentSources1$Outbound,
  z.ZodTypeDef,
  DeploymentSources1
> = z.object({
  enabled: z.boolean(),
  environments: z.array(
    z.union([
      z.lazy(() => UpdateProjectEnvironments1$outboundSchema),
      z.lazy(() => UpdateProjectEnvironments2$outboundSchema),
    ]),
  ),
  sources: z.array(DeploymentSourcesSources$outboundSchema),
});

export function deploymentSources1ToJSON(
  deploymentSources1: DeploymentSources1,
): string {
  return JSON.stringify(
    DeploymentSources1$outboundSchema.parse(deploymentSources1),
  );
}

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

/** @internal */
export const DeploymentPolicyDeploymentSources$outboundSchema: z.ZodType<
  DeploymentPolicyDeploymentSources$Outbound,
  z.ZodTypeDef,
  DeploymentPolicyDeploymentSources
> = smartUnion([
  z.array(z.lazy(() => DeploymentSources1$outboundSchema)),
  z.string(),
]);

export function deploymentPolicyDeploymentSourcesToJSON(
  deploymentPolicyDeploymentSources: DeploymentPolicyDeploymentSources,
): string {
  return JSON.stringify(
    DeploymentPolicyDeploymentSources$outboundSchema.parse(
      deploymentPolicyDeploymentSources,
    ),
  );
}

/** @internal */
export type DeploymentPolicy1$Outbound = {
  gitSources?: Array<GitSources1$Outbound> | string | undefined;
  deploymentSources?: Array<DeploymentSources1$Outbound> | string | undefined;
};

/** @internal */
export const DeploymentPolicy1$outboundSchema: z.ZodType<
  DeploymentPolicy1$Outbound,
  z.ZodTypeDef,
  DeploymentPolicy1
> = z.object({
  gitSources: smartUnion([
    z.array(z.lazy(() => GitSources1$outboundSchema)),
    z.string(),
  ]).optional(),
  deploymentSources: smartUnion([
    z.array(z.lazy(() => DeploymentSources1$outboundSchema)),
    z.string(),
  ]).optional(),
});

export function deploymentPolicy1ToJSON(
  deploymentPolicy1: DeploymentPolicy1,
): string {
  return JSON.stringify(
    DeploymentPolicy1$outboundSchema.parse(deploymentPolicy1),
  );
}

/** @internal */
export type UpdateProjectDeploymentPolicy$Outbound =
  | DeploymentPolicy1$Outbound
  | string;

/** @internal */
export const UpdateProjectDeploymentPolicy$outboundSchema: z.ZodType<
  UpdateProjectDeploymentPolicy$Outbound,
  z.ZodTypeDef,
  UpdateProjectDeploymentPolicy
> = smartUnion([z.lazy(() => DeploymentPolicy1$outboundSchema), z.string()]);

export function updateProjectDeploymentPolicyToJSON(
  updateProjectDeploymentPolicy: UpdateProjectDeploymentPolicy,
): string {
  return JSON.stringify(
    UpdateProjectDeploymentPolicy$outboundSchema.parse(
      updateProjectDeploymentPolicy,
    ),
  );
}

/** @internal */
export type UpdateProjectPaths$Outbound = {
  value: string;
};

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

export function updateProjectPathsToJSON(
  updateProjectPaths: UpdateProjectPaths,
): string {
  return JSON.stringify(
    UpdateProjectPaths$outboundSchema.parse(updateProjectPaths),
  );
}

/** @internal */
export type UpdateProjectOptionsAllowlist$Outbound = {
  paths: Array<UpdateProjectPaths$Outbound>;
};

/** @internal */
export const UpdateProjectOptionsAllowlist$outboundSchema: z.ZodType<
  UpdateProjectOptionsAllowlist$Outbound,
  z.ZodTypeDef,
  UpdateProjectOptionsAllowlist
> = z.object({
  paths: z.array(z.lazy(() => UpdateProjectPaths$outboundSchema)),
});

export function updateProjectOptionsAllowlistToJSON(
  updateProjectOptionsAllowlist: UpdateProjectOptionsAllowlist,
): string {
  return JSON.stringify(
    UpdateProjectOptionsAllowlist$outboundSchema.parse(
      updateProjectOptionsAllowlist,
    ),
  );
}

/** @internal */
export type ConnectConfigurations1$Outbound = {
  envId: string;
  connectConfigurationId: string;
  passive: boolean;
  buildsEnabled: boolean;
};

/** @internal */
export const ConnectConfigurations1$outboundSchema: z.ZodType<
  ConnectConfigurations1$Outbound,
  z.ZodTypeDef,
  ConnectConfigurations1
> = z.object({
  envId: z.string(),
  connectConfigurationId: z.string(),
  passive: z.boolean(),
  buildsEnabled: z.boolean(),
});

export function connectConfigurations1ToJSON(
  connectConfigurations1: ConnectConfigurations1,
): string {
  return JSON.stringify(
    ConnectConfigurations1$outboundSchema.parse(connectConfigurations1),
  );
}

/** @internal */
export type ConnectConfigurations$Outbound = ConnectConfigurations1$Outbound;

/** @internal */
export const ConnectConfigurations$outboundSchema: z.ZodType<
  ConnectConfigurations$Outbound,
  z.ZodTypeDef,
  ConnectConfigurations
> = z.lazy(() => ConnectConfigurations1$outboundSchema);

export function connectConfigurationsToJSON(
  connectConfigurations: ConnectConfigurations,
): string {
  return JSON.stringify(
    ConnectConfigurations$outboundSchema.parse(connectConfigurations),
  );
}

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

/** @internal */
export type PreviousValue$Outbound = number | boolean | string;

/** @internal */
export const PreviousValue$outboundSchema: z.ZodType<
  PreviousValue$Outbound,
  z.ZodTypeDef,
  PreviousValue
> = smartUnion([z.number(), z.boolean(), z.string()]);

export function previousValueToJSON(previousValue: PreviousValue): string {
  return JSON.stringify(PreviousValue$outboundSchema.parse(previousValue));
}

/** @internal */
export type CurrentValue$Outbound = number | boolean | string;

/** @internal */
export const CurrentValue$outboundSchema: z.ZodType<
  CurrentValue$Outbound,
  z.ZodTypeDef,
  CurrentValue
> = smartUnion([z.number(), z.boolean(), z.string()]);

export function currentValueToJSON(currentValue: CurrentValue): string {
  return JSON.stringify(CurrentValue$outboundSchema.parse(currentValue));
}

/** @internal */
export type Value5$Outbound = {
  previousValue: number | boolean | string;
  currentValue: number | boolean | string;
};

/** @internal */
export const Value5$outboundSchema: z.ZodType<
  Value5$Outbound,
  z.ZodTypeDef,
  Value5
> = z.object({
  previousValue: smartUnion([z.number(), z.boolean(), z.string()]),
  currentValue: smartUnion([z.number(), z.boolean(), z.string()]),
});

export function value5ToJSON(value5: Value5): string {
  return JSON.stringify(Value5$outboundSchema.parse(value5));
}

/** @internal */
export type UpdateProjectDismissedToasts$Outbound = {
  key: string;
  dismissedAt: number;
  action: string;
  value?: any | undefined;
};

/** @internal */
export const UpdateProjectDismissedToasts$outboundSchema: z.ZodType<
  UpdateProjectDismissedToasts$Outbound,
  z.ZodTypeDef,
  UpdateProjectDismissedToasts
> = z.object({
  key: z.string(),
  dismissedAt: z.number(),
  action: UpdateProjectAction$outboundSchema,
  value: z.any().optional(),
});

export function updateProjectDismissedToastsToJSON(
  updateProjectDismissedToasts: UpdateProjectDismissedToasts,
): string {
  return JSON.stringify(
    UpdateProjectDismissedToasts$outboundSchema.parse(
      updateProjectDismissedToasts,
    ),
  );
}

/** @internal */
export type UpdateProjectRequestBody$Outbound = {
  autoExposeSystemEnvs?: boolean | undefined;
  autoAssignCustomDomains?: boolean | undefined;
  autoAssignCustomDomainsUpdatedBy?: string | undefined;
  buildCommand?: string | null | undefined;
  commandForIgnoringBuildStep?: string | null | undefined;
  customerSupportCodeVisibility?: boolean | undefined;
  devCommand?: string | null | undefined;
  directoryListing?: boolean | undefined;
  framework?: string | null | undefined;
  gitForkProtection?: boolean | undefined;
  gitLFS?: boolean | undefined;
  protectedSourcemaps?: boolean | undefined;
  installCommand?: string | null | undefined;
  name?: string | undefined;
  nodeVersion?: string | undefined;
  outputDirectory?: string | null | undefined;
  previewDeploymentsDisabled?: boolean | null | undefined;
  previewDeploymentSuffix?: string | null | undefined;
  resourceConfig?: UpdateProjectResourceConfig$Outbound | undefined;
  publicSource?: boolean | null | undefined;
  rootDirectory?: string | null | undefined;
  serverlessFunctionRegion?: string | null | undefined;
  serverlessFunctionZeroConfigFailover?: boolean | undefined;
  skewProtectionBoundaryAt?: number | undefined;
  skewProtectionMaxAge?: number | undefined;
  skewProtectionAllowedDomains?: Array<string> | undefined;
  skipGitConnectDuringLink?: boolean | undefined;
  sourceFilesOutsideRootDirectory?: boolean | undefined;
  enablePreviewFeedback?: boolean | null | undefined;
  enableProductionFeedback?: boolean | null | undefined;
  enableAffectedProjectsDeployments?: boolean | undefined;
  enableExternalRewriteCaching?: boolean | undefined;
  staticIps?: UpdateProjectStaticIps$Outbound | undefined;
  tracing?: Tracing$Outbound | null | undefined;
  oidcTokenConfig?: UpdateProjectOidcTokenConfig$Outbound | undefined;
  passwordProtection?:
    | UpdateProjectPasswordProtection$Outbound
    | null
    | undefined;
  passport?: UpdateProjectPassport$Outbound | null | undefined;
  ssoProtection?: UpdateProjectSsoProtection$Outbound | null | undefined;
  trustedIps?: UpdateProjectTrustedIps$Outbound | null | undefined;
  trustedSources?: TrustedSources$Outbound | null | undefined;
  deploymentPolicy?: DeploymentPolicy1$Outbound | string | undefined;
  optionsAllowlist?: UpdateProjectOptionsAllowlist$Outbound | null | undefined;
  connectConfigurations?:
    | Array<ConnectConfigurations1$Outbound>
    | null
    | undefined;
  dismissedToasts?: Array<UpdateProjectDismissedToasts$Outbound> | undefined;
};

/** @internal */
export const UpdateProjectRequestBody$outboundSchema: z.ZodType<
  UpdateProjectRequestBody$Outbound,
  z.ZodTypeDef,
  UpdateProjectRequestBody
> = z.object({
  autoExposeSystemEnvs: z.boolean().optional(),
  autoAssignCustomDomains: z.boolean().optional(),
  autoAssignCustomDomainsUpdatedBy: z.string().optional(),
  buildCommand: z.nullable(z.string()).optional(),
  commandForIgnoringBuildStep: z.nullable(z.string()).optional(),
  customerSupportCodeVisibility: z.boolean().optional(),
  devCommand: z.nullable(z.string()).optional(),
  directoryListing: z.boolean().optional(),
  framework: z.nullable(UpdateProjectFramework$outboundSchema).optional(),
  gitForkProtection: z.boolean().optional(),
  gitLFS: z.boolean().optional(),
  protectedSourcemaps: z.boolean().optional(),
  installCommand: z.nullable(z.string()).optional(),
  name: z.string().optional(),
  nodeVersion: UpdateProjectNodeVersion$outboundSchema.optional(),
  outputDirectory: z.nullable(z.string()).optional(),
  previewDeploymentsDisabled: z.nullable(z.boolean()).optional(),
  previewDeploymentSuffix: z.nullable(z.string()).optional(),
  resourceConfig: z.lazy(() => UpdateProjectResourceConfig$outboundSchema)
    .optional(),
  publicSource: z.nullable(z.boolean()).optional(),
  rootDirectory: z.nullable(z.string()).optional(),
  serverlessFunctionRegion: z.nullable(z.string()).optional(),
  serverlessFunctionZeroConfigFailover: z.boolean().optional(),
  skewProtectionBoundaryAt: z.number().int().optional(),
  skewProtectionMaxAge: z.number().int().optional(),
  skewProtectionAllowedDomains: z.array(z.string()).optional(),
  skipGitConnectDuringLink: z.boolean().optional(),
  sourceFilesOutsideRootDirectory: z.boolean().optional(),
  enablePreviewFeedback: z.nullable(z.boolean()).optional(),
  enableProductionFeedback: z.nullable(z.boolean()).optional(),
  enableAffectedProjectsDeployments: z.boolean().optional(),
  enableExternalRewriteCaching: z.boolean().optional(),
  staticIps: z.lazy(() => UpdateProjectStaticIps$outboundSchema).optional(),
  tracing: z.nullable(z.lazy(() => Tracing$outboundSchema)).optional(),
  oidcTokenConfig: z.lazy(() => UpdateProjectOidcTokenConfig$outboundSchema)
    .optional(),
  passwordProtection: z.nullable(
    z.lazy(() => UpdateProjectPasswordProtection$outboundSchema),
  ).optional(),
  passport: z.nullable(z.lazy(() => UpdateProjectPassport$outboundSchema))
    .optional(),
  ssoProtection: z.nullable(
    z.lazy(() => UpdateProjectSsoProtection$outboundSchema),
  ).optional(),
  trustedIps: z.nullable(z.lazy(() => UpdateProjectTrustedIps$outboundSchema))
    .optional(),
  trustedSources: z.nullable(z.lazy(() => TrustedSources$outboundSchema))
    .optional(),
  deploymentPolicy: smartUnion([
    z.lazy(() => DeploymentPolicy1$outboundSchema),
    z.string(),
  ]).optional(),
  optionsAllowlist: z.nullable(
    z.lazy(() => UpdateProjectOptionsAllowlist$outboundSchema),
  ).optional(),
  connectConfigurations: z.nullable(
    z.array(z.lazy(() => ConnectConfigurations1$outboundSchema)),
  ).optional(),
  dismissedToasts: z.array(
    z.lazy(() => UpdateProjectDismissedToasts$outboundSchema),
  ).optional(),
});

export function updateProjectRequestBodyToJSON(
  updateProjectRequestBody: UpdateProjectRequestBody,
): string {
  return JSON.stringify(
    UpdateProjectRequestBody$outboundSchema.parse(updateProjectRequestBody),
  );
}

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

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

export function updateProjectRequestToJSON(
  updateProjectRequest: UpdateProjectRequest,
): string {
  return JSON.stringify(
    UpdateProjectRequest$outboundSchema.parse(updateProjectRequest),
  );
}

/** @internal */
export const UpdateProjectAnalytics$inboundSchema: z.ZodType<
  UpdateProjectAnalytics,
  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 updateProjectAnalyticsFromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectAnalytics, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectAnalytics$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectAnalytics' from JSON`,
  );
}

/** @internal */
export const UpdateProjectSpeedInsights$inboundSchema: z.ZodType<
  UpdateProjectSpeedInsights,
  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 updateProjectSpeedInsightsFromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectSpeedInsights, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectSpeedInsights$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectSpeedInsights' from JSON`,
  );
}

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectCrons$inboundSchema: z.ZodType<
  UpdateProjectCrons,
  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(() => UpdateProjectDefinitions$inboundSchema)),
});

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

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

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

/** @internal */
export const UpdateProjectDeploymentExpiration$inboundSchema: z.ZodType<
  UpdateProjectDeploymentExpiration,
  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 updateProjectDeploymentExpirationFromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectDeploymentExpiration, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectDeploymentExpiration$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectDeploymentExpiration' from JSON`,
  );
}

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectContentHint16$inboundSchema: z.ZodType<
  UpdateProjectContentHint16,
  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 updateProjectContentHint16FromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectContentHint16, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectContentHint16$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectContentHint16' from JSON`,
  );
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectContentHint$inboundSchema: z.ZodType<
  UpdateProjectContentHint,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => UpdateProjectContentHint1$inboundSchema),
  z.lazy(() => UpdateProjectContentHint2$inboundSchema),
  z.lazy(() => UpdateProjectContentHint3$inboundSchema),
  z.lazy(() => UpdateProjectContentHint4$inboundSchema),
  z.lazy(() => UpdateProjectContentHint5$inboundSchema),
  z.lazy(() => UpdateProjectContentHint6$inboundSchema),
  z.lazy(() => UpdateProjectContentHint7$inboundSchema),
  z.lazy(() => UpdateProjectContentHint8$inboundSchema),
  z.lazy(() => UpdateProjectContentHint9$inboundSchema),
  z.lazy(() => UpdateProjectContentHint10$inboundSchema),
  z.lazy(() => UpdateProjectContentHint11$inboundSchema),
  z.lazy(() => UpdateProjectContentHint12$inboundSchema),
  z.lazy(() => UpdateProjectContentHint13$inboundSchema),
  z.lazy(() => UpdateProjectContentHint14$inboundSchema),
  z.lazy(() => UpdateProjectContentHint15$inboundSchema),
  z.lazy(() => UpdateProjectContentHint16$inboundSchema),
  z.lazy(() => UpdateProjectContentHint17$inboundSchema),
]);

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

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

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

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

/** @internal */
export const UpdateProjectProjectsEnv$inboundSchema: z.ZodType<
  UpdateProjectProjectsEnv,
  z.ZodTypeDef,
  unknown
> = z.object({
  target: types.optional(
    smartUnion([z.array(types.string()), UpdateProjectTarget2$inboundSchema]),
  ),
  type: UpdateProjectType$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(() => UpdateProjectContentHint1$inboundSchema),
      z.lazy(() => UpdateProjectContentHint2$inboundSchema),
      z.lazy(() => UpdateProjectContentHint3$inboundSchema),
      z.lazy(() => UpdateProjectContentHint4$inboundSchema),
      z.lazy(() => UpdateProjectContentHint5$inboundSchema),
      z.lazy(() => UpdateProjectContentHint6$inboundSchema),
      z.lazy(() => UpdateProjectContentHint7$inboundSchema),
      z.lazy(() => UpdateProjectContentHint8$inboundSchema),
      z.lazy(() => UpdateProjectContentHint9$inboundSchema),
      z.lazy(() => UpdateProjectContentHint10$inboundSchema),
      z.lazy(() => UpdateProjectContentHint11$inboundSchema),
      z.lazy(() => UpdateProjectContentHint12$inboundSchema),
      z.lazy(() => UpdateProjectContentHint13$inboundSchema),
      z.lazy(() => UpdateProjectContentHint14$inboundSchema),
      z.lazy(() => UpdateProjectContentHint15$inboundSchema),
      z.lazy(() => UpdateProjectContentHint16$inboundSchema),
      z.lazy(() => UpdateProjectContentHint17$inboundSchema),
    ]),
  ).optional(),
  internalContentHint: z.nullable(
    z.lazy(() => UpdateProjectInternalContentHint$inboundSchema),
  ).optional(),
  comment: types.optional(types.string()),
  customEnvironmentIds: types.optional(z.array(types.string())),
});

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectDomains$inboundSchema: z.ZodType<
  UpdateProjectDomains,
  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(() => UpdateProjectVerification$inboundSchema)),
  ),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectCreator$inboundSchema: z.ZodType<
  UpdateProjectCreator,
  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 updateProjectCreatorFromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectCreator, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectCreator$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectCreator' from JSON`,
  );
}

/** @internal */
export const UpdateProjectLatestDeployments$inboundSchema: z.ZodType<
  UpdateProjectLatestDeployments,
  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(() => UpdateProjectBuilds$inboundSchema)),
  ),
  createdAt: types.number(),
  createdIn: types.string(),
  creator: types.nullable(z.lazy(() => UpdateProjectCreator$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 updateProjectLatestDeploymentsFromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectLatestDeployments, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectLatestDeployments$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectLatestDeployments' from JSON`,
  );
}

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

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

/** @internal */
export const UpdateProjectLink6$inboundSchema: z.ZodType<
  UpdateProjectLink6,
  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(() =>
      UpdateProjectLinkProjectsResponse200ApplicationJSONResponseBodyDeployHooks$inboundSchema
    ),
  ),
  gitCredentialId: types.string(),
  updatedAt: types.optional(types.number()),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

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

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

/** @internal */
export const UpdateProjectLink5$inboundSchema: z.ZodType<
  UpdateProjectLink5,
  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(() =>
      UpdateProjectLinkProjectsResponse200ApplicationJSONDeployHooks$inboundSchema
    ),
  ),
  gitCredentialId: types.string(),
  updatedAt: types.optional(types.number()),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

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

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

/** @internal */
export const UpdateProjectLink4$inboundSchema: z.ZodType<
  UpdateProjectLink4,
  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(() => UpdateProjectLinkProjectsResponse200DeployHooks$inboundSchema),
  ),
  gitCredentialId: types.string(),
  updatedAt: types.optional(types.number()),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

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

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

/** @internal */
export const UpdateProjectLink3$inboundSchema: z.ZodType<
  UpdateProjectLink3,
  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(() => UpdateProjectLinkProjectsResponseDeployHooks$inboundSchema),
  ),
  gitCredentialId: types.string(),
  updatedAt: types.optional(types.number()),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

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

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

/** @internal */
export const UpdateProjectLink2$inboundSchema: z.ZodType<
  UpdateProjectLink2,
  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(() => UpdateProjectLinkProjectsDeployHooks$inboundSchema),
  ),
  gitCredentialId: types.string(),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

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

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

/** @internal */
export const UpdateProjectLink1$inboundSchema: z.ZodType<
  UpdateProjectLink1,
  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(() => UpdateProjectLinkDeployHooks$inboundSchema),
  ),
  gitCredentialId: types.string(),
  updatedAt: types.optional(types.number()),
  sourceless: types.optional(types.boolean()),
  productionBranch: types.string(),
});

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

/** @internal */
export const UpdateProjectLink$inboundSchema: z.ZodType<
  UpdateProjectLink,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => UpdateProjectLink1$inboundSchema),
  z.lazy(() => UpdateProjectLink2$inboundSchema),
  z.lazy(() => UpdateProjectLink3$inboundSchema),
  z.lazy(() => UpdateProjectLink4$inboundSchema),
  z.lazy(() => UpdateProjectLink5$inboundSchema),
  z.lazy(() => UpdateProjectLink6$inboundSchema),
]);

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

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

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

/** @internal */
export const UpdateProjectMicrofrontends2$inboundSchema: z.ZodType<
  UpdateProjectMicrofrontends2,
  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 updateProjectMicrofrontends2FromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectMicrofrontends2, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectMicrofrontends2$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectMicrofrontends2' from JSON`,
  );
}

/** @internal */
export const UpdateProjectMicrofrontends1$inboundSchema: z.ZodType<
  UpdateProjectMicrofrontends1,
  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 updateProjectMicrofrontends1FromJSON(
  jsonString: string,
): SafeParseResult<UpdateProjectMicrofrontends1, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => UpdateProjectMicrofrontends1$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'UpdateProjectMicrofrontends1' from JSON`,
  );
}

/** @internal */
export const UpdateProjectMicrofrontends$inboundSchema: z.ZodType<
  UpdateProjectMicrofrontends,
  z.ZodTypeDef,
  unknown
> = smartUnion([
  z.lazy(() => UpdateProjectMicrofrontends1$inboundSchema),
  z.lazy(() => UpdateProjectMicrofrontends2$inboundSchema),
  z.lazy(() => UpdateProjectMicrofrontends3$inboundSchema),
]);

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

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

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

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

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

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