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,096 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 payload of the event, if requested.
 */
export type ThreeHundredAndThree = {
  emailDomain?: string | null | undefined;
};

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

export const Enabled = {
  Default: "default",
  DefaultForce: "default-force",
  Off: "off",
  OffForce: "off-force",
  On: "on",
  OnForce: "on-force",
} as const;
export type Enabled = ClosedEnum<typeof Enabled>;

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndTwo = {
  environment: PayloadEnvironment;
  enabled: Enabled;
};

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

/**
 * The payload of the event, if requested.
 */
export type ThreeHundredAndOne = {
  projectId: string;
  projectName: string;
  enabled: boolean | null;
  environment: Environment;
};

/**
 * The payload of the event, if requested.
 */
export type ThreeHundred = {
  enabled: boolean;
  domain?: string | undefined;
};

export type UserEventPayload299Previous = {};

export type UserEventPayload299Next = {};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyNine = {
  previous: UserEventPayload299Previous | null;
  next: UserEventPayload299Next | null;
};

export type Reasons = {
  slug: string;
  description: string;
};

export const UserEventPayload298Role = {
  Billing: "BILLING",
  Contributor: "CONTRIBUTOR",
  Developer: "DEVELOPER",
  Member: "MEMBER",
  Owner: "OWNER",
  Security: "SECURITY",
  Viewer: "VIEWER",
  ViewerForPlus: "VIEWER_FOR_PLUS",
} as const;
export type UserEventPayload298Role = ClosedEnum<
  typeof UserEventPayload298Role
>;

export type PayloadRemovedUsers = {
  role: UserEventPayload298Role;
  confirmed: boolean;
  confirmedAt?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyEight = {
  slug: string;
  teamId: string;
  by: string;
  byUid?: string | undefined;
  reasons?: Array<Reasons> | undefined;
  removedUsers?: { [k: string]: PayloadRemovedUsers } | undefined;
  removedMemberCount?: number | undefined;
  timestamp?: number | undefined;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetySeven = {
  previous?: UserEventPayload297Previous | undefined;
  next?: UserEventPayload297Next | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetySix = {
  eventId: string;
  sessionId: string;
  /**
   * Currently emitted session kinds: chat, investigation.
   */
  sessionKind: string;
  /**
   * Currently emitted surfaces: dashboard, internal, slack, automation, github.
   */
  surface: string;
  occurredAt: number;
  planId: string;
  /**
   * Scopes requested by the model-authored plan.
   */
  requestedScopes: Array<string>;
  /**
   * Requested Vercel scopes that are not included in the baseline token.
   */
  elevatedScopes: Array<string>;
  /**
   * Baseline plus elevated Vercel scopes used when minting scoped tokens.
   */
  mergedScopes: Array<string>;
  /**
   * External GitHub scopes requested by the plan; these are not Vercel token scopes.
   */
  githubScopes: Array<string>;
  requestedScopeCount: number;
  elevatedScopeCount: number;
  mergedScopeCount: number;
  githubScopeCount: number;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyFive = {
  eventId: string;
  sessionId: string;
  /**
   * Currently emitted session kinds: chat, investigation.
   */
  sessionKind: string;
  /**
   * Currently emitted surfaces: dashboard, internal, slack, automation, github.
   */
  surface: string;
  occurredAt: number;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyFour = {
  trialCreditsIssuedAt: number;
  expiresAt: string;
  amount: string;
  currency: string;
};

/**
 * Which repository visibilities get automatic reviews
 */
export const UserEventPayloadScope = {
  All: "all",
  Private: "private",
  Public: "public",
  SelectedRepos: "selected_repos",
} as const;
/**
 * Which repository visibilities get automatic reviews
 */
export type UserEventPayloadScope = ClosedEnum<typeof UserEventPayloadScope>;

/**
 * Automatic code review settings
 */
export type UserEventPayload293Previous = {
  /**
   * Whether automatic code reviews are enabled
   */
  enabled: boolean;
  /**
   * Which repository visibilities get automatic reviews
   */
  scope: UserEventPayloadScope;
  /**
   * Whether to include draft pull requests in automatic reviews
   */
  includeDrafts: boolean;
  /**
   * GitHub repos to scope automatic reviews to. Format: "owner/repo" (lowercase). Only used when scope='selected_repos'.
   */
  selectedRepos?: Array<string> | null | undefined;
};

/**
 * Which repository visibilities get automatic reviews
 */
export const UserEventPayload293Scope = {
  All: "all",
  Private: "private",
  Public: "public",
  SelectedRepos: "selected_repos",
} as const;
/**
 * Which repository visibilities get automatic reviews
 */
export type UserEventPayload293Scope = ClosedEnum<
  typeof UserEventPayload293Scope
>;

/**
 * Automatic code review settings
 */
export type UserEventPayload293Next = {
  /**
   * Whether automatic code reviews are enabled
   */
  enabled: boolean;
  /**
   * Which repository visibilities get automatic reviews
   */
  scope: UserEventPayload293Scope;
  /**
   * Whether to include draft pull requests in automatic reviews
   */
  includeDrafts: boolean;
  /**
   * GitHub repos to scope automatic reviews to. Format: "owner/repo" (lowercase). Only used when scope='selected_repos'.
   */
  selectedRepos?: Array<string> | null | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyThree = {
  /**
   * Automatic code review settings
   */
  previous?: UserEventPayload293Previous | undefined;
  /**
   * Automatic code review settings
   */
  next: UserEventPayload293Next;
};

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

export const UserEventPayload291Type = {
  Blob: "blob",
  EdgeConfig: "edge-config",
  Integration: "integration",
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type UserEventPayload291Type = ClosedEnum<
  typeof UserEventPayload291Type
>;

export const PayloadAccess = {
  Private: "private",
  Public: "public",
} as const;
export type PayloadAccess = ClosedEnum<typeof PayloadAccess>;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinetyOne = {
  id: string;
  name?: string | undefined;
  computeUnitsMax?: number | undefined;
  computeUnitsMin?: number | undefined;
  suspendTimeoutSeconds?: number | undefined;
  type: UserEventPayload291Type;
  access?: PayloadAccess | undefined;
  locked: boolean;
};

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndNinety = {
  store: UserEventPayload290Store;
  ownerId?: string | undefined;
};

export const UserEventPayload289Type = {
  Blob: "blob",
  EdgeConfig: "edge-config",
  Integration: "integration",
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type UserEventPayload289Type = ClosedEnum<
  typeof UserEventPayload289Type
>;

export const Access = {
  Private: "private",
  Public: "public",
} as const;
export type Access = ClosedEnum<typeof Access>;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyNine = {
  id: string;
  name?: string | undefined;
  computeUnitsMax?: number | undefined;
  computeUnitsMin?: number | undefined;
  suspendTimeoutSeconds?: number | undefined;
  type: UserEventPayload289Type;
  access?: Access | undefined;
};

export const UserEventPayload288Type = {
  Blob: "blob",
  EdgeConfig: "edge-config",
  Integration: "integration",
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type UserEventPayload288Type = ClosedEnum<
  typeof UserEventPayload288Type
>;

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyEight = {
  transferRequestCode: string;
  store: UserEventPayloadStore;
  originTeamId: string;
  originTeamName: string;
};

export const UserEventPayload287Type = {
  Blob: "blob",
  EdgeConfig: "edge-config",
  Integration: "integration",
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type UserEventPayload287Type = ClosedEnum<
  typeof UserEventPayload287Type
>;

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightySeven = {
  transferRequestCode: string;
  store: PayloadStore;
  destinationTeamId: string;
  destinationTeamName: string;
};

export const UserEventPayload286Type = {
  Blob: "blob",
  EdgeConfig: "edge-config",
  Integration: "integration",
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type UserEventPayload286Type = ClosedEnum<
  typeof UserEventPayload286Type
>;

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightySix = {
  transferRequestCode: string;
  store: Store;
};

export const StoreType = {
  Postgres: "postgres",
  Redis: "redis",
} as const;
export type StoreType = ClosedEnum<typeof StoreType>;

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyFive = {
  storeType: StoreType;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyFour = {
  webhookUrl?: string | undefined;
};

/**
 * The budget type
 */
export const UserEventPayload283Type = {
  Fixed: "fixed",
} as const;
/**
 * The budget type
 */
export type UserEventPayload283Type = ClosedEnum<
  typeof UserEventPayload283Type
>;

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

/**
 * Represents a budget for tracking and notifying teams on their spending.
 */
export type UserEventPayload283Budget = {
  /**
   * The budget type
   */
  type: UserEventPayload283Type;
  /**
   * 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?: PayloadPricingPlan | undefined;
  /**
   * Partition key
   */
  teamId: string;
  /**
   * Sort key that needs to be unique per teamId
   */
  id: string;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyThree = {
  /**
   * Represents a budget for tracking and notifying teams on their spending.
   */
  budget: UserEventPayload283Budget;
  webhookUrl?: string | undefined;
};

/**
 * The budget type
 */
export const UserEventPayload282Type = {
  Fixed: "fixed",
} as const;
/**
 * The budget type
 */
export type UserEventPayload282Type = ClosedEnum<
  typeof UserEventPayload282Type
>;

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

/**
 * Represents a budget for tracking and notifying teams on their spending.
 */
export type UserEventPayload282Budget = {
  /**
   * The budget type
   */
  type: UserEventPayload282Type;
  /**
   * 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?: PricingPlan | undefined;
  /**
   * Partition key
   */
  teamId: string;
  /**
   * Sort key that needs to be unique per teamId
   */
  id: string;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndEightyTwo = {
  /**
   * Represents a budget for tracking and notifying teams on their spending.
   */
  budget: UserEventPayload282Budget;
};

/**
 * The budget type
 */
export const UserEventPayload281Type = {
  Fixed: "fixed",
} as const;
/**
 * The budget type
 */
export type UserEventPayload281Type = ClosedEnum<
  typeof UserEventPayload281Type
>;

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

/**
 * Represents a budget for tracking and notifying teams on their spending.
 */
export type BudgetItem = {
  /**
   * The budget type
   */
  type: UserEventPayload281Type;
  /**
   * 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?: UserEventPayloadPricingPlan | undefined;
  /**
   * Partition key
   */
  teamId: string;
  /**
   * Sort key that needs to be unique per teamId
   */
  id: string;
};

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

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

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

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

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

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

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

export type UserEventPayload276Names = {
  en: string;
};

export type PayloadCity = {
  names: UserEventPayload276Names;
};

export type UserEventPayload276GeolocationNames = {
  en: string;
};

export type PayloadCountry = {
  names: UserEventPayload276GeolocationNames;
};

export type UserEventPayload276GeolocationMostSpecificSubdivisionNames = {
  en: string;
};

export type PayloadMostSpecificSubdivision = {
  names: UserEventPayload276GeolocationMostSpecificSubdivisionNames;
};

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 TwoHundredAndSeventySix = {
  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 TwoHundredAndSeventyFive = {
  scalingRules: { [k: string]: ScalingRules };
  min: number;
  max: number;
  url: string;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndSeventyTwo = {
  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 TwoHundredAndSeventyOne = {
  uid: string;
  name: Name2 | string;
};

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

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

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

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndSixtySix = {
  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 TwoHundredAndSixtyFive = {
  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 TwoHundredAndSixtyFour = {
  projectId: string;
  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 TwoHundredAndSixtyThree = {
  projectId: string;
  projectName: string;
  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 TwoHundredAndSixtyTwo = {
  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;
  enabled: boolean;
  regions?: Array<string> | undefined;
};

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

export type UserEventPayload261Next = {
  project: UserEventPayload261Project;
};

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

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

export type UserEventPayload261Previous = {
  project: UserEventPayload261PreviousProject;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndSixtyOne = {
  projectId: string;
  projectName: string;
  next: UserEventPayload261Next;
  previous: UserEventPayload261Previous;
};

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 TwoHundredAndSixty = {
  projectId?: string | undefined;
  projectName?: string | undefined;
  ssoProtection: SsoProtection1 | SsoProtection2 | null;
  oldSsoProtection: OldSsoProtection1 | OldSsoProtection2 | null;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndFiftyNine = {
  projectId: string;
  projectName: string;
  next: UserEventPayload259Next;
  previous: UserEventPayload259Previous;
};

export type UserEventPayload258Next = {
  skewProtectionMaxAge: number;
};

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndFiftyEight = {
  projectId: string;
  projectName: string;
  next: UserEventPayload258Next;
  previous: UserEventPayload258Previous;
};

export type UserEventPayload257Next = {
  skewProtectionBoundaryAt: number;
};

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndFiftySeven = {
  projectId: string;
  projectName: string;
  next: UserEventPayload257Next;
  previous: UserEventPayload257Previous;
};

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

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

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

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

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

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

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

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

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

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

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

export type UserEventPayload250Next = {
  issuerMode: PayloadIssuerMode;
};

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndFifty = {
  projectId: string;
  projectName: string;
  previous: UserEventPayload250Previous;
  next: UserEventPayload250Next;
};

export type UserEventPayload249Previous = {};

export type UserEventPayload249Next = {};

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

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

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

/**
 * The payload of the event, if requested.
 */
export type TwoHundredAndFortySix = {
  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 TwoHundredAndFortyFive = {
  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>;

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

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 PayloadEnvironment$inboundSchema: z.ZodNativeEnum<
  typeof PayloadEnvironment
> = z.nativeEnum(PayloadEnvironment);

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

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

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 Environment$inboundSchema: z.ZodNativeEnum<typeof Environment> = z
  .nativeEnum(Environment);

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

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 ThreeHundred$inboundSchema: z.ZodType<
  ThreeHundred,
  z.ZodTypeDef,
  unknown
> = z.object({
  enabled: types.boolean(),
  domain: types.optional(types.string()),
});

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 UserEventPayload299Previous$inboundSchema: z.ZodType<
  UserEventPayload299Previous,
  z.ZodTypeDef,
  unknown
> = z.object({});

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

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

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

/** @internal */
export const TwoHundredAndNinetyNine$inboundSchema: z.ZodType<
  TwoHundredAndNinetyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  previous: types.nullable(
    z.lazy(() => UserEventPayload299Previous$inboundSchema),
  ),
  next: types.nullable(z.lazy(() => UserEventPayload299Next$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 Reasons$inboundSchema: z.ZodType<Reasons, z.ZodTypeDef, unknown> =
  z.object({
    slug: types.string(),
    description: types.string(),
  });

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

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

/** @internal */
export const PayloadRemovedUsers$inboundSchema: z.ZodType<
  PayloadRemovedUsers,
  z.ZodTypeDef,
  unknown
> = z.object({
  role: UserEventPayload298Role$inboundSchema,
  confirmed: types.boolean(),
  confirmedAt: types.optional(types.number()),
});

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

/** @internal */
export const TwoHundredAndNinetyEight$inboundSchema: z.ZodType<
  TwoHundredAndNinetyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  slug: types.string(),
  teamId: types.string(),
  by: types.string(),
  byUid: types.optional(types.string()),
  reasons: types.optional(z.array(z.lazy(() => Reasons$inboundSchema))),
  removedUsers: types.optional(
    z.record(z.lazy(() => PayloadRemovedUsers$inboundSchema)),
  ),
  removedMemberCount: types.optional(types.number()),
  timestamp: types.optional(types.number()),
});

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 UserEventPayload297Previous$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload297Previous
> = z.nativeEnum(UserEventPayload297Previous);

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

/** @internal */
export const TwoHundredAndNinetySeven$inboundSchema: z.ZodType<
  TwoHundredAndNinetySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  previous: types.optional(UserEventPayload297Previous$inboundSchema),
  next: types.optional(UserEventPayload297Next$inboundSchema),
});

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({
  eventId: types.string(),
  sessionId: types.string(),
  sessionKind: types.string(),
  surface: types.string(),
  occurredAt: types.number(),
  planId: types.string(),
  requestedScopes: z.array(types.string()),
  elevatedScopes: z.array(types.string()),
  mergedScopes: z.array(types.string()),
  githubScopes: z.array(types.string()),
  requestedScopeCount: types.number(),
  elevatedScopeCount: types.number(),
  mergedScopeCount: types.number(),
  githubScopeCount: types.number(),
});

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 TwoHundredAndNinetyFive$inboundSchema: z.ZodType<
  TwoHundredAndNinetyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  eventId: types.string(),
  sessionId: types.string(),
  sessionKind: types.string(),
  surface: types.string(),
  occurredAt: types.number(),
});

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 TwoHundredAndNinetyFour$inboundSchema: z.ZodType<
  TwoHundredAndNinetyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  trialCreditsIssuedAt: types.number(),
  expiresAt: types.string(),
  amount: types.string(),
  currency: types.string(),
});

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 UserEventPayloadScope$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayloadScope
> = z.nativeEnum(UserEventPayloadScope);

/** @internal */
export const UserEventPayload293Previous$inboundSchema: z.ZodType<
  UserEventPayload293Previous,
  z.ZodTypeDef,
  unknown
> = z.object({
  enabled: types.boolean(),
  scope: UserEventPayloadScope$inboundSchema,
  includeDrafts: types.boolean(),
  selectedRepos: z.nullable(z.array(types.string())).optional(),
});

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

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

/** @internal */
export const UserEventPayload293Next$inboundSchema: z.ZodType<
  UserEventPayload293Next,
  z.ZodTypeDef,
  unknown
> = z.object({
  enabled: types.boolean(),
  scope: UserEventPayload293Scope$inboundSchema,
  includeDrafts: types.boolean(),
  selectedRepos: z.nullable(z.array(types.string())).optional(),
});

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

/** @internal */
export const TwoHundredAndNinetyThree$inboundSchema: z.ZodType<
  TwoHundredAndNinetyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  previous: types.optional(
    z.lazy(() => UserEventPayload293Previous$inboundSchema),
  ),
  next: z.lazy(() => UserEventPayload293Next$inboundSchema),
});

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({
  slug: 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 UserEventPayload291Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload291Type
> = z.nativeEnum(UserEventPayload291Type);

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

/** @internal */
export const TwoHundredAndNinetyOne$inboundSchema: z.ZodType<
  TwoHundredAndNinetyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  name: types.optional(types.string()),
  computeUnitsMax: types.optional(types.number()),
  computeUnitsMin: types.optional(types.number()),
  suspendTimeoutSeconds: types.optional(types.number()),
  type: UserEventPayload291Type$inboundSchema,
  access: types.optional(PayloadAccess$inboundSchema),
  locked: types.boolean(),
});

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 UserEventPayload290Store$inboundSchema: z.ZodType<
  UserEventPayload290Store,
  z.ZodTypeDef,
  unknown
> = z.object({
  name: types.string(),
  id: types.string(),
});

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

/** @internal */
export const TwoHundredAndNinety$inboundSchema: z.ZodType<
  TwoHundredAndNinety,
  z.ZodTypeDef,
  unknown
> = z.object({
  store: z.lazy(() => UserEventPayload290Store$inboundSchema),
  ownerId: 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 UserEventPayload289Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload289Type
> = z.nativeEnum(UserEventPayload289Type);

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

/** @internal */
export const TwoHundredAndEightyNine$inboundSchema: z.ZodType<
  TwoHundredAndEightyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  name: types.optional(types.string()),
  computeUnitsMax: types.optional(types.number()),
  computeUnitsMin: types.optional(types.number()),
  suspendTimeoutSeconds: types.optional(types.number()),
  type: UserEventPayload289Type$inboundSchema,
  access: types.optional(Access$inboundSchema),
});

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 UserEventPayload288Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload288Type
> = z.nativeEnum(UserEventPayload288Type);

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

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

/** @internal */
export const TwoHundredAndEightyEight$inboundSchema: z.ZodType<
  TwoHundredAndEightyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  transferRequestCode: types.string(),
  store: z.lazy(() => UserEventPayloadStore$inboundSchema),
  originTeamId: types.string(),
  originTeamName: types.string(),
});

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 UserEventPayload287Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload287Type
> = z.nativeEnum(UserEventPayload287Type);

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

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

/** @internal */
export const TwoHundredAndEightySeven$inboundSchema: z.ZodType<
  TwoHundredAndEightySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  transferRequestCode: types.string(),
  store: z.lazy(() => PayloadStore$inboundSchema),
  destinationTeamId: types.string(),
  destinationTeamName: types.string(),
});

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 UserEventPayload286Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload286Type
> = z.nativeEnum(UserEventPayload286Type);

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

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

/** @internal */
export const TwoHundredAndEightySix$inboundSchema: z.ZodType<
  TwoHundredAndEightySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  transferRequestCode: types.string(),
  store: z.lazy(() => Store$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 StoreType$inboundSchema: z.ZodNativeEnum<typeof StoreType> = z
  .nativeEnum(StoreType);

/** @internal */
export const TwoHundredAndEightyFive$inboundSchema: z.ZodType<
  TwoHundredAndEightyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  storeType: StoreType$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({
  webhookUrl: types.optional(types.string()),
});

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 UserEventPayload283Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload283Type
> = z.nativeEnum(UserEventPayload283Type);

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

/** @internal */
export const UserEventPayload283Budget$inboundSchema: z.ZodType<
  UserEventPayload283Budget,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload283Type$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(PayloadPricingPlan$inboundSchema),
  teamId: types.string(),
  id: types.string(),
});

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

/** @internal */
export const TwoHundredAndEightyThree$inboundSchema: z.ZodType<
  TwoHundredAndEightyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  budget: z.lazy(() => UserEventPayload283Budget$inboundSchema),
  webhookUrl: 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 UserEventPayload282Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload282Type
> = z.nativeEnum(UserEventPayload282Type);

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

/** @internal */
export const UserEventPayload282Budget$inboundSchema: z.ZodType<
  UserEventPayload282Budget,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload282Type$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(PricingPlan$inboundSchema),
  teamId: types.string(),
  id: types.string(),
});

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

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

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 UserEventPayload281Type$inboundSchema: z.ZodNativeEnum<
  typeof UserEventPayload281Type
> = z.nativeEnum(UserEventPayload281Type);

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

/** @internal */
export const BudgetItem$inboundSchema: z.ZodType<
  BudgetItem,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload281Type$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(UserEventPayloadPricingPlan$inboundSchema),
  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 UserEventPayloadBudget$inboundSchema: z.ZodType<
  UserEventPayloadBudget,
  z.ZodTypeDef,
  unknown
> = z.object({
  budgetItem: z.lazy(() => BudgetItem$inboundSchema),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const PayloadCity$inboundSchema: z.ZodType<
  PayloadCity,
  z.ZodTypeDef,
  unknown
> = z.object({
  names: z.lazy(() => UserEventPayload276Names$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 UserEventPayload276GeolocationNames$inboundSchema: z.ZodType<
  UserEventPayload276GeolocationNames,
  z.ZodTypeDef,
  unknown
> = z.object({
  en: types.string(),
});

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

/** @internal */
export const PayloadCountry$inboundSchema: z.ZodType<
  PayloadCountry,
  z.ZodTypeDef,
  unknown
> = z.object({
  names: z.lazy(() => UserEventPayload276GeolocationNames$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 UserEventPayload276GeolocationMostSpecificSubdivisionNames$inboundSchema:
  z.ZodType<
    UserEventPayload276GeolocationMostSpecificSubdivisionNames,
    z.ZodTypeDef,
    unknown
  > = z.object({
    en: types.string(),
  });

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

/** @internal */
export const PayloadMostSpecificSubdivision$inboundSchema: z.ZodType<
  PayloadMostSpecificSubdivision,
  z.ZodTypeDef,
  unknown
> = z.object({
  names: z.lazy(() =>
    UserEventPayload276GeolocationMostSpecificSubdivisionNames$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 TwoHundredAndSeventySix$inboundSchema: z.ZodType<
  TwoHundredAndSeventySix,
  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 twoHundredAndSeventySixFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSeventySix, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSeventySix$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSeventySix' 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 TwoHundredAndSeventyFive$inboundSchema: z.ZodType<
  TwoHundredAndSeventyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  scalingRules: z.record(z.lazy(() => ScalingRules$inboundSchema)),
  min: types.number(),
  max: types.number(),
  url: types.string(),
});

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

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

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

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

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

export function twoHundredAndSeventyTwoFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSeventyTwo, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSeventyTwo$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSeventyTwo' 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 TwoHundredAndSeventyOne$inboundSchema: z.ZodType<
  TwoHundredAndSeventyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  uid: types.string(),
  name: smartUnion([z.lazy(() => Name2$inboundSchema), types.string()]),
});

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

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

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

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

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

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

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

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

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

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

export function twoHundredAndSixtySixFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtySix, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtySix$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtySix' 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 TwoHundredAndSixtyFive$inboundSchema: z.ZodType<
  TwoHundredAndSixtyFive,
  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 twoHundredAndSixtyFiveFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtyFive, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtyFive$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtyFive' from JSON`,
  );
}

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

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

export function twoHundredAndSixtyFourFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtyFour, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtyFour$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtyFour' 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 TwoHundredAndSixtyThree$inboundSchema: z.ZodType<
  TwoHundredAndSixtyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  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 twoHundredAndSixtyThreeFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtyThree, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtyThree$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtyThree' 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 TwoHundredAndSixtyTwo$inboundSchema: z.ZodType<
  TwoHundredAndSixtyTwo,
  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 twoHundredAndSixtyTwoFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtyTwo, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtyTwo$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtyTwo' from JSON`,
  );
}

/** @internal */
export const StaticIps$inboundSchema: z.ZodType<
  StaticIps,
  z.ZodTypeDef,
  unknown
> = z.object({
  builds: types.optional(types.boolean()),
  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 UserEventPayload261Project$inboundSchema: z.ZodType<
  UserEventPayload261Project,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.optional(types.string()),
  staticIps: z.lazy(() => StaticIps$inboundSchema),
});

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

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

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

/** @internal */
export const PayloadStaticIps$inboundSchema: z.ZodType<
  PayloadStaticIps,
  z.ZodTypeDef,
  unknown
> = z.object({
  builds: types.optional(types.boolean()),
  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 UserEventPayload261PreviousProject$inboundSchema: z.ZodType<
  UserEventPayload261PreviousProject,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.optional(types.string()),
  staticIps: z.lazy(() => PayloadStaticIps$inboundSchema),
});

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

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

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

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

export function twoHundredAndSixtyOneFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixtyOne, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixtyOne$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixtyOne' 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 TwoHundredAndSixty$inboundSchema: z.ZodType<
  TwoHundredAndSixty,
  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 twoHundredAndSixtyFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndSixty, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndSixty$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndSixty' from JSON`,
  );
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

export function twoHundredAndFortySixFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndFortySix, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndFortySix$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndFortySix' 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 TwoHundredAndFortyFive$inboundSchema: z.ZodType<
  TwoHundredAndFortyFive,
  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 twoHundredAndFortyFiveFromJSON(
  jsonString: string,
): SafeParseResult<TwoHundredAndFortyFive, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => TwoHundredAndFortyFive$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'TwoHundredAndFortyFive' from JSON`,
  );
}

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