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>

2,682 lines 89.6 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";
import {
  UpdateProjectAlias,
  UpdateProjectAlias$inboundSchema,
  UpdateProjectAnalytics,
  UpdateProjectAnalytics$inboundSchema,
  UpdateProjectConnectConfigurations,
  UpdateProjectConnectConfigurations$inboundSchema,
  UpdateProjectCreator,
  UpdateProjectCreator$inboundSchema,
  UpdateProjectCrons,
  UpdateProjectCrons$inboundSchema,
  UpdateProjectDataCache,
  UpdateProjectDataCache$inboundSchema,
  UpdateProjectDeploymentExpiration,
  UpdateProjectDeploymentExpiration$inboundSchema,
  UpdateProjectExpiration,
  UpdateProjectExpiration$inboundSchema,
  UpdateProjectProjectsEnv,
  UpdateProjectProjectsEnv$inboundSchema,
  UpdateProjectSpeedInsights,
  UpdateProjectSpeedInsights$inboundSchema,
} from "./updateprojectprojectsresponse200applicationjsonresponsebodycustomenvironmentstype.js";
import {
  UpdateProjectBlobs,
  UpdateProjectBlobs$inboundSchema,
  UpdateProjectCustomEnvironments,
  UpdateProjectCustomEnvironments$inboundSchema,
  UpdateProjectDefaultResourceConfig,
  UpdateProjectDefaultResourceConfig$inboundSchema,
  UpdateProjectGitComments,
  UpdateProjectGitComments$inboundSchema,
  UpdateProjectGitProviderOptions,
  UpdateProjectGitProviderOptions$inboundSchema,
  UpdateProjectIpBuckets,
  UpdateProjectIpBuckets$inboundSchema,
  UpdateProjectJobs,
  UpdateProjectJobs$inboundSchema,
  UpdateProjectLastAliasRequest,
  UpdateProjectLastAliasRequest$inboundSchema,
  UpdateProjectLastRollbackTarget,
  UpdateProjectLastRollbackTarget$inboundSchema,
  UpdateProjectLatestDeployments,
  UpdateProjectLatestDeployments$inboundSchema,
  UpdateProjectLink,
  UpdateProjectLink$inboundSchema,
  UpdateProjectMicrofrontends,
  UpdateProjectMicrofrontends$inboundSchema,
  UpdateProjectPermissions,
  UpdateProjectPermissions$inboundSchema,
  UpdateProjectProjectsFramework,
  UpdateProjectProjectsFramework$inboundSchema,
  UpdateProjectProjectsNodeVersion,
  UpdateProjectProjectsNodeVersion$inboundSchema,
  UpdateProjectProjectsOptionsAllowlist,
  UpdateProjectProjectsOptionsAllowlist$inboundSchema,
  UpdateProjectProjectsPassport,
  UpdateProjectProjectsPassport$inboundSchema,
  UpdateProjectProjectsPasswordProtection,
  UpdateProjectProjectsPasswordProtection$inboundSchema,
  UpdateProjectProjectsResourceConfig,
  UpdateProjectProjectsResourceConfig$inboundSchema,
  UpdateProjectProjectsSandbox,
  UpdateProjectProjectsSandbox$inboundSchema,
  UpdateProjectProjectsSsoProtection,
  UpdateProjectProjectsSsoProtection$inboundSchema,
  UpdateProjectProjectsStaticIps,
  UpdateProjectProjectsStaticIps$inboundSchema,
  UpdateProjectProjectsTrustedIps,
  UpdateProjectProjectsTrustedIps$inboundSchema,
  UpdateProjectProtectionBypass,
  UpdateProjectProtectionBypass$inboundSchema,
  UpdateProjectProtectionConfig,
  UpdateProjectProtectionConfig$inboundSchema,
  UpdateProjectRollbackDescription,
  UpdateProjectRollbackDescription$inboundSchema,
  UpdateProjectRollingRelease,
  UpdateProjectRollingRelease$inboundSchema,
  UpdateProjectRulesets,
  UpdateProjectRulesets$inboundSchema,
  UpdateProjectServices,
  UpdateProjectServices$inboundSchema,
  UpdateProjectTargets,
  UpdateProjectTargets$inboundSchema,
  UpdateProjectTrafficSources,
  UpdateProjectTrafficSources$inboundSchema,
  UpdateProjectTrustedSources,
  UpdateProjectTrustedSources$inboundSchema,
  UpdateProjectVercelRuleset,
  UpdateProjectVercelRuleset$inboundSchema,
  UpdateProjectWebAnalytics,
  UpdateProjectWebAnalytics$inboundSchema,
} from "./updateprojecttrafficsources.js";

export const UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesBotFilterAction =
  {
    Challenge: "challenge",
    Deny: "deny",
    Log: "log",
  } as const;
export type UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesBotFilterAction =
  ClosedEnum<
    typeof UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesBotFilterAction
  >;

export type UpdateProjectBotFilter = {
  active: boolean;
  action?:
    | UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesBotFilterAction
    | undefined;
};

export const UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityAction =
  {
    Challenge: "challenge",
    Deny: "deny",
    Log: "log",
  } as const;
export type UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityAction =
  ClosedEnum<
    typeof UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityAction
  >;

export type UpdateProjectAiBots = {
  active: boolean;
  action?:
    | UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityAction
    | undefined;
};

export const UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesAction =
  {
    Challenge: "challenge",
    Deny: "deny",
    Log: "log",
  } as const;
export type UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesAction =
  ClosedEnum<
    typeof UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesAction
  >;

export type UpdateProjectOwasp = {
  active: boolean;
  action?:
    | UpdateProjectProjectsResponse200ApplicationJSONResponseBodySecurityManagedRulesAction
    | undefined;
};

export type UpdateProjectManagedRules = {
  vercelRuleset: UpdateProjectVercelRuleset;
  trafficSources: UpdateProjectTrafficSources;
  botFilter: UpdateProjectBotFilter;
  aiBots: UpdateProjectAiBots;
  owasp: UpdateProjectOwasp;
};

export const UpdateProjectLogHeaders2 = {
  Wildcard: "*",
} as const;
export type UpdateProjectLogHeaders2 = ClosedEnum<
  typeof UpdateProjectLogHeaders2
>;

export type UpdateProjectLogHeaders = Array<string> | UpdateProjectLogHeaders2;

export type UpdateProjectSecurityPlusMetadata = {
  updatedAt: number;
  /**
   * Timestamp when the feature was first enabled. Never changes after initial enablement.
   */
  firstEnabledAt?: number | undefined;
};

export type UpdateProjectSecurity = {
  attackModeEnabled?: boolean | undefined;
  attackModeUpdatedAt?: number | undefined;
  firewallEnabled?: boolean | undefined;
  firewallUpdatedAt?: number | undefined;
  attackModeActiveUntil?: number | null | undefined;
  firewallConfigVersion?: number | undefined;
  rulesets?: { [k: string]: UpdateProjectRulesets } | undefined;
  firewallSeawallEnabled?: boolean | undefined;
  ja3Enabled?: boolean | undefined;
  ja4Enabled?: boolean | undefined;
  firewallBypassIps?: Array<string> | undefined;
  managedRules?: UpdateProjectManagedRules | null | undefined;
  botIdEnabled?: boolean | undefined;
  logHeaders?: Array<string> | UpdateProjectLogHeaders2 | undefined;
  securityPlus?: boolean | undefined;
  securityPlusMetadata?: UpdateProjectSecurityPlusMetadata | undefined;
  /**
   * Whether Page Integrity is enabled for this project. Used by the metadata service to gate DynamoDB lookups against the page-integrity-inventory table.
   */
  pageIntegrityEnabled?: boolean | undefined;
};

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

export type UpdateProjectProjectsOidcTokenConfig = {
  /**
   * Whether or not to generate OpenID Connect JSON Web Tokens.
   */
  enabled?: boolean | undefined;
  /**
   * - team: `https://oidc.vercel.com/[team_slug]` - global: `https://oidc.vercel.com`
   */
  issuerMode?: UpdateProjectProjectsIssuerMode | undefined;
};

/**
 * Allowlist entry for GitLab, which uses nested groups rather than a flat org/repo. `namespace` is the full group path (e.g. `group` or `group/subgroup`); `project` is the leaf project name. Omit `project` to match any project under the namespace. Namespace is matched case-insensitively.
 */
export type UpdateProjectSourcesProjects2 = {
  provider: "gitlab";
  namespace: string;
  project?: string | undefined;
};

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

/**
 * Allowlist entry for GitHub and Bitbucket, whose repos are identified by a flat `org`/`repo` (Bitbucket's workspace/owner maps to `org`, its repo slug to `repo`). Omit `repo` to match any repo in the org. Org is matched case-insensitively.
 */
export type UpdateProjectSourcesProjects1 = {
  provider: UpdateProjectSourcesProjectsResponse200Provider;
  org: string;
  repo?: string | undefined;
};

export type UpdateProjectSources =
  | (UpdateProjectSourcesProjects1 & { provider: "bitbucket" })
  | (UpdateProjectSourcesProjects1 & { provider: "github" })
  | UpdateProjectSourcesProjects2;

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

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

export type UpdateProjectEnvironmentsProjectsResponse1 = {
  type: "system";
  target: UpdateProjectEnvironmentsProjectsResponse200Target;
};

export type UpdateProjectEnvironments =
  | UpdateProjectEnvironmentsProjectsResponse1
  | UpdateProjectEnvironmentsProjectsResponse2002;

/**
 * `enabled: true` with empty `sources` is deny-all.
 */
export type UpdateProjectGitSources = {
  sources: Array<
    | (UpdateProjectSourcesProjects1 & { provider: "bitbucket" })
    | (UpdateProjectSourcesProjects1 & { provider: "github" })
    | UpdateProjectSourcesProjects2
  >;
  enabled: boolean;
  environments: Array<
    | UpdateProjectEnvironmentsProjectsResponse1
    | UpdateProjectEnvironmentsProjectsResponse2002
  >;
};

/**
 * Customer-configurable deployment sources. Every deploy classifies to exactly one. JSON schema in `packages/deployment-policy/schemas/body.ts` enumerates exactly these values. - `'git'` — git provider webhook. - `'cli'` — Vercel CLI (legacy classic-token CLI and SIWV CLI both). - `'rest-api'` — direct user/team-token REST upload. Does NOT cover deploy hooks, Marketplace integrations, or first-party app tokens. - `'deploy-hook'` — project deploy-hook URL. The URL is the credential. - `'integration'` — third-party Marketplace actor: Marketplace integration token, user-delegated OAuth from a Marketplace app, or an unrecognized third-party Vercel App. First-party Vercel Apps are never `'integration'`. - `'v0'` — the v0 product surface (entitlement-gated). v0 deploys through the CLI under the hood, but classifies as its own source so a team can allow or deny v0 independently of `'cli'`. First-party Vercel apps (Toolbar, etc.) classify as `'first-party'` — see `ClassifiedSource` in `./checks`. They're not in this union because they aren't customer-configurable; they bypass `checkDeploymentSources` entirely. v0 is intentionally NOT among them: like the CLI, it's a real product surface and is policy-controllable.
 */
export const UpdateProjectProjectsSources = {
  Cli: "cli",
  DeployHook: "deploy-hook",
  Git: "git",
  Integration: "integration",
  RestApi: "rest-api",
  V0: "v0",
} as const;
/**
 * Customer-configurable deployment sources. Every deploy classifies to exactly one. JSON schema in `packages/deployment-policy/schemas/body.ts` enumerates exactly these values. - `'git'` — git provider webhook. - `'cli'` — Vercel CLI (legacy classic-token CLI and SIWV CLI both). - `'rest-api'` — direct user/team-token REST upload. Does NOT cover deploy hooks, Marketplace integrations, or first-party app tokens. - `'deploy-hook'` — project deploy-hook URL. The URL is the credential. - `'integration'` — third-party Marketplace actor: Marketplace integration token, user-delegated OAuth from a Marketplace app, or an unrecognized third-party Vercel App. First-party Vercel Apps are never `'integration'`. - `'v0'` — the v0 product surface (entitlement-gated). v0 deploys through the CLI under the hood, but classifies as its own source so a team can allow or deny v0 independently of `'cli'`. First-party Vercel apps (Toolbar, etc.) classify as `'first-party'` — see `ClassifiedSource` in `./checks`. They're not in this union because they aren't customer-configurable; they bypass `checkDeploymentSources` entirely. v0 is intentionally NOT among them: like the CLI, it's a real product surface and is policy-controllable.
 */
export type UpdateProjectProjectsSources = ClosedEnum<
  typeof UpdateProjectProjectsSources
>;

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

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

export type UpdateProjectEnvironmentsProjectsResponse2001 = {
  type: "system";
  target: UpdateProjectEnvironmentsProjectsResponseTarget;
};

export type UpdateProjectProjectsEnvironments =
  | UpdateProjectEnvironmentsProjectsResponse2001
  | UpdateProjectEnvironmentsProjectsResponse2;

/**
 * `enabled: true` with empty `sources` is deny-all.
 */
export type UpdateProjectDeploymentSources = {
  sources: Array<UpdateProjectProjectsSources>;
  enabled: boolean;
  environments: Array<
    | UpdateProjectEnvironmentsProjectsResponse2001
    | UpdateProjectEnvironmentsProjectsResponse2
  >;
};

/**
 * Project shape. `null` on a rule list clears the project's override for that rule type (fall back to team for every env); omitting is equivalent. Setting `deploymentPolicy` itself to `null` clears every override at once. Kept structurally distinct from {@link TeamDeploymentPolicy} so the two storage locations don't share a type by accident.
 */
export type UpdateProjectProjectsDeploymentPolicy = {
  gitSources?: Array<UpdateProjectGitSources> | null | undefined;
  deploymentSources?: Array<UpdateProjectDeploymentSources> | null | undefined;
};

export const UpdateProjectTier = {
  Advanced: "advanced",
  Critical: "critical",
  Priority: "priority",
} as const;
export type UpdateProjectTier = ClosedEnum<typeof UpdateProjectTier>;

/**
 * Billing mode. Always 'flat' for flat-rate projects.
 */
export const UpdateProjectKind = {
  Flat: "flat",
} as const;
/**
 * Billing mode. Always 'flat' for flat-rate projects.
 */
export type UpdateProjectKind = ClosedEnum<typeof UpdateProjectKind>;

export type UpdateProjectUsageStatus = {
  /**
   * Billing mode. Always 'flat' for flat-rate projects.
   */
  kind: UpdateProjectKind;
  /**
   * Timestamp until which the project has exceeded its CDN allowance.
   */
  exceededAllowanceUntil?: number | undefined;
  /**
   * Timestamp until which throttling is bypassed (project pays list rates for overage).
   */
  bypassThrottleUntil?: number | undefined;
  /**
   * Per-project throttle, set explicitly for this project (e.g. via the per-project Flat Rate CDN endpoint).
   */
  throttled?: boolean | undefined;
  /**
   * Synced from `team.billing.usageStatus.throttled`. When `true`, the team has throttled all of its projects regardless of `throttled`. The effective throttle the CDN enforces is `throttled || teamThrottled`.
   */
  teamThrottled?: boolean | undefined;
};

export type UpdateProjectFeatures = {
  webAnalytics?: boolean | undefined;
};

export type UpdateProjectHistory = {
  scanner: string;
  reason: string;
  by: string;
  byId: string;
  at: number;
};

export const UpdateProjectProjectsResponse200Action = {
  Blocked: "blocked",
} as const;
export type UpdateProjectProjectsResponse200Action = ClosedEnum<
  typeof UpdateProjectProjectsResponse200Action
>;

export type UpdateProjectBlock = {
  action: UpdateProjectProjectsResponse200Action;
  reason: string;
  statusCode: number;
  createdAt: number;
  caseId?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
  ineligibleForAppeal?: boolean | undefined;
  isCascading?: boolean | undefined;
};

export type UpdateProjectHasProjectsResponse200Value = {
  eq: string;
};

export type UpdateProjectHasProjects2 = {
  type: "host";
  value: UpdateProjectHasProjectsResponse200Value;
};

export const UpdateProjectHasProjectsKey = {
  XVercelIpCountry: "x-vercel-ip-country",
} as const;
export type UpdateProjectHasProjectsKey = ClosedEnum<
  typeof UpdateProjectHasProjectsKey
>;

export type UpdateProjectHasProjectsResponseValue = {
  eq: string;
};

export type UpdateProjectHasProjects1 = {
  type: "header";
  key: UpdateProjectHasProjectsKey;
  value: UpdateProjectHasProjectsResponseValue;
};

export type UpdateProjectRouteProjectsHas =
  | UpdateProjectHasProjects1
  | UpdateProjectHasProjects2;

export const UpdateProjectRouteProjectsAction = {
  BlockLegalCwc: "block_legal_cwc",
} as const;
export type UpdateProjectRouteProjectsAction = ClosedEnum<
  typeof UpdateProjectRouteProjectsAction
>;

export type UpdateProjectRouteProjectsMitigate = {
  action: UpdateProjectRouteProjectsAction;
};

export type UpdateProjectRouteProjects2 = {
  has: Array<UpdateProjectHasProjects1 | UpdateProjectHasProjects2>;
  mitigate: UpdateProjectRouteProjectsMitigate;
  src?: string | undefined;
};

export type UpdateProjectRouteProjects1 = {
  src: string;
  status: number;
  expiry?: number | undefined;
};

export type UpdateProjectBlockHistoryProjectsRoute =
  | UpdateProjectRouteProjects1
  | UpdateProjectRouteProjects2;

export type UpdateProjectBlockHistory4 = {
  action: "route-unblocked";
  route: UpdateProjectRouteProjects1 | UpdateProjectRouteProjects2;
  statusCode?: number | undefined;
  createdAt: number;
  caseId?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
  ineligibleForAppeal?: boolean | undefined;
  isCascading?: boolean | undefined;
};

export type UpdateProjectHasProjectsResponse200ApplicationJSONResponseBodyValue =
  {
    eq: string;
  };

export type UpdateProjectHasProjectsResponse2 = {
  type: "host";
  value: UpdateProjectHasProjectsResponse200ApplicationJSONResponseBodyValue;
};

export const UpdateProjectHasProjectsResponseKey = {
  XVercelIpCountry: "x-vercel-ip-country",
} as const;
export type UpdateProjectHasProjectsResponseKey = ClosedEnum<
  typeof UpdateProjectHasProjectsResponseKey
>;

export type UpdateProjectHasProjectsResponse200ApplicationJSONValue = {
  eq: string;
};

export type UpdateProjectHasProjectsResponse1 = {
  type: "header";
  key: UpdateProjectHasProjectsResponseKey;
  value: UpdateProjectHasProjectsResponse200ApplicationJSONValue;
};

export type UpdateProjectRouteHas =
  | UpdateProjectHasProjectsResponse1
  | UpdateProjectHasProjectsResponse2;

export const UpdateProjectRouteAction = {
  BlockLegalCwc: "block_legal_cwc",
} as const;
export type UpdateProjectRouteAction = ClosedEnum<
  typeof UpdateProjectRouteAction
>;

export type UpdateProjectRouteMitigate = {
  action: UpdateProjectRouteAction;
};

export type UpdateProjectRoute2 = {
  has: Array<
    UpdateProjectHasProjectsResponse1 | UpdateProjectHasProjectsResponse2
  >;
  mitigate: UpdateProjectRouteMitigate;
  src?: string | undefined;
};

export type UpdateProjectRoute1 = {
  src: string;
  status: number;
  expiry?: number | undefined;
};

export type UpdateProjectBlockHistoryRoute =
  | UpdateProjectRoute1
  | UpdateProjectRoute2;

export type UpdateProjectBlockHistory3 = {
  action: "route-blocked";
  route: UpdateProjectRoute1 | UpdateProjectRoute2;
  reason: string;
  createdAt: number;
  caseId?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
  ineligibleForAppeal?: boolean | undefined;
  isCascading?: boolean | undefined;
};

export type UpdateProjectBlockHistory2 = {
  action: "unblocked";
  createdAt: number;
  caseId?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
  ineligibleForAppeal?: boolean | undefined;
  isCascading?: boolean | undefined;
};

export type UpdateProjectBlockHistory1 = {
  action: "blocked";
  reason: string;
  statusCode: number;
  createdAt: number;
  caseId?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
  ineligibleForAppeal?: boolean | undefined;
  isCascading?: boolean | undefined;
};

export type UpdateProjectBlockHistory =
  | UpdateProjectBlockHistory1
  | UpdateProjectBlockHistory2
  | UpdateProjectBlockHistory3
  | UpdateProjectBlockHistory4;

export const UpdateProjectProjectsResponse200ApplicationJSONAction = {
  AddDeploymentInterstitial: "add-deployment-interstitial",
  AddProjectInterstitial: "add-project-interstitial",
  RemoveDeploymentInterstitial: "remove-deployment-interstitial",
  RemoveProjectInterstitial: "remove-project-interstitial",
} as const;
export type UpdateProjectProjectsResponse200ApplicationJSONAction = ClosedEnum<
  typeof UpdateProjectProjectsResponse200ApplicationJSONAction
>;

export type UpdateProjectInterstitialHistory = {
  action: UpdateProjectProjectsResponse200ApplicationJSONAction;
  createdAt: number;
  caseId?: string | undefined;
  reason?: string | undefined;
  actor?: string | undefined;
  comment?: string | undefined;
};

export type UpdateProjectAbuse = {
  scanner?: string | undefined;
  history: Array<UpdateProjectHistory>;
  updatedAt: number;
  block?: UpdateProjectBlock | undefined;
  blockHistory?:
    | Array<
      | UpdateProjectBlockHistory1
      | UpdateProjectBlockHistory2
      | UpdateProjectBlockHistory3
      | UpdateProjectBlockHistory4
    >
    | undefined;
  interstitial?: boolean | undefined;
  interstitialHistory?: Array<UpdateProjectInterstitialHistory> | undefined;
};

export type UpdateProjectHasProjectsValue = {
  eq: string;
};

export type UpdateProjectHas2 = {
  type: "host";
  value: UpdateProjectHasProjectsValue;
};

export const UpdateProjectHasKey = {
  XVercelIpCountry: "x-vercel-ip-country",
} as const;
export type UpdateProjectHasKey = ClosedEnum<typeof UpdateProjectHasKey>;

export type UpdateProjectHasValue = {
  eq: string;
};

export type UpdateProjectHas1 = {
  type: "header";
  key: UpdateProjectHasKey;
  value: UpdateProjectHasValue;
};

export type UpdateProjectInternalRoutesHas =
  | UpdateProjectHas1
  | UpdateProjectHas2;

export const UpdateProjectInternalRoutesAction = {
  BlockLegalCwc: "block_legal_cwc",
} as const;
export type UpdateProjectInternalRoutesAction = ClosedEnum<
  typeof UpdateProjectInternalRoutesAction
>;

export type UpdateProjectInternalRoutesMitigate = {
  action: UpdateProjectInternalRoutesAction;
};

export type UpdateProjectInternalRoutes2 = {
  has: Array<UpdateProjectHas1 | UpdateProjectHas2>;
  mitigate: UpdateProjectInternalRoutesMitigate;
  src?: string | undefined;
};

export type UpdateProjectInternalRoutes1 = {
  src: string;
  status: number;
  expiry?: number | undefined;
};

export type UpdateProjectInternalRoutes =
  | UpdateProjectInternalRoutes1
  | UpdateProjectInternalRoutes2;

export const UpdateProjectProjectsAction = {
  Accept: "accept",
  Cancel: "cancel",
  Delete: "delete",
} as const;
export type UpdateProjectProjectsAction = ClosedEnum<
  typeof UpdateProjectProjectsAction
>;

export type UpdateProjectValuePreviousValue = string | number | boolean;

export type UpdateProjectValueCurrentValue = string | number | boolean;

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

export type UpdateProjectValue =
  | UpdateProjectValue3
  | string
  | number
  | boolean;

export type UpdateProjectProjectsDismissedToasts = {
  key: string;
  dismissedAt: number;
  action: UpdateProjectProjectsAction;
  value: UpdateProjectValue3 | string | number | boolean | null;
};

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

/**
 * Which tracing destination this rule applies to. `internal` is the hidden Vercel production-tracing drain (internal delivery); `external` is any customer-configured drain. Derived from the owning drain's delivery type when project tracing is computed; absent on configs persisted before this field existed.
 */
export const UpdateProjectDestination = {
  External: "external",
  Internal: "internal",
} as const;
/**
 * Which tracing destination this rule applies to. `internal` is the hidden Vercel production-tracing drain (internal delivery); `external` is any customer-configured drain. Derived from the owning drain's delivery type when project tracing is computed; absent on configs persisted before this field existed.
 */
export type UpdateProjectDestination = ClosedEnum<
  typeof UpdateProjectDestination
>;

export type UpdateProjectSamplingRules = {
  rate: number;
  env?: UpdateProjectProjectsResponseEnv | undefined;
  requestPath?: string | undefined;
  /**
   * Which tracing destination this rule applies to. `internal` is the hidden Vercel production-tracing drain (internal delivery); `external` is any customer-configured drain. Derived from the owning drain's delivery type when project tracing is computed; absent on configs persisted before this field existed.
   */
  destination?: UpdateProjectDestination | undefined;
};

export type UpdateProjectProjectsTracing = {
  domains?: string | undefined;
  ignorePaths?: Array<string> | undefined;
  samplingRules?: Array<UpdateProjectSamplingRules> | undefined;
};

/**
 * The project was successfully updated
 */
export type UpdateProjectResponseBody = {
  accountId: string;
  creator?: UpdateProjectCreator | undefined;
  alias: Array<UpdateProjectAlias>;
  analytics?: UpdateProjectAnalytics | undefined;
  appliedCve55182Migration?: boolean | undefined;
  speedInsights?: UpdateProjectSpeedInsights | undefined;
  autoExposeSystemEnvs?: boolean | undefined;
  autoAssignCustomDomains?: boolean | undefined;
  autoAssignCustomDomainsUpdatedBy?: string | undefined;
  buildCommand?: string | null | undefined;
  commandForIgnoringBuildStep?: string | null | undefined;
  connectConfigurations?:
    | Array<UpdateProjectConnectConfigurations>
    | null
    | undefined;
  connectConfigurationId?: string | null | undefined;
  connectBuildsEnabled?: boolean | undefined;
  passiveConnectConfigurationId?: string | null | undefined;
  createdAt?: number | undefined;
  customerSupportCodeVisibility?: boolean | undefined;
  crons?: UpdateProjectCrons | undefined;
  dataCache?: UpdateProjectDataCache | 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.
   */
  deploymentExpiration: UpdateProjectDeploymentExpiration;
  expiration?: UpdateProjectExpiration | undefined;
  devCommand?: string | null | undefined;
  directoryListing: boolean;
  installCommand?: string | null | undefined;
  env?: Array<UpdateProjectProjectsEnv> | undefined;
  customEnvironments?: Array<UpdateProjectCustomEnvironments> | undefined;
  framework?: UpdateProjectProjectsFramework | null | undefined;
  services?: Array<UpdateProjectServices> | undefined;
  gitForkProtection?: boolean | undefined;
  gitLFS?: boolean | undefined;
  id: string;
  ipBuckets?: Array<UpdateProjectIpBuckets> | undefined;
  jobs?: UpdateProjectJobs | undefined;
  latestDeployments?: Array<UpdateProjectLatestDeployments> | undefined;
  link?: UpdateProjectLink | undefined;
  blobs?: UpdateProjectBlobs | undefined;
  microfrontends?: UpdateProjectMicrofrontends | undefined;
  name: string;
  nodeVersion: UpdateProjectProjectsNodeVersion;
  optionsAllowlist?: UpdateProjectProjectsOptionsAllowlist | null | undefined;
  outputDirectory?: string | null | undefined;
  passwordProtection?:
    | UpdateProjectProjectsPasswordProtection
    | null
    | undefined;
  passport?: UpdateProjectProjectsPassport | null | undefined;
  protectionConfig?: UpdateProjectProtectionConfig | undefined;
  sandbox?: UpdateProjectProjectsSandbox | undefined;
  productionDeploymentsFastLane?: boolean | undefined;
  resourceConfig: UpdateProjectProjectsResourceConfig;
  /**
   * Description of why a project was rolled back, and by whom. Note that lastAliasRequest contains the from/to details of the rollback.
   */
  rollbackDescription?: UpdateProjectRollbackDescription | undefined;
  /**
   * Project-level rolling release configuration that defines how deployments should be gradually rolled out
   */
  rollingRelease?: UpdateProjectRollingRelease | null | undefined;
  defaultResourceConfig: UpdateProjectDefaultResourceConfig;
  rootDirectory?: string | null | undefined;
  serverlessFunctionZeroConfigFailover?: boolean | undefined;
  skewProtectionBoundaryAt?: number | undefined;
  skewProtectionMaxAge?: number | undefined;
  skewProtectionAllowedDomains?: Array<string> | undefined;
  skipGitConnectDuringLink?: boolean | undefined;
  staticIps?: UpdateProjectProjectsStaticIps | undefined;
  sourceFilesOutsideRootDirectory?: boolean | undefined;
  enableAffectedProjectsDeployments?: boolean | undefined;
  enableExternalRewriteCaching?: boolean | undefined;
  ssoProtection?: UpdateProjectProjectsSsoProtection | null | undefined;
  targets?: { [k: string]: UpdateProjectTargets | null } | undefined;
  transferCompletedAt?: number | undefined;
  transferStartedAt?: number | undefined;
  transferToAccountId?: string | undefined;
  transferredFromAccountId?: string | undefined;
  updatedAt?: number | undefined;
  live?: boolean | undefined;
  enablePreviewFeedback?: boolean | null | undefined;
  enableProductionFeedback?: boolean | null | undefined;
  permissions?: UpdateProjectPermissions | undefined;
  lastRollbackTarget?: UpdateProjectLastRollbackTarget | null | undefined;
  lastAliasRequest?: UpdateProjectLastAliasRequest | null | undefined;
  protectionBypass?: { [k: string]: UpdateProjectProtectionBypass } | undefined;
  hasActiveBranches?: boolean | undefined;
  trustedIps?: UpdateProjectProjectsTrustedIps | null | undefined;
  trustedSources?: UpdateProjectTrustedSources | null | undefined;
  gitComments?: UpdateProjectGitComments | undefined;
  gitProviderOptions?: UpdateProjectGitProviderOptions | undefined;
  paused?: boolean | undefined;
  concurrencyBucketName?: string | undefined;
  webAnalytics?: UpdateProjectWebAnalytics | undefined;
  security?: UpdateProjectSecurity | undefined;
  oidcTokenConfig?: UpdateProjectProjectsOidcTokenConfig | undefined;
  /**
   * Project shape. `null` on a rule list clears the project's override for that rule type (fall back to team for every env); omitting is equivalent. Setting `deploymentPolicy` itself to `null` clears every override at once. Kept structurally distinct from {@link TeamDeploymentPolicy} so the two storage locations don't share a type by accident.
   */
  deploymentPolicy?: UpdateProjectProjectsDeploymentPolicy | null | undefined;
  tier?: UpdateProjectTier | undefined;
  usageStatus?: UpdateProjectUsageStatus | undefined;
  features?: UpdateProjectFeatures | undefined;
  v0?: boolean | undefined;
  v0Created?: boolean | undefined;
  abuse?: UpdateProjectAbuse | undefined;
  internalRoutes?:
    | Array<UpdateProjectInternalRoutes1 | UpdateProjectInternalRoutes2>
    | undefined;
  hasDeployments?: boolean | undefined;
  dismissedToasts?: Array<UpdateProjectProjectsDismissedToasts> | undefined;
  protectedSourcemaps?: boolean | undefined;
  tracing?: UpdateProjectProjectsTracing | undefined;
  avatar?: string | null | undefined;
};

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectManagedRules$inboundSchema: z.ZodType<
  UpdateProjectManagedRules,
  z.ZodTypeDef,
  unknown
> = z.object({
  vercel_ruleset: UpdateProjectVercelRuleset$inboundSchema,
  traffic_sources: UpdateProjectTrafficSources$inboundSchema,
  bot_filter: z.lazy(() => UpdateProjectBotFilter$inboundSchema),
  ai_bots: z.lazy(() => UpdateProjectAiBots$inboundSchema),
  owasp: z.lazy(() => UpdateProjectOwasp$inboundSchema),
}).transform((v) => {
  return remap$(v, {
    "vercel_ruleset": "vercelRuleset",
    "traffic_sources": "trafficSources",
    "bot_filter": "botFilter",
    "ai_bots": "aiBots",
  });
});

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

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

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

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

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

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

/** @internal */
export const UpdateProjectSecurity$inboundSchema: z.ZodType<
  UpdateProjectSecurity,
  z.ZodTypeDef,
  unknown
> = z.object({
  attackModeEnabled: types.optional(types.boolean()),
  attackModeUpdatedAt: types.optional(types.number()),
  firewallEnabled: types.optional(types.boolean()),
  firewallUpdatedAt: types.optional(types.number()),
  attackModeActiveUntil: z.nullable(types.number()).optional(),
  firewallConfigVersion: types.optional(types.number()),
  rulesets: types.optional(z.record(UpdateProjectRulesets$inboundSchema)),
  firewallSeawallEnabled: types.optional(types.boolean()),
  ja3Enabled: types.optional(types.boolean()),
  ja4Enabled: types.optional(types.boolean()),
  firewallBypassIps: types.optional(z.array(types.string())),
  managedRules: z.nullable(
    z.lazy(() => UpdateProjectManagedRules$inboundSchema),
  ).optional(),
  botIdEnabled: types.optional(types.boolean()),
  log_headers: types.optional(
    smartUnion([
      z.array(types.string()),
      UpdateProjectLogHeaders2$inboundSchema,
    ]),
  ),
  securityPlus: types.optional(types.boolean()),
  securityPlusMetadata: types.optional(
    z.lazy(() => UpdateProjectSecurityPlusMetadata$inboundSchema),
  ),
  pageIntegrityEnabled: types.optional(types.boolean()),
}).transform((v) => {
  return remap$(v, {
    "log_headers": "logHeaders",
  });
});

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectSourcesProjects1$inboundSchema: z.ZodType<
  UpdateProjectSourcesProjects1,
  z.ZodTypeDef,
  unknown
> = z.object({
  provider: UpdateProjectSourcesProjectsResponse200Provider$inboundSchema,
  org: types.string(),
  repo: types.optional(types.string()),
});

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

/** @internal */
export const UpdateProjectSources$inboundSchema: z.ZodType<
  UpdateProjectSources,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => UpdateProjectSourcesProjects1$inboundSchema).and(
    z.object({ provider: z.literal("bitbucket") }),
  ),
  z.lazy(() => UpdateProjectSourcesProjects1$inboundSchema).and(
    z.object({ provider: z.literal("github") }),
  ),
  z.lazy(() => UpdateProjectSourcesProjects2$inboundSchema),
]);

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectGitSources$inboundSchema: z.ZodType<
  UpdateProjectGitSources,
  z.ZodTypeDef,
  unknown
> = z.object({
  sources: z.array(
    z.union([
      z.lazy(() => UpdateProjectSourcesProjects1$inboundSchema).and(
        z.object({ provider: z.literal("bitbucket") }),
      ),
      z.lazy(() => UpdateProjectSourcesProjects1$inboundSchema).and(
        z.object({ provider: z.literal("github") }),
      ),
      z.lazy(() => UpdateProjectSourcesProjects2$inboundSchema),
    ]),
  ),
  enabled: types.boolean(),
  environments: z.array(
    z.union([
      z.lazy(() => UpdateProjectEnvironmentsProjectsResponse1$inboundSchema),
      z.lazy(() => UpdateProjectEnvironmentsProjectsResponse2002$inboundSchema),
    ]),
  ),
});

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectDeploymentSources$inboundSchema: z.ZodType<
  UpdateProjectDeploymentSources,
  z.ZodTypeDef,
  unknown
> = z.object({
  sources: z.array(UpdateProjectProjectsSources$inboundSchema),
  enabled: types.boolean(),
  environments: z.array(
    z.union([
      z.lazy(() => UpdateProjectEnvironmentsProjectsResponse2001$inboundSchema),
      z.lazy(() => UpdateProjectEnvironmentsProjectsResponse2$inboundSchema),
    ]),
  ),
});

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

/** @internal */
export const UpdateProjectProjectsDeploymentPolicy$inboundSchema: z.ZodType<
  UpdateProjectProjectsDeploymentPolicy,
  z.ZodTypeDef,
  unknown
> = z.object({
  gitSources: z.nullable(
    z.array(z.lazy(() => UpdateProjectGitSources$inboundSchema)),
  ).optional(),
  deploymentSources: z.nullable(
    z.array(z.lazy(() => UpdateProjectDeploymentSources$inboundSchema)),
  ).optional(),
});

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

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

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

/** @internal */
export const UpdateProjectUsageStatus$inboundSchema: z.ZodType<
  UpdateProjectUsageStatus,
  z.ZodTypeDef,
  unknown
> = z.object({
  kind: UpdateProjectKind$inboundSchema,
  exceededAllowanceUntil: types.optional(types.number()),
  bypassThrottleUntil: types.optional(types.number()),
  throttled: types.optional(types.boolean()),
  teamThrottled: types.optional(types.boolean()),
});

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

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

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

/** @internal */
export const UpdateProjectHistory$inboundSchema: z.ZodType<
  UpdateProjectHistory,
  z.ZodTypeDef,
  unknown
> = z.object({
  scanner: types.string(),
  reason: types.string(),
  by: types.string(),
  byId: types.string(),
  at: types.number(),
});

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

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

/** @internal */
export const UpdateProjectBlock$inboundSchema: z.ZodType<
  UpdateProjectBlock,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: UpdateProjectProjectsResponse200Action$inboundSchema,
  reason: types.string(),
  statusCode: types.number(),
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
  ineligibleForAppeal: types.optional(types.boolean()),
  isCascading: types.optional(types.boolean()),
});

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectHasProjects1$inboundSchema: z.ZodType<
  UpdateProjectHasProjects1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("header"),
  key: UpdateProjectHasProjectsKey$inboundSchema,
  value: z.lazy(() => UpdateProjectHasProjectsResponseValue$inboundSchema),
});

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

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

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

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

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

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

/** @internal */
export const UpdateProjectRouteProjects2$inboundSchema: z.ZodType<
  UpdateProjectRouteProjects2,
  z.ZodTypeDef,
  unknown
> = z.object({
  has: z.array(
    z.union([
      z.lazy(() => UpdateProjectHasProjects1$inboundSchema),
      z.lazy(() => UpdateProjectHasProjects2$inboundSchema),
    ]),
  ),
  mitigate: z.lazy(() => UpdateProjectRouteProjectsMitigate$inboundSchema),
  src: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const UpdateProjectBlockHistory4$inboundSchema: z.ZodType<
  UpdateProjectBlockHistory4,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: types.literal("route-unblocked"),
  route: smartUnion([
    z.lazy(() => UpdateProjectRouteProjects1$inboundSchema),
    z.lazy(() => UpdateProjectRouteProjects2$inboundSchema),
  ]),
  statusCode: types.optional(types.number()),
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
  ineligibleForAppeal: types.optional(types.boolean()),
  isCascading: types.optional(types.boolean()),
});

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectHasProjectsResponse1$inboundSchema: z.ZodType<
  UpdateProjectHasProjectsResponse1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("header"),
  key: UpdateProjectHasProjectsResponseKey$inboundSchema,
  value: z.lazy(() =>
    UpdateProjectHasProjectsResponse200ApplicationJSONValue$inboundSchema
  ),
});

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

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

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

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

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

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

/** @internal */
export const UpdateProjectRoute2$inboundSchema: z.ZodType<
  UpdateProjectRoute2,
  z.ZodTypeDef,
  unknown
> = z.object({
  has: z.array(
    z.union([
      z.lazy(() => UpdateProjectHasProjectsResponse1$inboundSchema),
      z.lazy(() => UpdateProjectHasProjectsResponse2$inboundSchema),
    ]),
  ),
  mitigate: z.lazy(() => UpdateProjectRouteMitigate$inboundSchema),
  src: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const UpdateProjectBlockHistory3$inboundSchema: z.ZodType<
  UpdateProjectBlockHistory3,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: types.literal("route-blocked"),
  route: smartUnion([
    z.lazy(() => UpdateProjectRoute1$inboundSchema),
    z.lazy(() => UpdateProjectRoute2$inboundSchema),
  ]),
  reason: types.string(),
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
  ineligibleForAppeal: types.optional(types.boolean()),
  isCascading: types.optional(types.boolean()),
});

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

/** @internal */
export const UpdateProjectBlockHistory2$inboundSchema: z.ZodType<
  UpdateProjectBlockHistory2,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: types.literal("unblocked"),
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
  ineligibleForAppeal: types.optional(types.boolean()),
  isCascading: types.optional(types.boolean()),
});

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

/** @internal */
export const UpdateProjectBlockHistory1$inboundSchema: z.ZodType<
  UpdateProjectBlockHistory1,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: types.literal("blocked"),
  reason: types.string(),
  statusCode: types.number(),
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
  ineligibleForAppeal: types.optional(types.boolean()),
  isCascading: types.optional(types.boolean()),
});

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

/** @internal */
export const UpdateProjectBlockHistory$inboundSchema: z.ZodType<
  UpdateProjectBlockHistory,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => UpdateProjectBlockHistory1$inboundSchema),
  z.lazy(() => UpdateProjectBlockHistory2$inboundSchema),
  z.lazy(() => UpdateProjectBlockHistory3$inboundSchema),
  z.lazy(() => UpdateProjectBlockHistory4$inboundSchema),
]);

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

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

/** @internal */
export const UpdateProjectInterstitialHistory$inboundSchema: z.ZodType<
  UpdateProjectInterstitialHistory,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: UpdateProjectProjectsResponse200ApplicationJSONAction$inboundSchema,
  createdAt: types.number(),
  caseId: types.optional(types.string()),
  reason: types.optional(types.string()),
  actor: types.optional(types.string()),
  comment: types.optional(types.string()),
});

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

/** @internal */
export const UpdateProjectAbuse$inboundSchema: z.ZodType<
  UpdateProjectAbuse,
  z.ZodTypeDef,
  unknown
> = z.object({
  scanner: types.optional(types.string()),
  history: z.array(z.lazy(() => UpdateProjectHistory$inboundSchema)),
  updatedAt: types.number(),
  block: types.optional(z.lazy(() => UpdateProjectBlock$inboundSchema)),
  blockHistory: types.optional(
    z.array(z.union([
      z.lazy(() => UpdateProjectBlockHistory1$inboundSchema),
      z.lazy(() =>
        UpdateProjectBlockHistory2$inboundSchema
      ),
      z.lazy(() => UpdateProjectBlockHistory3$inboundSchema),
      z.lazy(() => UpdateProjectBlockHistory4$inboundSchema),
    ])),
  ),
  interstitial: types.optional(types.boolean()),
  interstitialHistory: types.optional(
    z.array(z.lazy(() => UpdateProjectInterstitialHistory$inboundSchema)),
  ),
});

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectHas1$inboundSchema: z.ZodType<
  UpdateProjectHas1,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: types.literal("header"),
  key: UpdateProjectHasKey$inboundSchema,
  value: z.lazy(() => UpdateProjectHasValue$inboundSchema),
});

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

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

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

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

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

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

/** @internal */
export const UpdateProjectInternalRoutes2$inboundSchema: z.ZodType<
  UpdateProjectInternalRoutes2,
  z.ZodTypeDef,
  unknown
> = z.object({
  has: z.array(
    z.union([
      z.lazy(() => UpdateProjectHas1$inboundSchema),
      z.lazy(() => UpdateProjectHas2$inboundSchema),
    ]),
  ),
  mitigate: z.lazy(() => UpdateProjectInternalRoutesMitigate$inboundSchema),
  src: types.optional(types.string()),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const UpdateProjectProjectsDismissedToasts$inboundSchema: z.ZodType<
  UpdateProjectProjectsDismissedToasts,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: types.string(),
  dismissedAt: types.number(),
  action: UpdateProjectProjectsAction$inboundSchema,
  value: types.nullable(
    smartUnion([
      z.lazy(() => UpdateProjectValue3$inboundSchema),
      types.string(),
      types.number(),
      types.boolean(),
    ]),
  ),
});

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

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

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

/** @internal */
export const UpdateProjectSamplingRules$inboundSchema: z.ZodType<
  UpdateProjectSamplingRules,
  z.ZodTypeDef,
  unknown
> = z.object({
  rate: types.number(),
  env: types.optional(UpdateProjectProjectsResponseEnv$inboundSchema),
  requestPath: types.optional(types.string()),
  destination: types.optional(UpdateProjectDestination$inboundSchema),
});

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

/** @internal */
export const UpdateProjectProjectsTracing$inboundSchema: z.ZodType<
  UpdateProjectProjectsTracing,
  z.ZodTypeDef,
  unknown
> = z.object({
  domains: types.optional(types.string()),
  ignorePaths: types.optional(z.array(types.string())),
  samplingRules: types.optional(
    z.array(z.lazy(() => UpdateProjectSamplingRules$inboundSchema)),
  ),
});

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

/** @internal */
export const UpdateProjectResponseBody$inboundSchema: z.ZodType<
  UpdateProjectResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  accountId: types.string(),
  creator: types.optional(UpdateProjectCreator$inboundSchema),
  alias: z.array(UpdateProjectAlias$inboundSchema),
  analytics: types.optional(UpdateProjectAnalytics$inboundSchema),
  appliedCve55182Migration: types.optional(types.boolean()),
  speedInsights: types.optional(UpdateProjectSpeedInsights$inboundSchema),
  autoExposeSystemEnvs: types.optional(types.boolean()),
  autoAssignCustomDomains: types.optional(types.boolean()),
  autoAssignCustomDomainsUpdatedBy: types.optional(types.string()),
  buildCommand: z.nullable(types.string()).optional(),
  commandForIgnoringBuildStep: z.nullable(types.string()).optional(),
  connectConfigurations: z.nullable(
    z.array(UpdateProjectConnectConfigurations$inboundSchema),
  ).optional(),
  connectConfigurationId: z.nullable(types.string()).optional(),
  connectBuildsEnabled: types.optional(types.boolean()),
  passiveConnectConfigurationId: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  customerSupportCodeVisibility: types.optional(types.boolean()),
  crons: types.optional(UpdateProjectCrons$inboundSchema),
  dataCache: types.optional(UpdateProjectDataCache$inboundSchema),
  deploymentExpiration: UpdateProjectDeploymentExpiration$inboundSchema,
  expiration: types.optional(UpdateProjectExpiration$inboundSchema),
  devCommand: z.nullable(types.string()).optional(),
  directoryListing: types.boolean(),
  installCommand: z.nullable(types.string()).optional(),
  env: types.optional(z.array(UpdateProjectProjectsEnv$inboundSchema)),
  customEnvironments: types.optional(
    z.array(UpdateProjectCustomEnvironments$inboundSchema),
  ),
  framework: z.nullable(UpdateProjectProjectsFramework$inboundSchema)
    .optional(),
  services: types.optional(z.array(UpdateProjectServices$inboundSchema)),
  gitForkProtection: types.optional(types.boolean()),
  gitLFS: types.optional(types.boolean()),
  id: types.string(),
  ipBuckets: types.optional(z.array(UpdateProjectIpBuckets$inboundSchema)),
  jobs: types.optional(UpdateProjectJobs$inboundSchema),
  latestDeployments: types.optional(
    z.array(UpdateProjectLatestDeployments$inboundSchema),
  ),
  link: types.optional(UpdateProjectLink$inboundSchema),
  blobs: types.optional(UpdateProjectBlobs$inboundSchema),
  microfrontends: types.optional(UpdateProjectMicrofrontends$inboundSchema),
  name: types.string(),
  nodeVersion: UpdateProjectProjectsNodeVersion$inboundSchema,
  optionsAllowlist: z.nullable(
    UpdateProjectProjectsOptionsAllowlist$inboundSchema,
  ).optional(),
  outputDirectory: z.nullable(types.string()).optional(),
  passwordProtection: z.nullable(
    UpdateProjectProjectsPasswordProtection$inboundSchema,
  ).optional(),
  passport: z.nullable(UpdateProjectProjectsPassport$inboundSchema).optional(),
  protectionConfig: types.optional(UpdateProjectProtectionConfig$inboundSchema),
  sandbox: types.optional(UpdateProjectProjectsSandbox$inboundSchema),
  productionDeploymentsFastLane: types.optional(types.boolean()),
  resourceConfig: UpdateProjectProjectsResourceConfig$inboundSchema,
  rollbackDescription: types.optional(
    UpdateProjectRollbackDescription$inboundSchema,
  ),
  rollingRelease: z.nullable(UpdateProjectRollingRelease$inboundSchema)
    .optional(),
  defaultResourceConfig: UpdateProjectDefaultResourceConfig$inboundSchema,
  rootDirectory: z.nullable(types.string()).optional(),
  serverlessFunctionZeroConfigFailover: types.optional(types.boolean()),
  skewProtectionBoundaryAt: types.optional(types.number()),
  skewProtectionMaxAge: types.optional(types.number()),
  skewProtectionAllowedDomains: types.optional(z.array(types.string())),
  skipGitConnectDuringLink: types.optional(types.boolean()),
  staticIps: types.optional(UpdateProjectProjectsStaticIps$inboundSchema),
  sourceFilesOutsideRootDirectory: types.optional(types.boolean()),
  enableAffectedProjectsDeployments: types.optional(types.boolean()),
  enableExternalRewriteCaching: types.optional(types.boolean()),
  ssoProtection: z.nullable(UpdateProjectProjectsSsoProtection$inboundSchema)
    .optional(),
  targets: types.optional(
    z.record(types.nullable(UpdateProjectTargets$inboundSchema)),
  ),
  transferCompletedAt: types.optional(types.number()),
  transferStartedAt: types.optional(types.number()),
  transferToAccountId: types.optional(types.string()),
  transferredFromAccountId: types.optional(types.string()),
  updatedAt: types.optional(types.number()),
  live: types.optional(types.boolean()),
  enablePreviewFeedback: z.nullable(types.boolean()).optional(),
  enableProductionFeedback: z.nullable(types.boolean()).optional(),
  permissions: types.optional(UpdateProjectPermissions$inboundSchema),
  lastRollbackTarget: z.nullable(UpdateProjectLastRollbackTarget$inboundSchema)
    .optional(),
  lastAliasRequest: z.nullable(UpdateProjectLastAliasRequest$inboundSchema)
    .optional(),
  protectionBypass: types.optional(
    z.record(UpdateProjectProtectionBypass$inboundSchema),
  ),
  hasActiveBranches: types.optional(types.boolean()),
  trustedIps: z.nullable(UpdateProjectProjectsTrustedIps$inboundSchema)
    .optional(),
  trustedSources: z.nullable(UpdateProjectTrustedSources$inboundSchema)
    .optional(),
  gitComments: types.optional(UpdateProjectGitComments$inboundSchema),
  gitProviderOptions: types.optional(
    UpdateProjectGitProviderOptions$inboundSchema,
  ),
  paused: types.optional(types.boolean()),
  concurrencyBucketName: types.optional(types.string()),
  webAnalytics: types.optional(UpdateProjectWebAnalytics$inboundSchema),
  security: types.optional(z.lazy(() => UpdateProjectSecurity$inboundSchema)),
  oidcTokenConfig: types.optional(
    z.lazy(() => UpdateProjectProjectsOidcTokenConfig$inboundSchema),
  ),
  deploymentPolicy: z.nullable(
    z.lazy(() => UpdateProjectProjectsDeploymentPolicy$inboundSchema),
  ).optional(),
  tier: types.optional(UpdateProjectTier$inboundSchema),
  usageStatus: types.optional(
    z.lazy(() => UpdateProjectUsageStatus$inboundSchema),
  ),
  features: types.optional(z.lazy(() => UpdateProjectFeatures$inboundSchema)),
  v0: types.optional(types.boolean()),
  v0Created: types.optional(types.boolean()),
  abuse: types.optional(z.lazy(() => UpdateProjectAbuse$inboundSchema)),
  internalRoutes: types.optional(
    z.array(smartUnion([
      z.lazy(() => UpdateProjectInternalRoutes1$inboundSchema),
      z.lazy(() =>
        UpdateProjectInternalRoutes2$inboundSchema
      ),
    ])),
  ),
  hasDeployments: types.optional(types.boolean()),
  dismissedToasts: types.optional(
    z.array(z.lazy(() => UpdateProjectProjectsDismissedToasts$inboundSchema)),
  ),
  protectedSourcemaps: types.optional(types.boolean()),
  tracing: types.optional(
    z.lazy(() => UpdateProjectProjectsTracing$inboundSchema),
  ),
  avatar: z.nullable(types.string()).optional(),
});

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