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,024 lines 108 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 budget type
 */
export const UserEventPayload341Type = {
  Fixed: "fixed",
} as const;
/**
 * The budget type
 */
export type UserEventPayload341Type = ClosedEnum<
  typeof UserEventPayload341Type
>;

/**
 * The acive pricing plan the team is billed with
 */
export const UserEventPayload341PricingPlan = {
  Flex: "flex",
  Legacy: "legacy",
  Platform: "platform",
  Plus: "plus",
  Unbundled: "unbundled",
} as const;
/**
 * The acive pricing plan the team is billed with
 */
export type UserEventPayload341PricingPlan = ClosedEnum<
  typeof UserEventPayload341PricingPlan
>;

/**
 * Which budget this is. Matches Copper SDK `BudgetScope`. Omitted on events published before team/org/project scopes existed (treat as team).
 */
export const UserEventPayload341Scope = {
  Organization: "organization",
  Project: "project",
  Team: "team",
} as const;
/**
 * Which budget this is. Matches Copper SDK `BudgetScope`. Omitted on events published before team/org/project scopes existed (treat as team).
 */
export type UserEventPayload341Scope = ClosedEnum<
  typeof UserEventPayload341Scope
>;

/**
 * Represents a budget for tracking and notifying teams on their spending.
 */
export type BudgetItem = {
  /**
   * The budget type
   */
  type: UserEventPayload341Type;
  /**
   * Budget amount (USD / dollars)
   */
  fixedBudget: number;
  /**
   * Array of the last 3 months of spend data
   */
  previousSpend: Array<number>;
  /**
   * Array of 50, 75, 100 to keep track of notifications sent out
   */
  notifiedAt: Array<number>;
  /**
   * Webhook id that corresponds to a webhook in Cosmos webhook collection
   */
  webhookId?: string | undefined;
  /**
   * Keep track if the webhook has been called for the month
   */
  webhookNotified?: boolean | undefined;
  /**
   * Date time when budget is created
   */
  createdAt: number;
  /**
   * Date time when budget is updated last
   */
  updatedAt?: number | undefined;
  /**
   * Is the budget currently active for a customer
   */
  isActive: boolean;
  /**
   * Should all projects be paused if budget is exceeded
   */
  pauseProjects?: boolean | undefined;
  /**
   * The acive pricing plan the team is billed with
   */
  pricingPlan?: UserEventPayload341PricingPlan | undefined;
  /**
   * Which budget this is. Matches Copper SDK `BudgetScope`. Omitted on events published before team/org/project scopes existed (treat as team).
   */
  scope?: UserEventPayload341Scope | undefined;
  /**
   * Project id when `scope` is `project`.
   */
  scopeId?: string | undefined;
  /**
   * Partition key
   */
  teamId: string;
  /**
   * Sort key that needs to be unique per teamId
   */
  id: string;
};

export type UserEventPayload341Budget = {
  /**
   * Represents a budget for tracking and notifying teams on their spending.
   */
  budgetItem: BudgetItem;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndFortyOne = {
  budget: UserEventPayload341Budget;
};

export type UserEventPayload340Previous = {
  sampleRatePercent: number | null;
  spendLimitInDollars: number | null;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndForty = {
  projectId?: string | undefined;
  projectName?: string | undefined;
  analyticsId?: string | undefined;
  sampleRatePercent: number | null;
  spendLimitInDollars: number | null;
  previous: UserEventPayload340Previous;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyNine = {
  email: string;
  gitlabLogin: string;
  gitlabEmail: string;
  gitlabName: string;
  zeitAccount: string;
  zeitAccountType: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyEight = {
  email: string;
  githubLogin: string;
  zeitAccount: string;
  zeitAccountType: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtySeven = {
  email: string;
  bitbucketLogin: string;
  bitbucketEmail: string;
  bitbucketName: string;
  zeitAccount: string;
  zeitAccountType: string;
};

export type UserEventPayload336Names = {
  en: string;
};

export type PayloadCity = {
  names: UserEventPayload336Names;
};

export type UserEventPayload336GeolocationNames = {
  en: string;
};

export type PayloadCountry = {
  names: UserEventPayload336GeolocationNames;
};

export type UserEventPayload336GeolocationMostSpecificSubdivisionNames = {
  en: string;
};

export type PayloadMostSpecificSubdivision = {
  names: UserEventPayload336GeolocationMostSpecificSubdivisionNames;
};

export type PayloadGeolocation = {
  city?: PayloadCity | undefined;
  country: PayloadCountry;
  mostSpecificSubdivision?: PayloadMostSpecificSubdivision | undefined;
  regionName?: string | undefined;
};

export const FactorsOrigin = {
  Apple: "apple",
  Bitbucket: "bitbucket",
  Chatgpt: "chatgpt",
  Email: "email",
  Github: "github",
  Gitlab: "gitlab",
  Google: "google",
  Otp: "otp",
  Saml: "saml",
} as const;
export type FactorsOrigin = ClosedEnum<typeof FactorsOrigin>;

export type UserEventFactors1 = {
  origin: FactorsOrigin;
  username?: string | undefined;
  teamId?: string | undefined;
  legacy?: boolean | undefined;
  ssoType?: string | undefined;
};

export type PayloadFactors = UserEventFactors1;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtySix = {
  userAgent?: string | undefined;
  geolocation?: PayloadGeolocation | null | undefined;
  env?: string | undefined;
  os?: string | undefined;
  username?: string | undefined;
  ssoType?: string | undefined;
  factors?: Array<UserEventFactors1> | undefined;
  viaOTP?: boolean | undefined;
  viaGithub?: boolean | undefined;
  viaGitlab?: boolean | undefined;
  viaBitbucket?: boolean | undefined;
  viaGoogle?: boolean | undefined;
  viaApple?: boolean | undefined;
  viaSamlSso?: boolean | undefined;
  viaPasskey?: boolean | undefined;
};

export type ScalingRules = {
  min: number;
  max: number;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyFive = {
  scalingRules: { [k: string]: ScalingRules };
  min: number;
  max: number;
  url: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyFour = {
  bio: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyThree = {
  enabled: boolean;
  updatedAt: number;
  firstEnabledAt?: number | undefined;
  projectId?: string | undefined;
  projectName?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyTwo = {
  oldName: string;
  newName: string;
  uid?: string | undefined;
};

export type Name2 = {
  name: string;
};

export type PayloadName = Name2 | string;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirtyOne = {
  uid: string;
  name: Name2 | string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirty = {
  email: string;
};

export const UserEventPayloadActorType = {
  Admin: "admin",
} as const;
export type UserEventPayloadActorType = ClosedEnum<
  typeof UserEventPayloadActorType
>;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyNine = {
  email: string;
  verified: boolean;
  /**
   * Okta user id.
   */
  actorId: string;
  actorType: UserEventPayloadActorType;
  actorName?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyEight = {
  email: string;
  verified: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentySeven = {
  instances: number;
  url: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentySix = {
  projectId: string;
  projectName: string;
  snapshotId: string;
  targetRegions: Array<string>;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyFive = {
  driveName: string;
  projectId: string;
  projectName: string;
  region: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyFour = {
  alias: string;
  sandboxName: string;
  sandboxId?: string | undefined;
  projectId?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyThree = {
  connectionId: string;
  connectionType: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyTwo = {
  gitProvider: string;
  gitProviderGroupDescriptor: string;
  gitScope: string;
};

export type ProjectWebAnalytics = {
  id: string;
  disabledAt?: number | undefined;
  canceledAt?: number | undefined;
  enabledAt?: number | undefined;
  hasData?: true | undefined;
};

export type PrevProjectWebAnalytics = {
  id: string;
  disabledAt?: number | undefined;
  canceledAt?: number | undefined;
  enabledAt?: number | undefined;
  hasData?: true | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwentyOne = {
  projectId: string;
  projectName: string;
  projectWebAnalytics?: ProjectWebAnalytics | undefined;
  prevProjectWebAnalytics?: PrevProjectWebAnalytics | null | undefined;
};

export const PayloadReasonCode = {
  Backoffice: "BACKOFFICE",
  PublicApi: "PUBLIC_API",
} as const;
export type PayloadReasonCode = ClosedEnum<typeof PayloadReasonCode>;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwenty = {
  projectId: string;
  /**
   * Display name for Activity links. Optional for events stored before it was published.
   */
  projectName?: string | undefined;
  reasonCode?: PayloadReasonCode | undefined;
};

export type AddedProjects = {
  id: string;
  name: string;
};

export type RemovedProjects = {
  id: string;
  name: string;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndNineteen = {
  projectId: string;
  projectName: string;
  enableVercelCiSameRepository?: boolean | undefined;
  addedProjects: Array<AddedProjects>;
  removedProjects: Array<RemovedProjects>;
  addedProviders: Array<string>;
  removedProviders: Array<string>;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndEighteen = {
  projectId: string;
  projectName: string;
  trustedIps?: TrustedIps | null | undefined;
  oldTrustedIps?: OldTrustedIps | null | undefined;
  addedAddresses?: Array<string> | null | undefined;
  removedAddresses?: Array<string> | null | undefined;
};

export type StaticIps = {
  builds?: boolean | undefined;
  buildRegion?: string | undefined;
  enabled: boolean;
  regions?: Array<string> | undefined;
};

export type UserEventPayload317Project = {
  id?: string | undefined;
  staticIps: StaticIps;
};

export type UserEventPayload317Next = {
  project: UserEventPayload317Project;
};

export type PayloadStaticIps = {
  builds?: boolean | undefined;
  buildRegion?: string | undefined;
  enabled: boolean;
  regions?: Array<string> | undefined;
};

export type UserEventPayload317PreviousProject = {
  id?: string | undefined;
  staticIps: PayloadStaticIps;
};

export type UserEventPayload317Previous = {
  project: UserEventPayload317PreviousProject;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndSeventeen = {
  projectId: string;
  projectName: string;
  next: UserEventPayload317Next;
  previous: UserEventPayload317Previous;
};

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

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

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

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

export type SsoProtection1 = {
  deploymentType: SsoProtectionDeploymentType;
  cve55182MigrationAppliedFrom?:
    | Cve55182MigrationAppliedFrom
    | null
    | undefined;
  april2026SecurityIncidentMigrationAppliedFrom?:
    | April2026SecurityIncidentMigrationAppliedFrom
    | null
    | undefined;
};

export type PayloadSsoProtection = SsoProtection1 | SsoProtection2;

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

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

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

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

export type OldSsoProtection1 = {
  deploymentType: OldSsoProtectionDeploymentType;
  cve55182MigrationAppliedFrom?:
    | OldSsoProtectionCve55182MigrationAppliedFrom
    | null
    | undefined;
  april2026SecurityIncidentMigrationAppliedFrom?:
    | OldSsoProtectionApril2026SecurityIncidentMigrationAppliedFrom
    | null
    | undefined;
};

export type OldSsoProtection = OldSsoProtection1 | OldSsoProtection2;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndSixteen = {
  projectId?: string | undefined;
  projectName?: string | undefined;
  ssoProtection: SsoProtection1 | SsoProtection2 | null;
  oldSsoProtection: OldSsoProtection1 | OldSsoProtection2 | null;
};

export type UserEventPayload315Next = {
  skewProtectionAllowedDomains: Array<string>;
};

export type UserEventPayload315Previous = {
  skewProtectionAllowedDomains?: Array<string> | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndFifteen = {
  projectId: string;
  projectName: string;
  next: UserEventPayload315Next;
  previous: UserEventPayload315Previous;
};

export type UserEventPayload314Next = {
  skewProtectionMaxAge: number;
};

export type UserEventPayload314Previous = {
  skewProtectionMaxAge?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndFourteen = {
  projectId: string;
  projectName: string;
  next: UserEventPayload314Next;
  previous: UserEventPayload314Previous;
};

export type UserEventPayload313Next = {
  skewProtectionBoundaryAt: number;
};

export type UserEventPayload313Previous = {
  skewProtectionBoundaryAt?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThirteen = {
  projectId: string;
  projectName: string;
  next: UserEventPayload313Next;
  previous: UserEventPayload313Previous;
};

export type UserEventPayload312Previous = {
  expiration?: string | undefined;
  expirationProduction?: string | undefined;
  expirationCanceled?: string | undefined;
  expirationErrored?: string | undefined;
};

export type UserEventPayload312Next = {
  expiration?: string | undefined;
  expirationProduction?: string | undefined;
  expirationCanceled?: string | undefined;
  expirationErrored?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwelve = {
  projectId?: string | undefined;
  projectName?: string | undefined;
  previous: UserEventPayload312Previous;
  next: UserEventPayload312Next;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndEleven = {
  projectId: string;
  projectName: string;
  publicSource: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTen = {
  projectId: string;
  projectName: string;
  inheritDeploymentProtection: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndNine = {
  projectId: string;
  projectName: string;
  protectedSourcemaps: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndEight = {
  projectId: string;
  projectName: string;
  gitForkProtection: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndSeven = {
  projectId: string;
  projectName: string;
  customerSupportCodeVisibility: boolean;
};

export const IssuerMode = {
  Global: "global",
  Team: "team",
} as const;
export type IssuerMode = ClosedEnum<typeof IssuerMode>;

export type UserEventPayload306Previous = {
  issuerMode?: IssuerMode | undefined;
};

export const PayloadIssuerMode = {
  Global: "global",
  Team: "team",
} as const;
export type PayloadIssuerMode = ClosedEnum<typeof PayloadIssuerMode>;

export type UserEventPayload306Next = {
  issuerMode: PayloadIssuerMode;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndSix = {
  projectId: string;
  projectName: string;
  previous: UserEventPayload306Previous;
  next: UserEventPayload306Next;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndFive = {
  projectId: string;
  projectName: string;
  region?: string | undefined;
  failoverRegions?: Array<string> | undefined;
};

export type UserEventPayload304Previous = {
  gitSources?: Array<any> | null | undefined;
  deploymentSources?: Array<any> | null | undefined;
};

export type UserEventPayload304Next = {
  gitSources?: Array<any> | null | undefined;
  deploymentSources?: Array<any> | null | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndFour = {
  projectId: string;
  projectName: string;
  previous: UserEventPayload304Previous | null;
  next: UserEventPayload304Next | null;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndThree = {
  projectId: string;
  projectName: string;
  targetDeploymentId?: string | undefined;
  action?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwo = {
  projectId: string;
  projectName: string;
  targetDeploymentId?: string | undefined;
  newTargetPercentage?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndOne = {
  projectId: string;
  projectName: string;
  targetDeploymentId?: string | undefined;
};

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

/**
 * The payload of the event, if requested.
 */
export type ThreeHundred = {
  projectId: string;
  projectName: string;
  projectAccountId: string;
  deploymentId: string;
  /**
   * Description of why a project was rolled back, and by whom. Note that lastAliasRequest contains the from/to details of the rollback.
   */
  rollbackDescription?: RollbackDescription | undefined;
};

export const Consent = {
  Granted: "granted",
  Refused: "refused",
} as const;
export type Consent = ClosedEnum<typeof Consent>;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyNine = {
  projectId?: string | undefined;
  projectName: string;
  consent: Consent;
};

export const ReasonCode = {
  Backoffice: "BACKOFFICE",
  BudgetReached: "BUDGET_REACHED",
  PublicApi: "PUBLIC_API",
} as const;
export type ReasonCode = ClosedEnum<typeof ReasonCode>;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyEight = {
  projectId: string;
  /**
   * Display name for Activity links. Optional for events stored before it was published.
   */
  projectName?: string | undefined;
  reasonCode?: ReasonCode | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetySeven = {
  projectId: string;
  expiresAt: number;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetySix = {
  projectId: string;
};

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

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

export type PasswordProtection1 = {
  deploymentType: PasswordProtectionDeploymentType;
};

export type PayloadPasswordProtection =
  | PasswordProtection1
  | PasswordProtection2;

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

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

export type OldPasswordProtection1 = {
  deploymentType: OldPasswordProtectionDeploymentType;
};

export type OldPasswordProtection =
  | OldPasswordProtection1
  | OldPasswordProtection2;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyFive = {
  projectId?: string | undefined;
  projectName?: string | undefined;
  passwordProtection: PasswordProtection1 | PasswordProtection2 | null;
  oldPasswordProtection: OldPasswordProtection1 | OldPasswordProtection2 | null;
};

export type Paths = {
  value: string;
};

export type OptionsAllowlist = {
  paths: Array<Paths>;
};

export type PayloadPaths = {
  value: string;
};

export type OldOptionsAllowlist = {
  paths: Array<PayloadPaths>;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyFour = {
  projectId: string;
  projectName: string;
  optionsAllowlist?: OptionsAllowlist | null | undefined;
  oldOptionsAllowlist?: OldOptionsAllowlist | null | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyThree = {
  source: string;
  projectId: string;
  projectName: string;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyTwo = {
  previousProjectId?: string | undefined;
  newProjectId?: string | undefined;
  previousProjectName: string;
  newProjectName: string;
  destinationAccountName: string;
  transferId?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyOne = {
  projectId: string;
  projectName: string;
  originAccountName: string;
  destinationAccountName: string;
  destinationAccountId: string;
  transferId?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinety = {
  previousProjectId?: string | undefined;
  projectName: string;
  destinationAccountName: string | null;
  transferId?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyNine = {
  previousProjectId?: string | undefined;
  newProjectId?: string | undefined;
  previousProjectName: string;
  newProjectName: string;
  originAccountName: string;
  transferId?: string | undefined;
};

export type UserEventPayload288Project = {
  id: string;
  name: string;
};

export const UserEventPayload288Role = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type UserEventPayload288Role = ClosedEnum<
  typeof UserEventPayload288Role
>;

export const PayloadPreviousRole = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type PayloadPreviousRole = ClosedEnum<typeof PayloadPreviousRole>;

export type PayloadProjectMembership = {
  role?: UserEventPayload288Role | undefined;
  uid?: string | undefined;
  createdAt?: number | undefined;
  username?: string | undefined;
  previousRole?: PayloadPreviousRole | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyEight = {
  project: UserEventPayload288Project;
  projectMembership: PayloadProjectMembership;
};

export type UserEventPayload287Project = {
  name: string;
  id?: string | undefined;
};

export const UserEventPayload287Role = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type UserEventPayload287Role = ClosedEnum<
  typeof UserEventPayload287Role
>;

export type RemovedMembership = {
  role: UserEventPayload287Role;
  uid: string;
  createdAt: number;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightySeven = {
  project: UserEventPayload287Project;
  removedMembership: RemovedMembership;
};

export const UserEventPayload286Role = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type UserEventPayload286Role = ClosedEnum<
  typeof UserEventPayload286Role
>;

export type UserEventPayload286Project = {
  name: string;
  role: UserEventPayload286Role;
  invitedUserName: string;
  id?: string | undefined;
  invitedUserId?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightySix = {
  project: UserEventPayload286Project;
};

export type UserEventPayload285Project = {
  name: string;
  id?: string | undefined;
};

export const UserEventPayload285Role = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type UserEventPayload285Role = ClosedEnum<
  typeof UserEventPayload285Role
>;

export type ProjectMembership = {
  role: UserEventPayload285Role;
  uid: string;
  createdAt: number;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyFive = {
  project: UserEventPayload285Project;
  projectMembership: ProjectMembership | null;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyFour = {
  projectId: string;
  projectName: string;
  target: string;
  domain: string;
  configuredBy?: string | null | undefined;
  prevConfiguredBy?: string | null | undefined;
};

export const UserEventPayloadRole = {
  Admin: "ADMIN",
  ProjectDeveloper: "PROJECT_DEVELOPER",
  ProjectGuest: "PROJECT_GUEST",
  ProjectViewer: "PROJECT_VIEWER",
} as const;
export type UserEventPayloadRole = ClosedEnum<typeof UserEventPayloadRole>;

export type PayloadProjects = {
  projectId: string;
  role: UserEventPayloadRole;
  membershipCreatedAt: number;
};

export type TeamMembership = {
  uid: string;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyThree = {
  projects: Array<PayloadProjects>;
  teamMembership?: TeamMembership | undefined;
  directoryType?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyTwo = {
  projectId: string;
  projectName: string;
  domain: string;
  redirect?: string | null | undefined;
  redirectStatusCode?: number | null | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyOne = {
  oldProjectId: string;
  oldProjectName: string;
  newProjectId: string;
  newProjectName: string;
  domain: string;
};

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

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

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

/** @internal */
export const BudgetItem$inboundSchema: z.ZodType<
  BudgetItem,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload341Type$inboundSchema,
  fixedBudget: types.number(),
  previousSpend: z.array(types.number()),
  notifiedAt: z.array(types.number()),
  webhookId: types.optional(types.string()),
  webhookNotified: types.optional(types.boolean()),
  createdAt: types.number(),
  updatedAt: types.optional(types.number()),
  isActive: types.boolean(),
  pauseProjects: types.optional(types.boolean()),
  pricingPlan: types.optional(UserEventPayload341PricingPlan$inboundSchema),
  scope: types.optional(UserEventPayload341Scope$inboundSchema),
  scopeId: types.optional(types.string()),
  teamId: types.string(),
  id: types.string(),
});

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

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

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

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

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

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

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

/** @internal */
export const ThreeHundredAndForty$inboundSchema: z.ZodType<
  ThreeHundredAndForty,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  analyticsId: types.optional(types.string()),
  sampleRatePercent: types.nullable(types.number()),
  spendLimitInDollars: types.nullable(types.number()),
  previous: z.lazy(() => UserEventPayload340Previous$inboundSchema),
});

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

/** @internal */
export const ThreeHundredAndThirtyNine$inboundSchema: z.ZodType<
  ThreeHundredAndThirtyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  gitlabLogin: types.string(),
  gitlabEmail: types.string(),
  gitlabName: types.string(),
  zeitAccount: types.string(),
  zeitAccountType: types.string(),
});

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

/** @internal */
export const ThreeHundredAndThirtyEight$inboundSchema: z.ZodType<
  ThreeHundredAndThirtyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  githubLogin: types.string(),
  zeitAccount: types.string(),
  zeitAccountType: types.string(),
});

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

/** @internal */
export const ThreeHundredAndThirtySeven$inboundSchema: z.ZodType<
  ThreeHundredAndThirtySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  bitbucketLogin: types.string(),
  bitbucketEmail: types.string(),
  bitbucketName: types.string(),
  zeitAccount: types.string(),
  zeitAccountType: types.string(),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const PayloadGeolocation$inboundSchema: z.ZodType<
  PayloadGeolocation,
  z.ZodTypeDef,
  unknown
> = z.object({
  city: types.optional(z.lazy(() => PayloadCity$inboundSchema)),
  country: z.lazy(() => PayloadCountry$inboundSchema),
  most_specific_subdivision: types.optional(
    z.lazy(() => PayloadMostSpecificSubdivision$inboundSchema),
  ),
  regionName: types.optional(types.string()),
}).transform((v) => {
  return remap$(v, {
    "most_specific_subdivision": "mostSpecificSubdivision",
  });
});

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

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

/** @internal */
export const UserEventFactors1$inboundSchema: z.ZodType<
  UserEventFactors1,
  z.ZodTypeDef,
  unknown
> = z.object({
  origin: FactorsOrigin$inboundSchema,
  username: types.optional(types.string()),
  teamId: types.optional(types.string()),
  legacy: types.optional(types.boolean()),
  ssoType: types.optional(types.string()),
});

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

/** @internal */
export const PayloadFactors$inboundSchema: z.ZodType<
  PayloadFactors,
  z.ZodTypeDef,
  unknown
> = z.lazy(() => UserEventFactors1$inboundSchema);

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

/** @internal */
export const ThreeHundredAndThirtySix$inboundSchema: z.ZodType<
  ThreeHundredAndThirtySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  userAgent: types.optional(types.string()),
  geolocation: z.nullable(z.lazy(() => PayloadGeolocation$inboundSchema))
    .optional(),
  env: types.optional(types.string()),
  os: types.optional(types.string()),
  username: types.optional(types.string()),
  ssoType: types.optional(types.string()),
  factors: types.optional(
    z.array(z.lazy(() => UserEventFactors1$inboundSchema)),
  ),
  viaOTP: types.optional(types.boolean()),
  viaGithub: types.optional(types.boolean()),
  viaGitlab: types.optional(types.boolean()),
  viaBitbucket: types.optional(types.boolean()),
  viaGoogle: types.optional(types.boolean()),
  viaApple: types.optional(types.boolean()),
  viaSamlSso: types.optional(types.boolean()),
  viaPasskey: types.optional(types.boolean()),
});

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

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

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

/** @internal */
export const ThreeHundredAndThirtyFive$inboundSchema: z.ZodType<
  ThreeHundredAndThirtyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  scalingRules: z.record(z.lazy(() => ScalingRules$inboundSchema)),
  min: types.number(),
  max: types.number(),
  url: types.string(),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndThirtyTwo$inboundSchema: z.ZodType<
  ThreeHundredAndThirtyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  oldName: types.string(),
  newName: types.string(),
  uid: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndThirtyOne$inboundSchema: z.ZodType<
  ThreeHundredAndThirtyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  uid: types.string(),
  name: smartUnion([z.lazy(() => Name2$inboundSchema), types.string()]),
});

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

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

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

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

/** @internal */
export const ThreeHundredAndTwentyNine$inboundSchema: z.ZodType<
  ThreeHundredAndTwentyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  email: types.string(),
  verified: types.boolean(),
  actorId: types.string(),
  actorType: UserEventPayloadActorType$inboundSchema,
  actorName: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndTwentySix$inboundSchema: z.ZodType<
  ThreeHundredAndTwentySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  snapshotId: types.string(),
  targetRegions: z.array(types.string()),
});

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

/** @internal */
export const ThreeHundredAndTwentyFive$inboundSchema: z.ZodType<
  ThreeHundredAndTwentyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  driveName: types.string(),
  projectId: types.string(),
  projectName: types.string(),
  region: types.string(),
});

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

/** @internal */
export const ThreeHundredAndTwentyFour$inboundSchema: z.ZodType<
  ThreeHundredAndTwentyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  alias: types.string(),
  sandboxName: types.string(),
  sandboxId: types.optional(types.string()),
  projectId: types.optional(types.string()),
});

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

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

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

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

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

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

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

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

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

/** @internal */
export const ThreeHundredAndTwentyOne$inboundSchema: z.ZodType<
  ThreeHundredAndTwentyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  projectWebAnalytics: types.optional(
    z.lazy(() => ProjectWebAnalytics$inboundSchema),
  ),
  prevProjectWebAnalytics: z.nullable(
    z.lazy(() => PrevProjectWebAnalytics$inboundSchema),
  ).optional(),
});

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

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

/** @internal */
export const ThreeHundredAndTwenty$inboundSchema: z.ZodType<
  ThreeHundredAndTwenty,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.optional(types.string()),
  reasonCode: types.optional(PayloadReasonCode$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndNineteen$inboundSchema: z.ZodType<
  ThreeHundredAndNineteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  enableVercelCiSameRepository: types.optional(types.boolean()),
  addedProjects: z.array(z.lazy(() => AddedProjects$inboundSchema)),
  removedProjects: z.array(z.lazy(() => RemovedProjects$inboundSchema)),
  addedProviders: z.array(types.string()),
  removedProviders: z.array(types.string()),
});

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

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

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

/** @internal */
export const ThreeHundredAndEighteen$inboundSchema: z.ZodType<
  ThreeHundredAndEighteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  trustedIps: z.nullable(TrustedIps$inboundSchema).optional(),
  oldTrustedIps: z.nullable(OldTrustedIps$inboundSchema).optional(),
  addedAddresses: z.nullable(z.array(types.string())).optional(),
  removedAddresses: z.nullable(z.array(types.string())).optional(),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const ThreeHundredAndSeventeen$inboundSchema: z.ZodType<
  ThreeHundredAndSeventeen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  next: z.lazy(() => UserEventPayload317Next$inboundSchema),
  previous: z.lazy(() => UserEventPayload317Previous$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const SsoProtection1$inboundSchema: z.ZodType<
  SsoProtection1,
  z.ZodTypeDef,
  unknown
> = z.object({
  deploymentType: SsoProtectionDeploymentType$inboundSchema,
  cve55182MigrationAppliedFrom: z.nullable(
    Cve55182MigrationAppliedFrom$inboundSchema,
  ).optional(),
  april2026SecurityIncidentMigrationAppliedFrom: z.nullable(
    April2026SecurityIncidentMigrationAppliedFrom$inboundSchema,
  ).optional(),
});

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

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

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

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

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

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

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

/** @internal */
export const OldSsoProtection1$inboundSchema: z.ZodType<
  OldSsoProtection1,
  z.ZodTypeDef,
  unknown
> = z.object({
  deploymentType: OldSsoProtectionDeploymentType$inboundSchema,
  cve55182MigrationAppliedFrom: z.nullable(
    OldSsoProtectionCve55182MigrationAppliedFrom$inboundSchema,
  ).optional(),
  april2026SecurityIncidentMigrationAppliedFrom: z.nullable(
    OldSsoProtectionApril2026SecurityIncidentMigrationAppliedFrom$inboundSchema,
  ).optional(),
});

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

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

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

/** @internal */
export const ThreeHundredAndSixteen$inboundSchema: z.ZodType<
  ThreeHundredAndSixteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  ssoProtection: types.nullable(
    smartUnion([
      z.lazy(() => SsoProtection1$inboundSchema),
      SsoProtection2$inboundSchema,
    ]),
  ),
  oldSsoProtection: types.nullable(
    smartUnion([
      z.lazy(() => OldSsoProtection1$inboundSchema),
      OldSsoProtection2$inboundSchema,
    ]),
  ),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndFifteen$inboundSchema: z.ZodType<
  ThreeHundredAndFifteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  next: z.lazy(() => UserEventPayload315Next$inboundSchema),
  previous: z.lazy(() => UserEventPayload315Previous$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndFourteen$inboundSchema: z.ZodType<
  ThreeHundredAndFourteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  next: z.lazy(() => UserEventPayload314Next$inboundSchema),
  previous: z.lazy(() => UserEventPayload314Previous$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndThirteen$inboundSchema: z.ZodType<
  ThreeHundredAndThirteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  next: z.lazy(() => UserEventPayload313Next$inboundSchema),
  previous: z.lazy(() => UserEventPayload313Previous$inboundSchema),
});

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

/** @internal */
export const UserEventPayload312Previous$inboundSchema: z.ZodType<
  UserEventPayload312Previous,
  z.ZodTypeDef,
  unknown
> = z.object({
  expiration: types.optional(types.string()),
  expirationProduction: types.optional(types.string()),
  expirationCanceled: types.optional(types.string()),
  expirationErrored: types.optional(types.string()),
});

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

/** @internal */
export const UserEventPayload312Next$inboundSchema: z.ZodType<
  UserEventPayload312Next,
  z.ZodTypeDef,
  unknown
> = z.object({
  expiration: types.optional(types.string()),
  expirationProduction: types.optional(types.string()),
  expirationCanceled: types.optional(types.string()),
  expirationErrored: types.optional(types.string()),
});

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

/** @internal */
export const ThreeHundredAndTwelve$inboundSchema: z.ZodType<
  ThreeHundredAndTwelve,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  previous: z.lazy(() => UserEventPayload312Previous$inboundSchema),
  next: z.lazy(() => UserEventPayload312Next$inboundSchema),
});

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

/** @internal */
export const ThreeHundredAndEleven$inboundSchema: z.ZodType<
  ThreeHundredAndEleven,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  publicSource: types.boolean(),
});

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

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

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

/** @internal */
export const ThreeHundredAndNine$inboundSchema: z.ZodType<
  ThreeHundredAndNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  protectedSourcemaps: types.boolean(),
});

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

/** @internal */
export const ThreeHundredAndEight$inboundSchema: z.ZodType<
  ThreeHundredAndEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  gitForkProtection: types.boolean(),
});

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

/** @internal */
export const ThreeHundredAndSeven$inboundSchema: z.ZodType<
  ThreeHundredAndSeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  customerSupportCodeVisibility: types.boolean(),
});

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

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

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

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

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

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

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

/** @internal */
export const ThreeHundredAndSix$inboundSchema: z.ZodType<
  ThreeHundredAndSix,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  previous: z.lazy(() => UserEventPayload306Previous$inboundSchema),
  next: z.lazy(() => UserEventPayload306Next$inboundSchema),
});

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

/** @internal */
export const ThreeHundredAndFive$inboundSchema: z.ZodType<
  ThreeHundredAndFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  region: types.optional(types.string()),
  failoverRegions: types.optional(z.array(types.string())),
});

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

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

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

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

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

/** @internal */
export const ThreeHundredAndFour$inboundSchema: z.ZodType<
  ThreeHundredAndFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  previous: types.nullable(
    z.lazy(() => UserEventPayload304Previous$inboundSchema),
  ),
  next: types.nullable(z.lazy(() => UserEventPayload304Next$inboundSchema)),
});

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

/** @internal */
export const ThreeHundredAndThree$inboundSchema: z.ZodType<
  ThreeHundredAndThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  targetDeploymentId: types.optional(types.string()),
  action: types.optional(types.string()),
});

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

/** @internal */
export const ThreeHundredAndTwo$inboundSchema: z.ZodType<
  ThreeHundredAndTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  targetDeploymentId: types.optional(types.string()),
  newTargetPercentage: types.optional(types.number()),
});

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

/** @internal */
export const ThreeHundredAndOne$inboundSchema: z.ZodType<
  ThreeHundredAndOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  targetDeploymentId: types.optional(types.string()),
});

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

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

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

/** @internal */
export const ThreeHundred$inboundSchema: z.ZodType<
  ThreeHundred,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  projectAccountId: types.string(),
  deploymentId: types.string(),
  rollbackDescription: types.optional(
    z.lazy(() => RollbackDescription$inboundSchema),
  ),
});

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

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

/** @internal */
export const TwoHundredAndNinetyNine$inboundSchema: z.ZodType<
  TwoHundredAndNinetyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.optional(types.string()),
  projectName: types.string(),
  consent: Consent$inboundSchema,
});

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

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

/** @internal */
export const TwoHundredAndNinetyEight$inboundSchema: z.ZodType<
  TwoHundredAndNinetyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.optional(types.string()),
  reasonCode: types.optional(ReasonCode$inboundSchema),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const TwoHundredAndNinetyFive$inboundSchema: z.ZodType<
  TwoHundredAndNinetyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  passwordProtection: types.nullable(
    smartUnion([
      z.lazy(() => PasswordProtection1$inboundSchema),
      PasswordProtection2$inboundSchema,
    ]),
  ),
  oldPasswordProtection: types.nullable(
    smartUnion([
      z.lazy(() => OldPasswordProtection1$inboundSchema),
      OldPasswordProtection2$inboundSchema,
    ]),
  ),
});

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

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

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

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

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

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

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

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

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

/** @internal */
export const TwoHundredAndNinetyFour$inboundSchema: z.ZodType<
  TwoHundredAndNinetyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  optionsAllowlist: z.nullable(z.lazy(() => OptionsAllowlist$inboundSchema))
    .optional(),
  oldOptionsAllowlist: z.nullable(
    z.lazy(() => OldOptionsAllowlist$inboundSchema),
  ).optional(),
});

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

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

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

/** @internal */
export const TwoHundredAndNinetyTwo$inboundSchema: z.ZodType<
  TwoHundredAndNinetyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  previousProjectId: types.optional(types.string()),
  newProjectId: types.optional(types.string()),
  previousProjectName: types.string(),
  newProjectName: types.string(),
  destinationAccountName: types.string(),
  transferId: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndNinetyOne$inboundSchema: z.ZodType<
  TwoHundredAndNinetyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  originAccountName: types.string(),
  destinationAccountName: types.string(),
  destinationAccountId: types.string(),
  transferId: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndNinety$inboundSchema: z.ZodType<
  TwoHundredAndNinety,
  z.ZodTypeDef,
  unknown
> = z.object({
  previousProjectId: types.optional(types.string()),
  projectName: types.string(),
  destinationAccountName: types.nullable(types.string()),
  transferId: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndEightyNine$inboundSchema: z.ZodType<
  TwoHundredAndEightyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  previousProjectId: types.optional(types.string()),
  newProjectId: types.optional(types.string()),
  previousProjectName: types.string(),
  newProjectName: types.string(),
  originAccountName: types.string(),
  transferId: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const PayloadProjectMembership$inboundSchema: z.ZodType<
  PayloadProjectMembership,
  z.ZodTypeDef,
  unknown
> = z.object({
  role: types.optional(UserEventPayload288Role$inboundSchema),
  uid: types.optional(types.string()),
  createdAt: types.optional(types.number()),
  username: types.optional(types.string()),
  previousRole: types.optional(PayloadPreviousRole$inboundSchema),
});

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

/** @internal */
export const TwoHundredAndEightyEight$inboundSchema: z.ZodType<
  TwoHundredAndEightyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayload288Project$inboundSchema),
  projectMembership: z.lazy(() => PayloadProjectMembership$inboundSchema),
});

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

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

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

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

/** @internal */
export const RemovedMembership$inboundSchema: z.ZodType<
  RemovedMembership,
  z.ZodTypeDef,
  unknown
> = z.object({
  role: UserEventPayload287Role$inboundSchema,
  uid: types.string(),
  createdAt: types.number(),
  username: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndEightySeven$inboundSchema: z.ZodType<
  TwoHundredAndEightySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayload287Project$inboundSchema),
  removedMembership: z.lazy(() => RemovedMembership$inboundSchema),
});

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

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

/** @internal */
export const UserEventPayload286Project$inboundSchema: z.ZodType<
  UserEventPayload286Project,
  z.ZodTypeDef,
  unknown
> = z.object({
  name: types.string(),
  role: UserEventPayload286Role$inboundSchema,
  invitedUserName: types.string(),
  id: types.optional(types.string()),
  invitedUserId: types.optional(types.string()),
});

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

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

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

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

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

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

/** @internal */
export const ProjectMembership$inboundSchema: z.ZodType<
  ProjectMembership,
  z.ZodTypeDef,
  unknown
> = z.object({
  role: UserEventPayload285Role$inboundSchema,
  uid: types.string(),
  createdAt: types.number(),
  username: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndEightyFive$inboundSchema: z.ZodType<
  TwoHundredAndEightyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayload285Project$inboundSchema),
  projectMembership: types.nullable(
    z.lazy(() => ProjectMembership$inboundSchema),
  ),
});

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

/** @internal */
export const TwoHundredAndEightyFour$inboundSchema: z.ZodType<
  TwoHundredAndEightyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  target: types.string(),
  domain: types.string(),
  configuredBy: z.nullable(types.string()).optional(),
  prevConfiguredBy: z.nullable(types.string()).optional(),
});

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

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

/** @internal */
export const PayloadProjects$inboundSchema: z.ZodType<
  PayloadProjects,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  role: UserEventPayloadRole$inboundSchema,
  membershipCreatedAt: types.number(),
});

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

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

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

/** @internal */
export const TwoHundredAndEightyThree$inboundSchema: z.ZodType<
  TwoHundredAndEightyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  projects: z.array(z.lazy(() => PayloadProjects$inboundSchema)),
  teamMembership: types.optional(z.lazy(() => TeamMembership$inboundSchema)),
  directoryType: types.optional(types.string()),
});

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

/** @internal */
export const TwoHundredAndEightyTwo$inboundSchema: z.ZodType<
  TwoHundredAndEightyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  domain: types.string(),
  redirect: z.nullable(types.string()).optional(),
  redirectStatusCode: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const TwoHundredAndEightyOne$inboundSchema: z.ZodType<
  TwoHundredAndEightyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  oldProjectId: types.string(),
  oldProjectName: types.string(),
  newProjectId: types.string(),
  newProjectName: types.string(),
  domain: types.string(),
});

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