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,324 lines 117 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 {
  collectExtraKeys as collectExtraKeys$,
  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 {
  CommitVerification,
  CommitVerification$inboundSchema,
  GitComments,
  GitComments$inboundSchema,
  GitHashtagVercel,
  GitHashtagVercel$inboundSchema,
  HeadInfo,
  HeadInfo$inboundSchema,
  Job10,
  Job10$inboundSchema,
  Job2,
  Job2$inboundSchema,
  Job3,
  Job3$inboundSchema,
  Job4,
  Job4$inboundSchema,
  Job5,
  Job5$inboundSchema,
  Job6,
  Job6$inboundSchema,
  Job7,
  Job7$inboundSchema,
  Job8,
  Job8$inboundSchema,
  Job9,
  Job9$inboundSchema,
  JobDeployHook,
  JobDeployHook$inboundSchema,
  NsnbSideEffect,
  NsnbSideEffect$inboundSchema,
} from "./headinfo.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

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

export type Job1 = {
  type: "bitbucket-push";
  authorized?: boolean | undefined;
  authorizedBy?: string | undefined;
  /**
   * Since December 2022 All project ids associated to this job. Think monorepo. This job will be for one of these project.
   */
  jobProjectIds?: Array<string> | undefined;
  /**
   * Since December 2022 Pairs of projects and owner ids to build for this build request.
   */
  jobPairs?: Array<Array<string>> | undefined;
  /**
   * Since June 2024 Pairs of projects and owner ids to immediately finish (without building) because we want to create them in a skipped state.
   */
  skippedJobPairs?: Array<Array<string>> | undefined;
  /**
   * Since February 2022 All the hashtag-vercel tags found in the commit message triggering the deploy. For example, #VERCEL_DO_SOMETHING
   */
  gitHashtagVercel?: Array<GitHashtagVercel> | undefined;
  /**
   * Since April 2023 Cached count of how many projects are connected to the repo. Saves a few Cosmos queries down the road in the main flow.
   */
  connectedProjectCount?: number | undefined;
  /**
   * Since April 2023 If set then it is a cached result of asking the remote for the PR ID the commit that triggered this Job. Or zero if it was not a PR. This prevents a few git round trips by the git updater.
   */
  prIdOrZero?: number | undefined;
  /**
   * Since June 2023 Determines if comments should be posted to the git host. Replaces `github.silent` in the vercel.json.
   */
  gitComments?: GitComments | undefined;
  /**
   * Since 28 Feb 2024 If set to true, identifies that the git job was created for a manual git deployment
   */
  isManualGitDeploy?: boolean | undefined;
  /**
   * Since 6 Nov 2025 The verification status of the commit. - 'verified' if the commit is verified - 'unverified' if the commit is not verified - 'unknown' if the commit verification status is unknown or not supported
   */
  commitVerification?: CommitVerification | undefined;
  /**
   * Since March 2026 Records a successful NSNB auto-add result so later GitHub PR comments can deterministically explain why this SHA was allowed to deploy.
   */
  nsnbSideEffect?: NsnbSideEffect | undefined;
  createdAt?: number | undefined;
  deploymentId?: string | undefined;
  deployHook?: JobDeployHook | undefined;
  eventful?: boolean | undefined;
  forceNew?: boolean | undefined;
  headInfo: HeadInfo;
  linkedProjectId?: string | undefined;
  name: string;
  owner: string;
  prId?: number | undefined;
  projectId?: string | undefined;
  customEnvId?: string | null | undefined;
  ref: string;
  repoPushedAt?: number | null | undefined;
  repoUuid: string;
  sha: string;
  silent?: boolean | undefined;
  slug: string;
  target?: string | null | undefined;
  url?: string | undefined;
  withCache?: boolean | undefined;
  workspaceUuid: string;
  provider: JobProvider;
};

export type PayloadJob =
  | Job1
  | Job2
  | Job3
  | Job4
  | Job5
  | Job6
  | Job7
  | Job8
  | Job9
  | Job10;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndSix = {
  job: Job1 | Job2 | Job3 | Job4 | Job5 | Job6 | Job7 | Job8 | Job9 | Job10;
};

/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export const UserEventPayloadAllowListedReadyStateReasonInternal = {
  EarlyIgnoreStep: "EARLY_IGNORE_STEP",
  IgnoreStep: "IGNORE_STEP",
  NamespacePruned: "NAMESPACE_PRUNED",
  UnaffectedProject: "UNAFFECTED_PROJECT",
  UnverifiedCommit: "UNVERIFIED_COMMIT",
} as const;
/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export type UserEventPayloadAllowListedReadyStateReasonInternal = ClosedEnum<
  typeof UserEventPayloadAllowListedReadyStateReasonInternal
>;

export type UserEventPayloadDeployment = {
  id: string;
  name: string;
  url: string;
  meta: { [k: string]: string };
  readyState?: string | undefined;
  /**
   * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
   */
  allowListedReadyStateReasonInternal?:
    | UserEventPayloadAllowListedReadyStateReasonInternal
    | undefined;
};

export const GitCredentialSource = {
  ExternalToken: "external-token",
} as const;
export type GitCredentialSource = ClosedEnum<typeof GitCredentialSource>;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndFive = {
  name?: string | undefined;
  alias?: Array<string> | undefined;
  target?: string | null | undefined;
  deployment?: UserEventPayloadDeployment | null | undefined;
  url: string;
  forced?: boolean | undefined;
  gitCredentialSource?: GitCredentialSource | undefined;
  deploymentId?: string | undefined;
  plan?: string | undefined;
  project?: string | undefined;
  projectId?: string | undefined;
  regions?: Array<string> | undefined;
  type?: string | undefined;
};

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

export type UserEventPayload103Project = {
  name: string;
};

export type DeployHook = {
  createdAt: number;
  id: string;
  name: string;
  ref: string;
};

export type Job = {
  deployHook: DeployHook;
  state: string;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThree = {
  project: UserEventPayload103Project;
  job: Job;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type OneHundred = {
  status: string;
  suffix: string;
};

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

/**
 * The payload of the event, if requested.
 */
export type NinetyEight = {
  metricName: string;
  additionalProperties?: { [k: string]: any } | undefined;
};

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

/**
 * The payload of the event, if requested.
 */
export type NinetySeven = {
  project: UserEventPayload97Project;
  purchasedAmount: number;
  prevPurchasedAmount: number;
};

export const SubjectType = {
  App: "app",
  User: "user",
} as const;
export type SubjectType = ClosedEnum<typeof SubjectType>;

/**
 * The payload of the event, if requested.
 */
export type NinetySix = {
  clientId?: string | undefined;
  clientUid?: string | undefined;
  clientName?: string | undefined;
  projectId?: string | undefined;
  projectName?: string | undefined;
  installationId?: string | undefined;
  subjectType?: SubjectType | undefined;
  fields?: Array<string> | undefined;
  environments?: Array<string> | undefined;
  triggerDestinationCount?: number | undefined;
  tokenCount?: number | undefined;
  acceptedTokenCount?: number | undefined;
  importedTokenCount?: number | undefined;
  tokensDeleted?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type NinetyFive = {
  bitbucketLogin: string;
  bitbucketAccountId: string;
};

/**
 * The payload of the event, if requested.
 */
export type NinetyFour = {
  bitbucketEmail: string;
  bitbucketLogin: string;
  bitbucketName?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type NinetyThree = {
  gitlabLogin: string;
  gitlabUserId: number;
};

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

/**
 * The payload of the event, if requested.
 */
export type NinetyOne = {
  githubLogin: string;
  host: string;
};

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

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

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

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

/**
 * The payload of the event, if requested.
 */
export type EightyEight = {
  team: UserEventPayload88Team;
  configuration: UserEventPayload88Configuration;
  newName: string;
};

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

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

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

/**
 * The payload of the event, if requested.
 */
export type EightySeven = {
  team: UserEventPayloadTeam;
  configuration: UserEventPayload87Configuration;
  project: UserEventPayload87Project;
};

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

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

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

/**
 * The payload of the event, if requested.
 */
export type EightySix = {
  team: PayloadTeam;
  configuration: UserEventPayloadConfiguration;
  project: UserEventPayload86Project;
  buildsEnabled?: boolean | undefined;
  passive?: boolean | undefined;
};

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

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

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

/**
 * The payload of the event, if requested.
 */
export type EightyFive = {
  team: UserEventPayload85Team;
  configuration: PayloadConfiguration;
  project: UserEventPayload85Project;
  buildsEnabled?: boolean | undefined;
};

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

/**
 * The payload of the event, if requested.
 */
export type EightyFour = {
  configuration: Configuration;
};

/**
 * A single document included in a bulk compliance download.
 */
export type Documents = {
  slug: string;
  documentId: string;
  title: string;
  fingerprint: string;
};

/**
 * The payload of the event, if requested.
 */
export type EightyThree = {
  count: number;
  documents: Array<Documents>;
};

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

export type PayloadPrevious = {
  enabled: boolean;
  autoAddReviewers: boolean;
};

export type Next = {
  enabled: boolean;
  autoAddReviewers: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type EightyOne = {
  gitOwnerName: string;
  gitRepositoryName: string;
  previous: PayloadPrevious;
  next: Next;
};

/**
 * The payload of the event, if requested.
 */
export type Eighty = {
  cn?: string | undefined;
  cns?: Array<string> | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type SeventyNine = {
  id: string;
  cn?: string | undefined;
  cns?: Array<string> | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type SeventyEight = {
  src: string;
  dst: string;
};

export type PayloadOldTeam = {
  name: string;
};

export type PayloadNewTeam = {
  name: string;
};

/**
 * The payload of the event, if requested.
 */
export type SeventySeven = {
  id: string;
  oldTeam?: PayloadOldTeam | undefined;
  newTeam?: PayloadNewTeam | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type SeventySix = {
  cn?: string | undefined;
  cns?: Array<string> | undefined;
  id?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type SeventyFive = {
  id: string;
  cns: Array<string>;
  custom: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type SeventyFour = {
  cn?: string | undefined;
  cns?: Array<string> | undefined;
  custom: boolean;
  id?: string | undefined;
};

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

/**
 * The payload of the event, if requested.
 */
export type SeventyThree = {
  project: UserEventPayload73Project;
  versionId: string;
};

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

/**
 * The payload of the event, if requested.
 */
export type SeventyTwo = {
  project: UserEventPayloadProject;
  bulkRedirectsLimit: number;
  prevBulkRedirectsLimit: number;
};

/**
 * The payload of the event, if requested.
 */
export type SeventyOne = {
  subscriptionId?: string | undefined;
  productAliases: Array<string>;
};

export const UserEventPayload70Action = {
  Mutate: "mutate",
} as const;
export type UserEventPayload70Action = ClosedEnum<
  typeof UserEventPayload70Action
>;

/**
 * The payload of the event, if requested.
 */
export type Seventy = {
  subscriptionId?: string | undefined;
  action: UserEventPayload70Action;
  data: { [k: string]: any };
};

export const UserEventPayload69Action = {
  ResumePlan: "resume_plan",
} as const;
export type UserEventPayload69Action = ClosedEnum<
  typeof UserEventPayload69Action
>;

export const PayloadPlanSlug = {
  V0Business: "v0_business",
  V0Teams: "v0_teams",
} as const;
export type PayloadPlanSlug = ClosedEnum<typeof PayloadPlanSlug>;

export type PayloadData = {
  planSlug: PayloadPlanSlug;
};

/**
 * The payload of the event, if requested.
 */
export type SixtyNine = {
  subscriptionId?: string | undefined;
  action: UserEventPayload69Action;
  data: PayloadData;
};

export const UserEventPayload68Action = {
  CancelPlan: "cancel_plan",
} as const;
export type UserEventPayload68Action = ClosedEnum<
  typeof UserEventPayload68Action
>;

export const PlanSlug = {
  V0Business: "v0_business",
  V0Teams: "v0_teams",
} as const;
export type PlanSlug = ClosedEnum<typeof PlanSlug>;

export const UserEventPayload68Reason = {
  NonPayment: "non-payment",
} as const;
export type UserEventPayload68Reason = ClosedEnum<
  typeof UserEventPayload68Reason
>;

export type UserEventPayloadData = {
  planSlug: PlanSlug;
  reason?: UserEventPayload68Reason | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type SixtyEight = {
  subscriptionId?: string | undefined;
  action: UserEventPayload68Action;
  data: UserEventPayloadData;
};

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

export const ChangedFields = {
  Address: "address",
  Email: "email",
  Language: "language",
  Name: "name",
  PurchaseOrder: "purchaseOrder",
  Tax: "tax",
} as const;
export type ChangedFields = ClosedEnum<typeof ChangedFields>;

/**
 * The payload of the event, if requested.
 */
export type SixtySix = {
  changedFields: Array<ChangedFields>;
};

/**
 * The payload of the event, if requested.
 */
export type SixtyFive = {
  paymentMethodId: string;
  brand?: string | undefined;
  last4?: string | undefined;
};

export const SettlementMethod = {
  CreditedPaid: "credited-paid",
  CreditedPaymentPending: "credited-payment-pending",
  RefundedPaid: "refunded-paid",
  RefundedPaymentPending: "refunded-payment-pending",
} as const;
export type SettlementMethod = ClosedEnum<typeof SettlementMethod>;

/**
 * The payload of the event, if requested.
 */
export type SixtyFour = {
  invoiceId: string;
  newInvoiceId: string;
  settlementMethod: SettlementMethod;
  amount: number;
};

/**
 * The payload of the event, if requested.
 */
export type SixtyThree = {
  invoiceId: string;
  amount: number;
  refundReason: string;
  lineItemCount: number;
};

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

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

/**
 * The payload of the event, if requested.
 */
export type Sixty = {
  projectId: string;
  prevAttackModeEnabled?: boolean | undefined;
  prevAttackModeActiveUntil?: number | null | undefined;
  attackModeEnabled: boolean;
  attackModeActiveUntil?: number | null | undefined;
};

/**
 * Note that not all historical events have this field.
 */
export type App = {
  /**
   * The App's ID.
   */
  id: string;
  /**
   * The App's name at the moment this even was published (it may have changed since then).
   */
  name: string;
};

/**
 * The payload of the event, if requested.
 */
export type FiftyNine = {
  /**
   * The App's name at the moment this even was published (it may have changed since then).
   */
  appName: string;
  /**
   * The App's ID. Note that not all historical events have this field.
   */
  appId?: string | undefined;
  /**
   * Note that not all historical events have this field.
   */
  app?: App | undefined;
  /**
   * UNIX timestamp in seconds. Tokens issued before this timestamp will be revoked. Note that not all historical events have this field.
   */
  issuedBefore?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FiftyEight = {
  appName: string;
  appId?: string | undefined;
  secretLastFourChars?: string | undefined;
};

export const UserEventPayload57Type = {
  List: "list",
} as const;
export type UserEventPayload57Type = ClosedEnum<typeof UserEventPayload57Type>;

export const UserEventPayload57ResourcesType = {
  String: "string",
} as const;
export type UserEventPayload57ResourcesType = ClosedEnum<
  typeof UserEventPayload57ResourcesType
>;

export type Items = {
  type: UserEventPayload57ResourcesType;
};

/**
 * Specific project IDs or all projects on the team (`['*']`).
 */
export type PayloadProjectIds = {
  type: UserEventPayload57Type;
  required: true;
  items: Items;
};

export type Resources = {
  /**
   * Specific project IDs or all projects on the team (`['*']`).
   */
  projectIds: PayloadProjectIds;
};

export const PayloadPermissions = {
  ManageSpeedInsights: "manage:speed-insights",
  ManageWebAnalytics: "manage:web-analytics",
  ReadWriteAiGatewayApiKey: "read-write:ai-gateway-api-key",
  ReadWriteAiGatewayGuardrails: "read-write:ai-gateway-guardrails",
  ReadWriteAiGatewayPrivateModels: "read-write:ai-gateway-private-models",
  ReadWriteAiGatewayRules: "read-write:ai-gateway-rules",
  ReadWriteAiGatewayVirtualModelConfigs:
    "read-write:ai-gateway-virtual-model-configs",
  ReadWriteAlerts: "read-write:alerts",
  ReadWriteAutomations: "read-write:automations",
  ReadWriteBilling: "read-write:billing",
  ReadWriteBlob: "read-write:blob",
  ReadWriteConnect: "read-write:connect",
  ReadWriteDeployment: "read-write:deployment",
  ReadWriteDomain: "read-write:domain",
  ReadWriteDomainRegistrar: "read-write:domain-registrar",
  ReadWriteDrains: "read-write:drains",
  ReadWriteEdgeCache: "read-write:edge-cache",
  ReadWriteEdgeConfig: "read-write:edge-config",
  ReadWriteFirewall: "read-write:firewall",
  ReadWriteIntegrationConfiguration: "read-write:integration-configuration",
  ReadWriteIntegrationResource: "read-write:integration-resource",
  ReadWriteKms: "read-write:kms",
  ReadWriteProject: "read-write:project",
  ReadWriteProjectEnvVars: "read-write:project-env-vars",
  ReadWriteProjectEnvVarsNonProduction:
    "read-write:project-env-vars-non-production",
  ReadWriteProjectEnvVarsProduction: "read-write:project-env-vars-production",
  ReadWriteProjectFlagsNonProduction: "read-write:project-flags-non-production",
  ReadWriteProjectFlagsProduction: "read-write:project-flags-production",
  ReadWriteProjectProtectionBypass: "read-write:project-protection-bypass",
  ReadWriteRemoteCache: "read-write:remote-cache",
  ReadWriteSandbox: "read-write:sandbox",
  ReadWriteTeamMembers: "read-write:team-members",
  ReadWriteVcr: "read-write:vcr",
  ReadAccessGroup: "read:access-group",
  ReadAiGatewayGuardrails: "read:ai-gateway-guardrails",
  ReadAiGatewayPrivateModels: "read:ai-gateway-private-models",
  ReadAiGatewayRules: "read:ai-gateway-rules",
  ReadAiGatewayVirtualModelConfigs: "read:ai-gateway-virtual-model-configs",
  ReadAlerts: "read:alerts",
  ReadAutomations: "read:automations",
  ReadBilling: "read:billing",
  ReadConnect: "read:connect",
  ReadDeployment: "read:deployment",
  ReadDomain: "read:domain",
  ReadEvent: "read:event",
  ReadFirewall: "read:firewall",
  ReadIntegrationConfiguration: "read:integration-configuration",
  ReadIntegrationResource: "read:integration-resource",
  ReadKms: "read:kms",
  ReadMonitoring: "read:monitoring",
  ReadProject: "read:project",
  ReadProjectEnvVarsNonProduction: "read:project-env-vars-non-production",
  ReadProjectEnvVarsProduction: "read:project-env-vars-production",
  ReadProjectFlags: "read:project-flags",
  ReadRemoteCache: "read:remote-cache",
  ReadSandbox: "read:sandbox",
  ReadSpeedInsights: "read:speed-insights",
  ReadTeam: "read:team",
  ReadVcr: "read:vcr",
  ReadWebAnalytics: "read:web-analytics",
  ReadWebhooks: "read:webhooks",
  UseAiGateway: "use:ai-gateway",
} as const;
export type PayloadPermissions = ClosedEnum<typeof PayloadPermissions>;

/**
 * The payload of the event, if requested.
 */
export type FiftySeven = {
  appName: string;
  appId?: string | undefined;
  resources?: Resources | undefined;
  permissions?: Array<PayloadPermissions> | undefined;
};

export const UserEventPayload56Type = {
  List: "list",
} as const;
export type UserEventPayload56Type = ClosedEnum<typeof UserEventPayload56Type>;

export const UserEventPayload56BeforeType = {
  String: "string",
} as const;
export type UserEventPayload56BeforeType = ClosedEnum<
  typeof UserEventPayload56BeforeType
>;

export type UserEventPayloadItems = {
  type: UserEventPayload56BeforeType;
};

/**
 * Specific project IDs or all projects on the team (`['*']`).
 */
export type UserEventPayloadProjectIds = {
  type: UserEventPayload56Type;
  required: true;
  items: UserEventPayloadItems;
};

export type UserEventPayloadResources = {
  /**
   * Specific project IDs or all projects on the team (`['*']`).
   */
  projectIds: UserEventPayloadProjectIds;
};

export const UserEventPayload56Permissions = {
  ManageSpeedInsights: "manage:speed-insights",
  ManageWebAnalytics: "manage:web-analytics",
  ReadWriteAiGatewayApiKey: "read-write:ai-gateway-api-key",
  ReadWriteAiGatewayGuardrails: "read-write:ai-gateway-guardrails",
  ReadWriteAiGatewayPrivateModels: "read-write:ai-gateway-private-models",
  ReadWriteAiGatewayRules: "read-write:ai-gateway-rules",
  ReadWriteAiGatewayVirtualModelConfigs:
    "read-write:ai-gateway-virtual-model-configs",
  ReadWriteAlerts: "read-write:alerts",
  ReadWriteAutomations: "read-write:automations",
  ReadWriteBilling: "read-write:billing",
  ReadWriteBlob: "read-write:blob",
  ReadWriteConnect: "read-write:connect",
  ReadWriteDeployment: "read-write:deployment",
  ReadWriteDomain: "read-write:domain",
  ReadWriteDomainRegistrar: "read-write:domain-registrar",
  ReadWriteDrains: "read-write:drains",
  ReadWriteEdgeCache: "read-write:edge-cache",
  ReadWriteEdgeConfig: "read-write:edge-config",
  ReadWriteFirewall: "read-write:firewall",
  ReadWriteIntegrationConfiguration: "read-write:integration-configuration",
  ReadWriteIntegrationResource: "read-write:integration-resource",
  ReadWriteKms: "read-write:kms",
  ReadWriteProject: "read-write:project",
  ReadWriteProjectEnvVars: "read-write:project-env-vars",
  ReadWriteProjectEnvVarsNonProduction:
    "read-write:project-env-vars-non-production",
  ReadWriteProjectEnvVarsProduction: "read-write:project-env-vars-production",
  ReadWriteProjectFlagsNonProduction: "read-write:project-flags-non-production",
  ReadWriteProjectFlagsProduction: "read-write:project-flags-production",
  ReadWriteProjectProtectionBypass: "read-write:project-protection-bypass",
  ReadWriteRemoteCache: "read-write:remote-cache",
  ReadWriteSandbox: "read-write:sandbox",
  ReadWriteTeamMembers: "read-write:team-members",
  ReadWriteVcr: "read-write:vcr",
  ReadAccessGroup: "read:access-group",
  ReadAiGatewayGuardrails: "read:ai-gateway-guardrails",
  ReadAiGatewayPrivateModels: "read:ai-gateway-private-models",
  ReadAiGatewayRules: "read:ai-gateway-rules",
  ReadAiGatewayVirtualModelConfigs: "read:ai-gateway-virtual-model-configs",
  ReadAlerts: "read:alerts",
  ReadAutomations: "read:automations",
  ReadBilling: "read:billing",
  ReadConnect: "read:connect",
  ReadDeployment: "read:deployment",
  ReadDomain: "read:domain",
  ReadEvent: "read:event",
  ReadFirewall: "read:firewall",
  ReadIntegrationConfiguration: "read:integration-configuration",
  ReadIntegrationResource: "read:integration-resource",
  ReadKms: "read:kms",
  ReadMonitoring: "read:monitoring",
  ReadProject: "read:project",
  ReadProjectEnvVarsNonProduction: "read:project-env-vars-non-production",
  ReadProjectEnvVarsProduction: "read:project-env-vars-production",
  ReadProjectFlags: "read:project-flags",
  ReadRemoteCache: "read:remote-cache",
  ReadSandbox: "read:sandbox",
  ReadSpeedInsights: "read:speed-insights",
  ReadTeam: "read:team",
  ReadVcr: "read:vcr",
  ReadWebAnalytics: "read:web-analytics",
  ReadWebhooks: "read:webhooks",
  UseAiGateway: "use:ai-gateway",
} as const;
export type UserEventPayload56Permissions = ClosedEnum<
  typeof UserEventPayload56Permissions
>;

export type Before = {
  resources?: UserEventPayloadResources | undefined;
  permissions?: Array<UserEventPayload56Permissions> | undefined;
};

export const UserEventPayload56AfterType = {
  List: "list",
} as const;
export type UserEventPayload56AfterType = ClosedEnum<
  typeof UserEventPayload56AfterType
>;

export const UserEventPayload56AfterResourcesType = {
  String: "string",
} as const;
export type UserEventPayload56AfterResourcesType = ClosedEnum<
  typeof UserEventPayload56AfterResourcesType
>;

export type PayloadItems = {
  type: UserEventPayload56AfterResourcesType;
};

/**
 * Specific project IDs or all projects on the team (`['*']`).
 */
export type UserEventPayload56ProjectIds = {
  type: UserEventPayload56AfterType;
  required: true;
  items: PayloadItems;
};

export type PayloadResources = {
  /**
   * Specific project IDs or all projects on the team (`['*']`).
   */
  projectIds: UserEventPayload56ProjectIds;
};

export const UserEventPayloadPermissions = {
  ManageSpeedInsights: "manage:speed-insights",
  ManageWebAnalytics: "manage:web-analytics",
  ReadWriteAiGatewayApiKey: "read-write:ai-gateway-api-key",
  ReadWriteAiGatewayGuardrails: "read-write:ai-gateway-guardrails",
  ReadWriteAiGatewayPrivateModels: "read-write:ai-gateway-private-models",
  ReadWriteAiGatewayRules: "read-write:ai-gateway-rules",
  ReadWriteAiGatewayVirtualModelConfigs:
    "read-write:ai-gateway-virtual-model-configs",
  ReadWriteAlerts: "read-write:alerts",
  ReadWriteAutomations: "read-write:automations",
  ReadWriteBilling: "read-write:billing",
  ReadWriteBlob: "read-write:blob",
  ReadWriteConnect: "read-write:connect",
  ReadWriteDeployment: "read-write:deployment",
  ReadWriteDomain: "read-write:domain",
  ReadWriteDomainRegistrar: "read-write:domain-registrar",
  ReadWriteDrains: "read-write:drains",
  ReadWriteEdgeCache: "read-write:edge-cache",
  ReadWriteEdgeConfig: "read-write:edge-config",
  ReadWriteFirewall: "read-write:firewall",
  ReadWriteIntegrationConfiguration: "read-write:integration-configuration",
  ReadWriteIntegrationResource: "read-write:integration-resource",
  ReadWriteKms: "read-write:kms",
  ReadWriteProject: "read-write:project",
  ReadWriteProjectEnvVars: "read-write:project-env-vars",
  ReadWriteProjectEnvVarsNonProduction:
    "read-write:project-env-vars-non-production",
  ReadWriteProjectEnvVarsProduction: "read-write:project-env-vars-production",
  ReadWriteProjectFlagsNonProduction: "read-write:project-flags-non-production",
  ReadWriteProjectFlagsProduction: "read-write:project-flags-production",
  ReadWriteProjectProtectionBypass: "read-write:project-protection-bypass",
  ReadWriteRemoteCache: "read-write:remote-cache",
  ReadWriteSandbox: "read-write:sandbox",
  ReadWriteTeamMembers: "read-write:team-members",
  ReadWriteVcr: "read-write:vcr",
  ReadAccessGroup: "read:access-group",
  ReadAiGatewayGuardrails: "read:ai-gateway-guardrails",
  ReadAiGatewayPrivateModels: "read:ai-gateway-private-models",
  ReadAiGatewayRules: "read:ai-gateway-rules",
  ReadAiGatewayVirtualModelConfigs: "read:ai-gateway-virtual-model-configs",
  ReadAlerts: "read:alerts",
  ReadAutomations: "read:automations",
  ReadBilling: "read:billing",
  ReadConnect: "read:connect",
  ReadDeployment: "read:deployment",
  ReadDomain: "read:domain",
  ReadEvent: "read:event",
  ReadFirewall: "read:firewall",
  ReadIntegrationConfiguration: "read:integration-configuration",
  ReadIntegrationResource: "read:integration-resource",
  ReadKms: "read:kms",
  ReadMonitoring: "read:monitoring",
  ReadProject: "read:project",
  ReadProjectEnvVarsNonProduction: "read:project-env-vars-non-production",
  ReadProjectEnvVarsProduction: "read:project-env-vars-production",
  ReadProjectFlags: "read:project-flags",
  ReadRemoteCache: "read:remote-cache",
  ReadSandbox: "read:sandbox",
  ReadSpeedInsights: "read:speed-insights",
  ReadTeam: "read:team",
  ReadVcr: "read:vcr",
  ReadWebAnalytics: "read:web-analytics",
  ReadWebhooks: "read:webhooks",
  UseAiGateway: "use:ai-gateway",
} as const;
export type UserEventPayloadPermissions = ClosedEnum<
  typeof UserEventPayloadPermissions
>;

export type After = {
  resources?: PayloadResources | undefined;
  permissions?: Array<UserEventPayloadPermissions> | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FiftySix = {
  appName: string;
  appId?: string | undefined;
  installationId?: string | undefined;
  before?: Before | undefined;
  after?: After | undefined;
};

export const NextScopes = {
  Email: "email",
  OfflineAccess: "offline_access",
  Openid: "openid",
  Profile: "profile",
} as const;
export type NextScopes = ClosedEnum<typeof NextScopes>;

export const NextPermissions = {
  Wildcard: "*",
  ManageSpeedInsights: "manage:speed-insights",
  ManageWebAnalytics: "manage:web-analytics",
  ReadWriteAiGatewayApiKey: "read-write:ai-gateway-api-key",
  ReadWriteAiGatewayGuardrails: "read-write:ai-gateway-guardrails",
  ReadWriteAiGatewayPrivateModels: "read-write:ai-gateway-private-models",
  ReadWriteAiGatewayRules: "read-write:ai-gateway-rules",
  ReadWriteAiGatewayVirtualModelConfigs:
    "read-write:ai-gateway-virtual-model-configs",
  ReadWriteAlerts: "read-write:alerts",
  ReadWriteAutomations: "read-write:automations",
  ReadWriteBilling: "read-write:billing",
  ReadWriteBlob: "read-write:blob",
  ReadWriteConnect: "read-write:connect",
  ReadWriteDeployment: "read-write:deployment",
  ReadWriteDomain: "read-write:domain",
  ReadWriteDomainRegistrar: "read-write:domain-registrar",
  ReadWriteDrains: "read-write:drains",
  ReadWriteEdgeCache: "read-write:edge-cache",
  ReadWriteEdgeConfig: "read-write:edge-config",
  ReadWriteFirewall: "read-write:firewall",
  ReadWriteIntegrationConfiguration: "read-write:integration-configuration",
  ReadWriteIntegrationResource: "read-write:integration-resource",
  ReadWriteKms: "read-write:kms",
  ReadWriteProject: "read-write:project",
  ReadWriteProjectEnvVars: "read-write:project-env-vars",
  ReadWriteProjectEnvVarsNonProduction:
    "read-write:project-env-vars-non-production",
  ReadWriteProjectEnvVarsProduction: "read-write:project-env-vars-production",
  ReadWriteProjectFlagsNonProduction: "read-write:project-flags-non-production",
  ReadWriteProjectFlagsProduction: "read-write:project-flags-production",
  ReadWriteProjectProtectionBypass: "read-write:project-protection-bypass",
  ReadWriteRemoteCache: "read-write:remote-cache",
  ReadWriteSandbox: "read-write:sandbox",
  ReadWriteTeamMembers: "read-write:team-members",
  ReadWriteVcr: "read-write:vcr",
  ReadAccessGroup: "read:access-group",
  ReadAiGatewayGuardrails: "read:ai-gateway-guardrails",
  ReadAiGatewayPrivateModels: "read:ai-gateway-private-models",
  ReadAiGatewayRules: "read:ai-gateway-rules",
  ReadAiGatewayVirtualModelConfigs: "read:ai-gateway-virtual-model-configs",
  ReadAlerts: "read:alerts",
  ReadAutomations: "read:automations",
  ReadBilling: "read:billing",
  ReadConnect: "read:connect",
  ReadDeployment: "read:deployment",
  ReadDomain: "read:domain",
  ReadEvent: "read:event",
  ReadFirewall: "read:firewall",
  ReadIntegrationConfiguration: "read:integration-configuration",
  ReadIntegrationResource: "read:integration-resource",
  ReadKms: "read:kms",
  ReadMonitoring: "read:monitoring",
  ReadProject: "read:project",
  ReadProjectEnvVarsNonProduction: "read:project-env-vars-non-production",
  ReadProjectEnvVarsProduction: "read:project-env-vars-production",
  ReadProjectFlags: "read:project-flags",
  ReadRemoteCache: "read:remote-cache",
  ReadSandbox: "read:sandbox",
  ReadSpeedInsights: "read:speed-insights",
  ReadTeam: "read:team",
  ReadUser: "read:user",
  ReadVcr: "read:vcr",
  ReadWebAnalytics: "read:web-analytics",
  ReadWebhooks: "read:webhooks",
  UseAiGateway: "use:ai-gateway",
} as const;
export type NextPermissions = ClosedEnum<typeof NextPermissions>;

/**
 * The payload of the event, if requested.
 */
export type FiftyFive = {
  appName: string;
  appId?: string | undefined;
  nextScopes: Array<NextScopes>;
  nextPermissions?: Array<NextPermissions> | undefined;
};

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

export const PayloadScopes = {
  Email: "email",
  OfflineAccess: "offline_access",
  Openid: "openid",
  Profile: "profile",
} as const;
export type PayloadScopes = ClosedEnum<typeof PayloadScopes>;

export const Permissions = {
  Wildcard: "*",
  ManageSpeedInsights: "manage:speed-insights",
  ManageWebAnalytics: "manage:web-analytics",
  ReadWriteAiGatewayApiKey: "read-write:ai-gateway-api-key",
  ReadWriteAiGatewayGuardrails: "read-write:ai-gateway-guardrails",
  ReadWriteAiGatewayPrivateModels: "read-write:ai-gateway-private-models",
  ReadWriteAiGatewayRules: "read-write:ai-gateway-rules",
  ReadWriteAiGatewayVirtualModelConfigs:
    "read-write:ai-gateway-virtual-model-configs",
  ReadWriteAlerts: "read-write:alerts",
  ReadWriteAutomations: "read-write:automations",
  ReadWriteBilling: "read-write:billing",
  ReadWriteBlob: "read-write:blob",
  ReadWriteConnect: "read-write:connect",
  ReadWriteDeployment: "read-write:deployment",
  ReadWriteDomain: "read-write:domain",
  ReadWriteDomainRegistrar: "read-write:domain-registrar",
  ReadWriteDrains: "read-write:drains",
  ReadWriteEdgeCache: "read-write:edge-cache",
  ReadWriteEdgeConfig: "read-write:edge-config",
  ReadWriteFirewall: "read-write:firewall",
  ReadWriteIntegrationConfiguration: "read-write:integration-configuration",
  ReadWriteIntegrationResource: "read-write:integration-resource",
  ReadWriteKms: "read-write:kms",
  ReadWriteProject: "read-write:project",
  ReadWriteProjectEnvVars: "read-write:project-env-vars",
  ReadWriteProjectEnvVarsNonProduction:
    "read-write:project-env-vars-non-production",
  ReadWriteProjectEnvVarsProduction: "read-write:project-env-vars-production",
  ReadWriteProjectFlagsNonProduction: "read-write:project-flags-non-production",
  ReadWriteProjectFlagsProduction: "read-write:project-flags-production",
  ReadWriteProjectProtectionBypass: "read-write:project-protection-bypass",
  ReadWriteRemoteCache: "read-write:remote-cache",
  ReadWriteSandbox: "read-write:sandbox",
  ReadWriteTeamMembers: "read-write:team-members",
  ReadWriteVcr: "read-write:vcr",
  ReadAccessGroup: "read:access-group",
  ReadAiGatewayGuardrails: "read:ai-gateway-guardrails",
  ReadAiGatewayPrivateModels: "read:ai-gateway-private-models",
  ReadAiGatewayRules: "read:ai-gateway-rules",
  ReadAiGatewayVirtualModelConfigs: "read:ai-gateway-virtual-model-configs",
  ReadAlerts: "read:alerts",
  ReadAutomations: "read:automations",
  ReadBilling: "read:billing",
  ReadConnect: "read:connect",
  ReadDeployment: "read:deployment",
  ReadDomain: "read:domain",
  ReadEvent: "read:event",
  ReadFirewall: "read:firewall",
  ReadIntegrationConfiguration: "read:integration-configuration",
  ReadIntegrationResource: "read:integration-resource",
  ReadKms: "read:kms",
  ReadMonitoring: "read:monitoring",
  ReadProject: "read:project",
  ReadProjectEnvVarsNonProduction: "read:project-env-vars-non-production",
  ReadProjectEnvVarsProduction: "read:project-env-vars-production",
  ReadProjectFlags: "read:project-flags",
  ReadRemoteCache: "read:remote-cache",
  ReadSandbox: "read:sandbox",
  ReadSpeedInsights: "read:speed-insights",
  ReadTeam: "read:team",
  ReadUser: "read:user",
  ReadVcr: "read:vcr",
  ReadWebAnalytics: "read:web-analytics",
  ReadWebhooks: "read:webhooks",
  UseAiGateway: "use:ai-gateway",
} as const;
export type Permissions = ClosedEnum<typeof Permissions>;

/**
 * The payload of the event, if requested.
 */
export type FiftyThree = {
  appName: string;
  appId?: string | undefined;
  scopes: Array<PayloadScopes>;
  permissions?: Array<Permissions> | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FiftyTwo = {
  alias?: string | undefined;
  aliasId?: string | undefined;
  userId?: string | undefined;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FiftyOne = {
  alias?: string | undefined;
  userId?: string | undefined;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type Fifty = {
  alias: string;
  deploymentUrl: string;
};

export const UserEventPayload49Action = {
  Created: "created",
  Removed: "removed",
} as const;
export type UserEventPayload49Action = ClosedEnum<
  typeof UserEventPayload49Action
>;

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

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

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

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

/**
 * The payload of the event, if requested.
 */
export type FortyFive = {
  alias?: string | undefined;
  email?: string | undefined;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FortyFour = {
  name?: string | undefined;
  alias: string;
  aliasId: string;
  deploymentId: string | null;
};

export type OldTeam = {
  name: string;
};

export type NewTeam = {
  name: string;
};

/**
 * The payload of the event, if requested.
 */
export type FortyThree = {
  name?: string | undefined;
  alias: string;
  oldTeam?: OldTeam | undefined;
  newTeam?: NewTeam | undefined;
};

/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export const PayloadAllowListedReadyStateReasonInternal = {
  EarlyIgnoreStep: "EARLY_IGNORE_STEP",
  IgnoreStep: "IGNORE_STEP",
  NamespacePruned: "NAMESPACE_PRUNED",
  UnaffectedProject: "UNAFFECTED_PROJECT",
  UnverifiedCommit: "UNVERIFIED_COMMIT",
} as const;
/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export type PayloadAllowListedReadyStateReasonInternal = ClosedEnum<
  typeof PayloadAllowListedReadyStateReasonInternal
>;

export type PayloadDeployment = {
  id: string;
  name: string;
  url: string;
  meta: { [k: string]: string };
  readyState?: string | undefined;
  /**
   * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
   */
  allowListedReadyStateReasonInternal?:
    | PayloadAllowListedReadyStateReasonInternal
    | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FortyTwo = {
  projectId: string;
  aliasCount: number;
  deployment?: PayloadDeployment | null | undefined;
};

/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export const AllowListedReadyStateReasonInternal = {
  EarlyIgnoreStep: "EARLY_IGNORE_STEP",
  IgnoreStep: "IGNORE_STEP",
  NamespacePruned: "NAMESPACE_PRUNED",
  UnaffectedProject: "UNAFFECTED_PROJECT",
  UnverifiedCommit: "UNVERIFIED_COMMIT",
} as const;
/**
 * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
 */
export type AllowListedReadyStateReasonInternal = ClosedEnum<
  typeof AllowListedReadyStateReasonInternal
>;

export type Deployment = {
  id: string;
  name: string;
  url: string;
  meta: { [k: string]: string };
  readyState?: string | undefined;
  /**
   * A narrowed subset of the deployment's `readyStateReasonInternal` — only values in the public allowlist are permitted here. Callers should run their raw reason through `toAllowListedReadyStateReasonInternal` from `@api/events` before assigning. This keeps abuse / moderation / admin reasons out of the public activity log.
   */
  allowListedReadyStateReasonInternal?:
    | AllowListedReadyStateReasonInternal
    | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type FortyOne = {
  alias?: string | undefined;
  deployment?: Deployment | null | undefined;
  ruleCount?: number | undefined;
  deploymentUrl?: string | undefined;
  aliasId?: string | undefined;
  deploymentId?: string | null | undefined;
  oldDeploymentId?: string | null | undefined;
  redirect?: string | undefined;
  redirectStatusCode?: number | null | undefined;
  target?: string | null | undefined;
  system?: boolean | undefined;
  aliasUpdatedAt?: number | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type Forty = {
  price?: number | undefined;
  currency?: string | undefined;
};

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

export type PayloadUser = {
  id: string;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type ThirtyNine = {
  accessGroup: UserEventPayload39AccessGroup;
  user: PayloadUser;
  directoryType?: string | undefined;
};

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

/**
 * The payload of the event, if requested.
 */
export type ThirtyEight = {
  accessGroup: UserEventPayload38AccessGroup;
  name?: string | undefined;
  previousName?: string | undefined;
  teamRoles?: Array<string> | undefined;
  previousTeamRoles?: Array<string> | undefined;
  teamPermissions?: Array<string> | undefined;
  previousTeamPermissions?: Array<string> | undefined;
  entitlementsAdded?: Array<string> | undefined;
  entitlementsRemoved?: Array<string> | undefined;
};

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

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

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

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

/**
 * The payload of the event, if requested.
 */
export type ThirtySeven = {
  accessGroup: UserEventPayloadAccessGroup;
  project: PayloadProject;
  nextRole?: NextRole | null | undefined;
  previousRole?: PreviousRole | undefined;
};

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

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

/** @internal */
export const Job1$inboundSchema: z.ZodType<Job1, z.ZodTypeDef, unknown> = z
  .object({
    type: types.literal("bitbucket-push"),
    authorized: types.optional(types.boolean()),
    authorizedBy: types.optional(types.string()),
    jobProjectIds: types.optional(z.array(types.string())),
    jobPairs: types.optional(z.array(z.array(types.string()))),
    skippedJobPairs: types.optional(z.array(z.array(types.string()))),
    gitHashtagVercel: types.optional(z.array(GitHashtagVercel$inboundSchema)),
    connectedProjectCount: types.optional(types.number()),
    prIdOrZero: types.optional(types.number()),
    gitComments: types.optional(GitComments$inboundSchema),
    isManualGitDeploy: types.optional(types.boolean()),
    commitVerification: types.optional(CommitVerification$inboundSchema),
    nsnbSideEffect: types.optional(NsnbSideEffect$inboundSchema),
    createdAt: types.optional(types.number()),
    deploymentId: types.optional(types.string()),
    deployHook: types.optional(JobDeployHook$inboundSchema),
    eventful: types.optional(types.boolean()),
    forceNew: types.optional(types.boolean()),
    headInfo: HeadInfo$inboundSchema,
    linkedProjectId: types.optional(types.string()),
    name: types.string(),
    owner: types.string(),
    prId: types.optional(types.number()),
    projectId: types.optional(types.string()),
    customEnvId: z.nullable(types.string()).optional(),
    ref: types.string(),
    repoPushedAt: z.nullable(types.number()).optional(),
    repoUuid: types.string(),
    sha: types.string(),
    silent: types.optional(types.boolean()),
    slug: types.string(),
    target: z.nullable(types.string()).optional(),
    url: types.optional(types.string()),
    withCache: types.optional(types.boolean()),
    workspaceUuid: types.string(),
    provider: JobProvider$inboundSchema,
  });

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

/** @internal */
export const PayloadJob$inboundSchema: z.ZodType<
  PayloadJob,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => Job1$inboundSchema),
  Job2$inboundSchema,
  Job3$inboundSchema,
  Job4$inboundSchema,
  Job5$inboundSchema,
  Job6$inboundSchema,
  Job7$inboundSchema,
  Job8$inboundSchema,
  Job9$inboundSchema,
  Job10$inboundSchema,
]);

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

/** @internal */
export const OneHundredAndSix$inboundSchema: z.ZodType<
  OneHundredAndSix,
  z.ZodTypeDef,
  unknown
> = z.object({
  job: z.union([
    z.lazy(() => Job1$inboundSchema),
    Job2$inboundSchema,
    Job3$inboundSchema,
    Job4$inboundSchema,
    Job5$inboundSchema,
    Job6$inboundSchema,
    Job7$inboundSchema,
    Job8$inboundSchema,
    Job9$inboundSchema,
    Job10$inboundSchema,
  ]),
});

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

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

/** @internal */
export const UserEventPayloadDeployment$inboundSchema: z.ZodType<
  UserEventPayloadDeployment,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  name: types.string(),
  url: types.string(),
  meta: z.record(types.string()),
  readyState: types.optional(types.string()),
  allowListedReadyStateReasonInternal: types.optional(
    UserEventPayloadAllowListedReadyStateReasonInternal$inboundSchema,
  ),
});

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

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

/** @internal */
export const OneHundredAndFive$inboundSchema: z.ZodType<
  OneHundredAndFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  name: types.optional(types.string()),
  alias: types.optional(z.array(types.string())),
  target: z.nullable(types.string()).optional(),
  deployment: z.nullable(z.lazy(() => UserEventPayloadDeployment$inboundSchema))
    .optional(),
  url: types.string(),
  forced: types.optional(types.boolean()),
  gitCredentialSource: types.optional(GitCredentialSource$inboundSchema),
  deploymentId: types.optional(types.string()),
  plan: types.optional(types.string()),
  project: types.optional(types.string()),
  projectId: types.optional(types.string()),
  regions: types.optional(z.array(types.string())),
  type: types.optional(types.string()),
});

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

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

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

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

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

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

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

/** @internal */
export const Job$inboundSchema: z.ZodType<Job, z.ZodTypeDef, unknown> = z
  .object({
    deployHook: z.lazy(() => DeployHook$inboundSchema),
    state: types.string(),
  });

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const NinetyEight$inboundSchema: z.ZodType<
  NinetyEight,
  z.ZodTypeDef,
  unknown
> = collectExtraKeys$(
  z.object({
    metricName: types.string(),
  }).catchall(z.any()),
  "additionalProperties",
  true,
);

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

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

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

/** @internal */
export const NinetySeven$inboundSchema: z.ZodType<
  NinetySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayload97Project$inboundSchema),
  purchasedAmount: types.number(),
  prevPurchasedAmount: types.number(),
});

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

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

/** @internal */
export const NinetySix$inboundSchema: z.ZodType<
  NinetySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  clientId: types.optional(types.string()),
  clientUid: types.optional(types.string()),
  clientName: types.optional(types.string()),
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  installationId: types.optional(types.string()),
  subjectType: types.optional(SubjectType$inboundSchema),
  fields: types.optional(z.array(types.string())),
  environments: types.optional(z.array(types.string())),
  triggerDestinationCount: types.optional(types.number()),
  tokenCount: types.optional(types.number()),
  acceptedTokenCount: types.optional(types.number()),
  importedTokenCount: types.optional(types.number()),
  tokensDeleted: types.optional(types.number()),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const EightyEight$inboundSchema: z.ZodType<
  EightyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => UserEventPayload88Team$inboundSchema),
  configuration: z.lazy(() => UserEventPayload88Configuration$inboundSchema),
  newName: types.string(),
});

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

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

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

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

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

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

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

/** @internal */
export const EightySeven$inboundSchema: z.ZodType<
  EightySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => UserEventPayloadTeam$inboundSchema),
  configuration: z.lazy(() => UserEventPayload87Configuration$inboundSchema),
  project: z.lazy(() => UserEventPayload87Project$inboundSchema),
});

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

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

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

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

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

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

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

/** @internal */
export const EightySix$inboundSchema: z.ZodType<
  EightySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => PayloadTeam$inboundSchema),
  configuration: z.lazy(() => UserEventPayloadConfiguration$inboundSchema),
  project: z.lazy(() => UserEventPayload86Project$inboundSchema),
  buildsEnabled: types.optional(types.boolean()),
  passive: types.optional(types.boolean()),
});

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

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

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

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

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

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

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

/** @internal */
export const EightyFive$inboundSchema: z.ZodType<
  EightyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => UserEventPayload85Team$inboundSchema),
  configuration: z.lazy(() => PayloadConfiguration$inboundSchema),
  project: z.lazy(() => UserEventPayload85Project$inboundSchema),
  buildsEnabled: types.optional(types.boolean()),
});

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

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

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

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

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

/** @internal */
export const Documents$inboundSchema: z.ZodType<
  Documents,
  z.ZodTypeDef,
  unknown
> = z.object({
  slug: types.string(),
  documentId: types.string(),
  title: types.string(),
  fingerprint: types.string(),
});

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

/** @internal */
export const EightyThree$inboundSchema: z.ZodType<
  EightyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  count: types.number(),
  documents: z.array(z.lazy(() => Documents$inboundSchema)),
});

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

/** @internal */
export const EightyTwo$inboundSchema: z.ZodType<
  EightyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  slug: types.string(),
  documentId: types.string(),
  title: types.string(),
  fingerprint: types.string(),
});

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

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

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

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

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

/** @internal */
export const EightyOne$inboundSchema: z.ZodType<
  EightyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  gitOwnerName: types.string(),
  gitRepositoryName: types.string(),
  previous: z.lazy(() => PayloadPrevious$inboundSchema),
  next: z.lazy(() => Next$inboundSchema),
});

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const SeventySeven$inboundSchema: z.ZodType<
  SeventySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  oldTeam: types.optional(z.lazy(() => PayloadOldTeam$inboundSchema)),
  newTeam: types.optional(z.lazy(() => PayloadNewTeam$inboundSchema)),
});

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

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

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

/** @internal */
export const SeventyFive$inboundSchema: z.ZodType<
  SeventyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  cns: z.array(types.string()),
  custom: types.boolean(),
});

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

/** @internal */
export const SeventyFour$inboundSchema: z.ZodType<
  SeventyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  cn: types.optional(types.string()),
  cns: types.optional(z.array(types.string())),
  custom: types.boolean(),
  id: types.optional(types.string()),
});

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

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

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

/** @internal */
export const SeventyThree$inboundSchema: z.ZodType<
  SeventyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayload73Project$inboundSchema),
  versionId: types.string(),
});

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

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

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

/** @internal */
export const SeventyTwo$inboundSchema: z.ZodType<
  SeventyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  project: z.lazy(() => UserEventPayloadProject$inboundSchema),
  bulkRedirectsLimit: types.number(),
  prevBulkRedirectsLimit: types.number(),
});

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

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

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

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

/** @internal */
export const Seventy$inboundSchema: z.ZodType<Seventy, z.ZodTypeDef, unknown> =
  z.object({
    subscriptionId: types.optional(types.string()),
    action: UserEventPayload70Action$inboundSchema,
    data: z.record(z.any()),
  });

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

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

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

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

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

/** @internal */
export const SixtyNine$inboundSchema: z.ZodType<
  SixtyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  subscriptionId: types.optional(types.string()),
  action: UserEventPayload69Action$inboundSchema,
  data: z.lazy(() => PayloadData$inboundSchema),
});

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

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

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

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

/** @internal */
export const UserEventPayloadData$inboundSchema: z.ZodType<
  UserEventPayloadData,
  z.ZodTypeDef,
  unknown
> = z.object({
  planSlug: PlanSlug$inboundSchema,
  reason: types.optional(UserEventPayload68Reason$inboundSchema),
});

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

/** @internal */
export const SixtyEight$inboundSchema: z.ZodType<
  SixtyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  subscriptionId: types.optional(types.string()),
  action: UserEventPayload68Action$inboundSchema,
  data: z.lazy(() => UserEventPayloadData$inboundSchema),
});

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

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

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

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

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

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

/** @internal */
export const SixtyFive$inboundSchema: z.ZodType<
  SixtyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  paymentMethodId: types.string(),
  brand: types.optional(types.string()),
  last4: types.optional(types.string()),
});

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

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

/** @internal */
export const SixtyFour$inboundSchema: z.ZodType<
  SixtyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  invoiceId: types.string(),
  newInvoiceId: types.string(),
  settlementMethod: SettlementMethod$inboundSchema,
  amount: types.number(),
});

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

/** @internal */
export const SixtyThree$inboundSchema: z.ZodType<
  SixtyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  invoiceId: types.string(),
  amount: types.number(),
  refundReason: types.string(),
  lineItemCount: types.number(),
});

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

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

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

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

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

/** @internal */
export const Sixty$inboundSchema: z.ZodType<Sixty, z.ZodTypeDef, unknown> = z
  .object({
    projectId: types.string(),
    prevAttackModeEnabled: types.optional(types.boolean()),
    prevAttackModeActiveUntil: z.nullable(types.number()).optional(),
    attackModeEnabled: types.boolean(),
    attackModeActiveUntil: z.nullable(types.number()).optional(),
  });

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

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

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

/** @internal */
export const FiftyNine$inboundSchema: z.ZodType<
  FiftyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  app: types.optional(z.lazy(() => App$inboundSchema)),
  issuedBefore: types.optional(types.number()),
});

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

/** @internal */
export const FiftyEight$inboundSchema: z.ZodType<
  FiftyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  secretLastFourChars: types.optional(types.string()),
});

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

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

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

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

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

/** @internal */
export const PayloadProjectIds$inboundSchema: z.ZodType<
  PayloadProjectIds,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload57Type$inboundSchema,
  required: types.literal(true),
  items: z.lazy(() => Items$inboundSchema),
});

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

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

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

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

/** @internal */
export const FiftySeven$inboundSchema: z.ZodType<
  FiftySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  resources: types.optional(z.lazy(() => Resources$inboundSchema)),
  permissions: types.optional(z.array(PayloadPermissions$inboundSchema)),
});

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

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

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

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

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

/** @internal */
export const UserEventPayloadProjectIds$inboundSchema: z.ZodType<
  UserEventPayloadProjectIds,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload56Type$inboundSchema,
  required: types.literal(true),
  items: z.lazy(() => UserEventPayloadItems$inboundSchema),
});

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

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

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

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

/** @internal */
export const Before$inboundSchema: z.ZodType<Before, z.ZodTypeDef, unknown> = z
  .object({
    resources: types.optional(
      z.lazy(() => UserEventPayloadResources$inboundSchema),
    ),
    permissions: types.optional(
      z.array(UserEventPayload56Permissions$inboundSchema),
    ),
  });

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

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

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

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

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

/** @internal */
export const UserEventPayload56ProjectIds$inboundSchema: z.ZodType<
  UserEventPayload56ProjectIds,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: UserEventPayload56AfterType$inboundSchema,
  required: types.literal(true),
  items: z.lazy(() => PayloadItems$inboundSchema),
});

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

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

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

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

/** @internal */
export const After$inboundSchema: z.ZodType<After, z.ZodTypeDef, unknown> = z
  .object({
    resources: types.optional(z.lazy(() => PayloadResources$inboundSchema)),
    permissions: types.optional(
      z.array(UserEventPayloadPermissions$inboundSchema),
    ),
  });

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

/** @internal */
export const FiftySix$inboundSchema: z.ZodType<
  FiftySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  installationId: types.optional(types.string()),
  before: types.optional(z.lazy(() => Before$inboundSchema)),
  after: types.optional(z.lazy(() => After$inboundSchema)),
});

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

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

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

/** @internal */
export const FiftyFive$inboundSchema: z.ZodType<
  FiftyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  nextScopes: z.array(NextScopes$inboundSchema),
  nextPermissions: types.optional(z.array(NextPermissions$inboundSchema)),
});

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

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

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

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

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

/** @internal */
export const FiftyThree$inboundSchema: z.ZodType<
  FiftyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  appName: types.string(),
  appId: types.optional(types.string()),
  scopes: z.array(PayloadScopes$inboundSchema),
  permissions: types.optional(z.array(Permissions$inboundSchema)),
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const FortyThree$inboundSchema: z.ZodType<
  FortyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  name: types.optional(types.string()),
  alias: types.string(),
  oldTeam: types.optional(z.lazy(() => OldTeam$inboundSchema)),
  newTeam: types.optional(z.lazy(() => NewTeam$inboundSchema)),
});

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

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

/** @internal */
export const PayloadDeployment$inboundSchema: z.ZodType<
  PayloadDeployment,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  name: types.string(),
  url: types.string(),
  meta: z.record(types.string()),
  readyState: types.optional(types.string()),
  allowListedReadyStateReasonInternal: types.optional(
    PayloadAllowListedReadyStateReasonInternal$inboundSchema,
  ),
});

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

/** @internal */
export const FortyTwo$inboundSchema: z.ZodType<
  FortyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  aliasCount: types.number(),
  deployment: z.nullable(z.lazy(() => PayloadDeployment$inboundSchema))
    .optional(),
});

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

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

/** @internal */
export const Deployment$inboundSchema: z.ZodType<
  Deployment,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  name: types.string(),
  url: types.string(),
  meta: z.record(types.string()),
  readyState: types.optional(types.string()),
  allowListedReadyStateReasonInternal: types.optional(
    AllowListedReadyStateReasonInternal$inboundSchema,
  ),
});

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

/** @internal */
export const FortyOne$inboundSchema: z.ZodType<
  FortyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  alias: types.optional(types.string()),
  deployment: z.nullable(z.lazy(() => Deployment$inboundSchema)).optional(),
  ruleCount: types.optional(types.number()),
  deploymentUrl: types.optional(types.string()),
  aliasId: types.optional(types.string()),
  deploymentId: z.nullable(types.string()).optional(),
  oldDeploymentId: z.nullable(types.string()).optional(),
  redirect: types.optional(types.string()),
  redirectStatusCode: z.nullable(types.number()).optional(),
  target: z.nullable(types.string()).optional(),
  system: types.optional(types.boolean()),
  aliasUpdatedAt: types.optional(types.number()),
});

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

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

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

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

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

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

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

/** @internal */
export const ThirtyNine$inboundSchema: z.ZodType<
  ThirtyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  accessGroup: z.lazy(() => UserEventPayload39AccessGroup$inboundSchema),
  user: z.lazy(() => PayloadUser$inboundSchema),
  directoryType: types.optional(types.string()),
});

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

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

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

/** @internal */
export const ThirtyEight$inboundSchema: z.ZodType<
  ThirtyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  accessGroup: z.lazy(() => UserEventPayload38AccessGroup$inboundSchema),
  name: types.optional(types.string()),
  previousName: types.optional(types.string()),
  teamRoles: types.optional(z.array(types.string())),
  previousTeamRoles: types.optional(z.array(types.string())),
  teamPermissions: types.optional(z.array(types.string())),
  previousTeamPermissions: types.optional(z.array(types.string())),
  entitlementsAdded: types.optional(z.array(types.string())),
  entitlementsRemoved: types.optional(z.array(types.string())),
});

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

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

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

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

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

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

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

/** @internal */
export const ThirtySeven$inboundSchema: z.ZodType<
  ThirtySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  accessGroup: z.lazy(() => UserEventPayloadAccessGroup$inboundSchema),
  project: z.lazy(() => PayloadProject$inboundSchema),
  next_role: z.nullable(NextRole$inboundSchema).optional(),
  previous_role: types.optional(PreviousRole$inboundSchema),
}).transform((v) => {
  return remap$(v, {
    "next_role": "nextRole",
    "previous_role": "previousRole",
  });
});

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

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

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