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,733 lines 139 kB
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { ClosedEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { smartUnion } from "../types/smartUnion.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
import {
  Abuse,
  Abuse$inboundSchema,
  Credentials,
  Credentials$inboundSchema,
  EmailNotifications,
  EmailNotifications$inboundSchema,
  PayloadActiveDashboardViews,
  PayloadActiveDashboardViews$inboundSchema,
  PayloadBilling,
  PayloadBilling$inboundSchema,
  PayloadDataCache,
  PayloadDataCache$inboundSchema,
  PayloadDismissedToasts,
  PayloadDismissedToasts$inboundSchema,
  PayloadFavoriteProjectsAndSpaces,
  PayloadFavoriteProjectsAndSpaces$inboundSchema,
  PayloadImportFlowGitNamespace,
  PayloadImportFlowGitNamespace$inboundSchema,
  PayloadImportFlowGitNamespaceId,
  PayloadImportFlowGitNamespaceId$inboundSchema,
  PayloadImportFlowGitProvider,
  PayloadImportFlowGitProvider$inboundSchema,
  PayloadPreferredScopesAndGitNamespaces,
  PayloadPreferredScopesAndGitNamespaces$inboundSchema,
  PayloadResourceConfig,
  PayloadResourceConfig$inboundSchema,
  PayloadSiftRoute,
  PayloadSiftRoute$inboundSchema,
  PayloadSoftBlock,
  PayloadSoftBlock$inboundSchema,
  PreventAutoBlocking,
  PreventAutoBlocking$inboundSchema,
  ResourceLimits,
  ResourceLimits$inboundSchema,
  SecondaryEmails,
  SecondaryEmails$inboundSchema,
  SiftScores,
  SiftScores$inboundSchema,
  Teams,
  Teams$inboundSchema,
  UserEventPayload138Type,
  UserEventPayload138Type$inboundSchema,
  UserEventPayloadRemoteCaching,
  UserEventPayloadRemoteCaching$inboundSchema,
} from "./usereventpayload138type.js";

/**
 * Contains the timestamps when a user was notified about their usage
 */
export type UsageAlerts = {
  warningAt?: number | null | undefined;
  blockingAt?: number | null | undefined;
};

export type AnalyticsUsage = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type Artifacts = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type Bandwidth = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type BlobTotalAdvancedRequests = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type BlobTotalAvgSizeInBytes = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type BlobTotalGetResponseObjectSizeInBytes = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type BlobTotalSimpleRequests = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ConnectDataTransfer = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type DataCacheRead = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type DataCacheWrite = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeConfigRead = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeConfigWrite = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeFunctionExecutionUnits = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeMiddlewareInvocations = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeRequestAdditionalCpuDuration = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type EdgeRequest = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ElasticConcurrencyBuildSlots = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FastDataTransfer = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FastOriginTransfer = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FluidCpuDuration = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FluidDuration = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FunctionDuration = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type FunctionInvocation = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ImageOptimizationCacheRead = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ImageOptimizationCacheWrite = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ImageOptimizationTransformation = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type LogDrainsVolume = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type MonitoringMetric = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type BlobDataTransfer = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ObservabilityEvent = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type OnDemandConcurrencyMinutes = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type RuntimeCacheRead = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type RuntimeCacheWrite = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type ServerlessFunctionExecution = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type SourceImages = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type WafOwaspExcessBytes = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type WafOwaspRequests = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type WafRateLimitRequest = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type WebAnalyticsEvent = {
  currentThreshold: number;
  warningAt?: number | null | undefined;
  blockedAt?: number | null | undefined;
};

export type OverageUsageAlerts = {
  analyticsUsage?: AnalyticsUsage | undefined;
  artifacts?: Artifacts | undefined;
  bandwidth?: Bandwidth | undefined;
  blobTotalAdvancedRequests?: BlobTotalAdvancedRequests | undefined;
  blobTotalAvgSizeInBytes?: BlobTotalAvgSizeInBytes | undefined;
  blobTotalGetResponseObjectSizeInBytes?:
    | BlobTotalGetResponseObjectSizeInBytes
    | undefined;
  blobTotalSimpleRequests?: BlobTotalSimpleRequests | undefined;
  connectDataTransfer?: ConnectDataTransfer | undefined;
  dataCacheRead?: DataCacheRead | undefined;
  dataCacheWrite?: DataCacheWrite | undefined;
  edgeConfigRead?: EdgeConfigRead | undefined;
  edgeConfigWrite?: EdgeConfigWrite | undefined;
  edgeFunctionExecutionUnits?: EdgeFunctionExecutionUnits | undefined;
  edgeMiddlewareInvocations?: EdgeMiddlewareInvocations | undefined;
  edgeRequestAdditionalCpuDuration?:
    | EdgeRequestAdditionalCpuDuration
    | undefined;
  edgeRequest?: EdgeRequest | undefined;
  elasticConcurrencyBuildSlots?: ElasticConcurrencyBuildSlots | undefined;
  fastDataTransfer?: FastDataTransfer | undefined;
  fastOriginTransfer?: FastOriginTransfer | undefined;
  fluidCpuDuration?: FluidCpuDuration | undefined;
  fluidDuration?: FluidDuration | undefined;
  functionDuration?: FunctionDuration | undefined;
  functionInvocation?: FunctionInvocation | undefined;
  imageOptimizationCacheRead?: ImageOptimizationCacheRead | undefined;
  imageOptimizationCacheWrite?: ImageOptimizationCacheWrite | undefined;
  imageOptimizationTransformation?: ImageOptimizationTransformation | undefined;
  logDrainsVolume?: LogDrainsVolume | undefined;
  monitoringMetric?: MonitoringMetric | undefined;
  blobDataTransfer?: BlobDataTransfer | undefined;
  observabilityEvent?: ObservabilityEvent | undefined;
  onDemandConcurrencyMinutes?: OnDemandConcurrencyMinutes | undefined;
  runtimeCacheRead?: RuntimeCacheRead | undefined;
  runtimeCacheWrite?: RuntimeCacheWrite | undefined;
  serverlessFunctionExecution?: ServerlessFunctionExecution | undefined;
  sourceImages?: SourceImages | undefined;
  wafOwaspExcessBytes?: WafOwaspExcessBytes | undefined;
  wafOwaspRequests?: WafOwaspRequests | undefined;
  wafRateLimitRequest?: WafRateLimitRequest | undefined;
  webAnalyticsEvent?: WebAnalyticsEvent | undefined;
};

/**
 * Contains the timestamps for usage summary emails.
 */
export type OverageMetadata = {
  /**
   * Tracks if the first time on-demand overage email has been sent.
   */
  firstTimeOnDemandNotificationSentAt?: number | undefined;
  /**
   * Tracks the last time we sent a daily summary email.
   */
  dailyOverageSummaryEmailSentAt?: number | undefined;
  /**
   * Tracks the last time we sent a weekly summary email.
   */
  weeklyOverageSummaryEmailSentAt?: number | undefined;
  /**
   * Tracks when the overage summary email will stop auto-sending. We currently lock the user into email for a month after the last on-demand usage.
   */
  overageSummaryExpiresAt?: number | undefined;
  /**
   * Tracks the last time we sent a increased on-demand email.
   */
  increasedOnDemandEmailSentAt?: number | undefined;
  /**
   * Tracks the last time we attempted to send an increased on-demand email. This check is to limit the number of attempts per day.
   */
  increasedOnDemandEmailAttemptedAt?: number | undefined;
};

/**
 * Whether the Vercel Toolbar is enabled for preview deployments.
 */
export const PayloadEnablePreviewFeedback = {
  Default: "default",
  DefaultForce: "default-force",
  Off: "off",
  OffForce: "off-force",
  On: "on",
  OnForce: "on-force",
} as const;
/**
 * Whether the Vercel Toolbar is enabled for preview deployments.
 */
export type PayloadEnablePreviewFeedback = ClosedEnum<
  typeof PayloadEnablePreviewFeedback
>;

export const BlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type BlockReason = ClosedEnum<typeof BlockReason>;

export type PayloadWebAnalytics = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: BlockReason;
  graceEmailSentAt?: number | undefined;
};

export const PayloadBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type PayloadBlockReason = ClosedEnum<typeof PayloadBlockReason>;

export const BlockType = {
  Hard: "hard",
  Soft: "soft",
} as const;
export type BlockType = ClosedEnum<typeof BlockType>;

/**
 * A soft block indicates a temporary pause in data collection (ex limit exceeded for the current cycle) A hard block indicates a stoppage in data collection that requires manual intervention (ex upgrading a pro trial)
 */
export type Monitoring = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: PayloadBlockReason;
  blockType: BlockType;
};

export const UserEventPayloadBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type UserEventPayloadBlockReason = ClosedEnum<
  typeof UserEventPayloadBlockReason
>;

export const PayloadBlockType = {
  Hard: "hard",
  Soft: "soft",
} as const;
export type PayloadBlockType = ClosedEnum<typeof PayloadBlockType>;

export type ObservabilityPlus = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPayloadBlockReason;
  blockType: PayloadBlockType;
};

export const UserEventPayload138BlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type UserEventPayload138BlockReason = ClosedEnum<
  typeof UserEventPayload138BlockReason
>;

export type UserEventPayloadDataCache = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPayload138BlockReason;
};

export const UserEventPayload138NewOwnerBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type UserEventPayload138NewOwnerBlockReason = ClosedEnum<
  typeof UserEventPayload138NewOwnerBlockReason
>;

export type PayloadImageOptimizationTransformation = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPayload138NewOwnerBlockReason;
};

export const UserEventPayload138NewOwnerFeatureBlocksBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type UserEventPayload138NewOwnerFeatureBlocksBlockReason = ClosedEnum<
  typeof UserEventPayload138NewOwnerFeatureBlocksBlockReason
>;

export type PayloadSourceImages = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPayload138NewOwnerFeatureBlocksBlockReason;
};

export const UserEventBlobBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
} as const;
export type UserEventBlobBlockReason = ClosedEnum<
  typeof UserEventBlobBlockReason
>;

export type Blob2 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventBlobBlockReason;
};

export const OverageReason = {
  AnalyticsUsage: "analyticsUsage",
  Artifacts: "artifacts",
  Bandwidth: "bandwidth",
  BlobDataTransfer: "blobDataTransfer",
  BlobTotalAdvancedRequests: "blobTotalAdvancedRequests",
  BlobTotalAvgSizeInBytes: "blobTotalAvgSizeInBytes",
  BlobTotalGetResponseObjectSizeInBytes:
    "blobTotalGetResponseObjectSizeInBytes",
  BlobTotalSimpleRequests: "blobTotalSimpleRequests",
  ConnectDataTransfer: "connectDataTransfer",
  DataCacheRead: "dataCacheRead",
  DataCacheWrite: "dataCacheWrite",
  EdgeConfigRead: "edgeConfigRead",
  EdgeConfigWrite: "edgeConfigWrite",
  EdgeFunctionExecutionUnits: "edgeFunctionExecutionUnits",
  EdgeMiddlewareInvocations: "edgeMiddlewareInvocations",
  EdgeRequest: "edgeRequest",
  EdgeRequestAdditionalCpuDuration: "edgeRequestAdditionalCpuDuration",
  ElasticConcurrencyBuildSlots: "elasticConcurrencyBuildSlots",
  FastDataTransfer: "fastDataTransfer",
  FastOriginTransfer: "fastOriginTransfer",
  FluidCpuDuration: "fluidCpuDuration",
  FluidDuration: "fluidDuration",
  FunctionDuration: "functionDuration",
  FunctionInvocation: "functionInvocation",
  ImageOptimizationCacheRead: "imageOptimizationCacheRead",
  ImageOptimizationCacheWrite: "imageOptimizationCacheWrite",
  ImageOptimizationTransformation: "imageOptimizationTransformation",
  LogDrainsVolume: "logDrainsVolume",
  MonitoringMetric: "monitoringMetric",
  ObservabilityEvent: "observabilityEvent",
  OnDemandConcurrencyMinutes: "onDemandConcurrencyMinutes",
  RuntimeCacheRead: "runtimeCacheRead",
  RuntimeCacheWrite: "runtimeCacheWrite",
  ServerlessFunctionExecution: "serverlessFunctionExecution",
  SourceImages: "sourceImages",
  WafOwaspExcessBytes: "wafOwaspExcessBytes",
  WafOwaspRequests: "wafOwaspRequests",
  WafRateLimitRequest: "wafRateLimitRequest",
  WebAnalyticsEvent: "webAnalyticsEvent",
} as const;
export type OverageReason = ClosedEnum<typeof OverageReason>;

export type Blob1 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: "limits_exceeded";
  overageReason: OverageReason;
};

export type BlobT =
  | Blob1
  | (Blob2 & { blockReason: "admin_override" })
  | (Blob2 & { blockReason: "hard_blocked" });

export const UserEventPostgresBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
} as const;
export type UserEventPostgresBlockReason = ClosedEnum<
  typeof UserEventPostgresBlockReason
>;

export type Postgres2 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPostgresBlockReason;
};

export const PostgresOverageReason = {
  AnalyticsUsage: "analyticsUsage",
  Artifacts: "artifacts",
  Bandwidth: "bandwidth",
  BlobDataTransfer: "blobDataTransfer",
  BlobTotalAdvancedRequests: "blobTotalAdvancedRequests",
  BlobTotalAvgSizeInBytes: "blobTotalAvgSizeInBytes",
  BlobTotalGetResponseObjectSizeInBytes:
    "blobTotalGetResponseObjectSizeInBytes",
  BlobTotalSimpleRequests: "blobTotalSimpleRequests",
  ConnectDataTransfer: "connectDataTransfer",
  DataCacheRead: "dataCacheRead",
  DataCacheWrite: "dataCacheWrite",
  EdgeConfigRead: "edgeConfigRead",
  EdgeConfigWrite: "edgeConfigWrite",
  EdgeFunctionExecutionUnits: "edgeFunctionExecutionUnits",
  EdgeMiddlewareInvocations: "edgeMiddlewareInvocations",
  EdgeRequest: "edgeRequest",
  EdgeRequestAdditionalCpuDuration: "edgeRequestAdditionalCpuDuration",
  ElasticConcurrencyBuildSlots: "elasticConcurrencyBuildSlots",
  FastDataTransfer: "fastDataTransfer",
  FastOriginTransfer: "fastOriginTransfer",
  FluidCpuDuration: "fluidCpuDuration",
  FluidDuration: "fluidDuration",
  FunctionDuration: "functionDuration",
  FunctionInvocation: "functionInvocation",
  ImageOptimizationCacheRead: "imageOptimizationCacheRead",
  ImageOptimizationCacheWrite: "imageOptimizationCacheWrite",
  ImageOptimizationTransformation: "imageOptimizationTransformation",
  LogDrainsVolume: "logDrainsVolume",
  MonitoringMetric: "monitoringMetric",
  ObservabilityEvent: "observabilityEvent",
  OnDemandConcurrencyMinutes: "onDemandConcurrencyMinutes",
  RuntimeCacheRead: "runtimeCacheRead",
  RuntimeCacheWrite: "runtimeCacheWrite",
  ServerlessFunctionExecution: "serverlessFunctionExecution",
  SourceImages: "sourceImages",
  WafOwaspExcessBytes: "wafOwaspExcessBytes",
  WafOwaspRequests: "wafOwaspRequests",
  WafRateLimitRequest: "wafRateLimitRequest",
  WebAnalyticsEvent: "webAnalyticsEvent",
} as const;
export type PostgresOverageReason = ClosedEnum<typeof PostgresOverageReason>;

export type Postgres1 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: "limits_exceeded";
  overageReason: PostgresOverageReason;
};

export type Postgres =
  | Postgres1
  | (Postgres2 & { blockReason: "admin_override" })
  | (Postgres2 & { blockReason: "hard_blocked" });

export const UserEventRedisBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
} as const;
export type UserEventRedisBlockReason = ClosedEnum<
  typeof UserEventRedisBlockReason
>;

export type Redis2 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventRedisBlockReason;
};

export const RedisOverageReason = {
  AnalyticsUsage: "analyticsUsage",
  Artifacts: "artifacts",
  Bandwidth: "bandwidth",
  BlobDataTransfer: "blobDataTransfer",
  BlobTotalAdvancedRequests: "blobTotalAdvancedRequests",
  BlobTotalAvgSizeInBytes: "blobTotalAvgSizeInBytes",
  BlobTotalGetResponseObjectSizeInBytes:
    "blobTotalGetResponseObjectSizeInBytes",
  BlobTotalSimpleRequests: "blobTotalSimpleRequests",
  ConnectDataTransfer: "connectDataTransfer",
  DataCacheRead: "dataCacheRead",
  DataCacheWrite: "dataCacheWrite",
  EdgeConfigRead: "edgeConfigRead",
  EdgeConfigWrite: "edgeConfigWrite",
  EdgeFunctionExecutionUnits: "edgeFunctionExecutionUnits",
  EdgeMiddlewareInvocations: "edgeMiddlewareInvocations",
  EdgeRequest: "edgeRequest",
  EdgeRequestAdditionalCpuDuration: "edgeRequestAdditionalCpuDuration",
  ElasticConcurrencyBuildSlots: "elasticConcurrencyBuildSlots",
  FastDataTransfer: "fastDataTransfer",
  FastOriginTransfer: "fastOriginTransfer",
  FluidCpuDuration: "fluidCpuDuration",
  FluidDuration: "fluidDuration",
  FunctionDuration: "functionDuration",
  FunctionInvocation: "functionInvocation",
  ImageOptimizationCacheRead: "imageOptimizationCacheRead",
  ImageOptimizationCacheWrite: "imageOptimizationCacheWrite",
  ImageOptimizationTransformation: "imageOptimizationTransformation",
  LogDrainsVolume: "logDrainsVolume",
  MonitoringMetric: "monitoringMetric",
  ObservabilityEvent: "observabilityEvent",
  OnDemandConcurrencyMinutes: "onDemandConcurrencyMinutes",
  RuntimeCacheRead: "runtimeCacheRead",
  RuntimeCacheWrite: "runtimeCacheWrite",
  ServerlessFunctionExecution: "serverlessFunctionExecution",
  SourceImages: "sourceImages",
  WafOwaspExcessBytes: "wafOwaspExcessBytes",
  WafOwaspRequests: "wafOwaspRequests",
  WafRateLimitRequest: "wafRateLimitRequest",
  WebAnalyticsEvent: "webAnalyticsEvent",
} as const;
export type RedisOverageReason = ClosedEnum<typeof RedisOverageReason>;

export type Redis1 = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: "limits_exceeded";
  overageReason: RedisOverageReason;
};

export type Redis =
  | Redis1
  | (Redis2 & { blockReason: "admin_override" })
  | (Redis2 & { blockReason: "hard_blocked" });

export const UserEventPayload138NewOwnerFeatureBlocksMicrofrontendsRequestBlockReason =
  {
    AdminOverride: "admin_override",
    HardBlocked: "hard_blocked",
    LimitsExceeded: "limits_exceeded",
  } as const;
export type UserEventPayload138NewOwnerFeatureBlocksMicrofrontendsRequestBlockReason =
  ClosedEnum<
    typeof UserEventPayload138NewOwnerFeatureBlocksMicrofrontendsRequestBlockReason
  >;

export type MicrofrontendsRequest = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason:
    UserEventPayload138NewOwnerFeatureBlocksMicrofrontendsRequestBlockReason;
};

export const UserEventPayload138NewOwnerFeatureBlocksWorkflowStorageBlockReason =
  {
    AdminOverride: "admin_override",
    HardBlocked: "hard_blocked",
    LimitsExceeded: "limits_exceeded",
  } as const;
export type UserEventPayload138NewOwnerFeatureBlocksWorkflowStorageBlockReason =
  ClosedEnum<
    typeof UserEventPayload138NewOwnerFeatureBlocksWorkflowStorageBlockReason
  >;

export type WorkflowStorage = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason:
    UserEventPayload138NewOwnerFeatureBlocksWorkflowStorageBlockReason;
};

export const UserEventPayload138NewOwnerFeatureBlocksWorkflowStepBlockReason = {
  AdminOverride: "admin_override",
  HardBlocked: "hard_blocked",
  LimitsExceeded: "limits_exceeded",
} as const;
export type UserEventPayload138NewOwnerFeatureBlocksWorkflowStepBlockReason =
  ClosedEnum<
    typeof UserEventPayload138NewOwnerFeatureBlocksWorkflowStepBlockReason
  >;

export type WorkflowStep = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason: UserEventPayload138NewOwnerFeatureBlocksWorkflowStepBlockReason;
};

export const UserEventPayload138NewOwnerFeatureBlocksConnexTokenRequestsBlockReason =
  {
    AdminOverride: "admin_override",
    HardBlocked: "hard_blocked",
    LimitsExceeded: "limits_exceeded",
  } as const;
export type UserEventPayload138NewOwnerFeatureBlocksConnexTokenRequestsBlockReason =
  ClosedEnum<
    typeof UserEventPayload138NewOwnerFeatureBlocksConnexTokenRequestsBlockReason
  >;

export type ConnexTokenRequests = {
  updatedAt: number;
  blockedFrom?: number | undefined;
  blockedUntil?: number | undefined;
  blockReason:
    UserEventPayload138NewOwnerFeatureBlocksConnexTokenRequestsBlockReason;
};

/**
 * Information about which features are blocked for a user. Blocks can be either soft (the user can still access the feature, but with a warning, e.g. prompting an upgrade) or hard (the user cannot access the feature at all).
 */
export type PayloadFeatureBlocks = {
  webAnalytics?: PayloadWebAnalytics | undefined;
  /**
   * A soft block indicates a temporary pause in data collection (ex limit exceeded for the current cycle) A hard block indicates a stoppage in data collection that requires manual intervention (ex upgrading a pro trial)
   */
  monitoring?: Monitoring | undefined;
  observabilityPlus?: ObservabilityPlus | undefined;
  dataCache?: UserEventPayloadDataCache | undefined;
  imageOptimizationTransformation?:
    | PayloadImageOptimizationTransformation
    | undefined;
  sourceImages?: PayloadSourceImages | undefined;
  blob?:
    | Blob1
    | (Blob2 & { blockReason: "admin_override" })
    | (Blob2 & { blockReason: "hard_blocked" })
    | undefined;
  postgres?:
    | Postgres1
    | (Postgres2 & { blockReason: "admin_override" })
    | (Postgres2 & { blockReason: "hard_blocked" })
    | undefined;
  redis?:
    | Redis1
    | (Redis2 & { blockReason: "admin_override" })
    | (Redis2 & { blockReason: "hard_blocked" })
    | undefined;
  microfrontendsRequest?: MicrofrontendsRequest | undefined;
  workflowStorage?: WorkflowStorage | undefined;
  workflowStep?: WorkflowStep | undefined;
  connexTokenRequests?: ConnexTokenRequests | undefined;
};

export const Version = {
  Northstar: "northstar",
} as const;
export type Version = ClosedEnum<typeof Version>;

/**
 * An archive of information about the Northstar migration, derived from the old (deprecated) property, `northstarMigrationEvents`.
 */
export type NorthstarMigration = {
  /**
   * The ID of the team we created for this user.
   */
  teamId: string;
  /**
   * The number of projects migrated for this user.
   */
  projects: number;
  /**
   * The number of stores migrated for this user.
   */
  stores: number;
  /**
   * The number of integration configurations migrated for this user.
   */
  integrationConfigurations: number;
  /**
   * The number of integration clients migrated for this user.
   */
  integrationClients: number;
  /**
   * The migration start time timestamp for this user.
   */
  startTime: number;
  /**
   * The migration end time timestamp for this user.
   */
  endTime: number;
};

export type Totp = {
  secret: string;
  createdAt: number;
};

/**
 * The action that occurred
 */
export const UserEventPayload138NewOwnerAction = {
  Disabled: "disabled",
  Enabled: "enabled",
} as const;
/**
 * The action that occurred
 */
export type UserEventPayload138NewOwnerAction = ClosedEnum<
  typeof UserEventPayload138NewOwnerAction
>;

/**
 * Method used for the state change - 'totp': User set up TOTP authenticator - 'passkey': User registered a passkey - 'user_disabled': User disabled their own MFA - 'admin_removal': Admin removed MFA via backoffice - 'unknown': Method unknown (for pre-tracking events)
 */
export const PayloadMethod = {
  AdminRemoval: "admin_removal",
  Passkey: "passkey",
  Totp: "totp",
  Unknown: "unknown",
  UserDisabled: "user_disabled",
} as const;
/**
 * Method used for the state change - 'totp': User set up TOTP authenticator - 'passkey': User registered a passkey - 'user_disabled': User disabled their own MFA - 'admin_removal': Admin removed MFA via backoffice - 'unknown': Method unknown (for pre-tracking events)
 */
export type PayloadMethod = ClosedEnum<typeof PayloadMethod>;

/**
 * Type of actor
 */
export const PayloadActorType = {
  Admin: "admin",
  User: "user",
} as const;
/**
 * Type of actor
 */
export type PayloadActorType = ClosedEnum<typeof PayloadActorType>;

/**
 * History of MFA state changes (enabled/disabled events). Most recent events first.
 */
export type PayloadHistory = {
  /**
   * The action that occurred
   */
  action: UserEventPayload138NewOwnerAction;
  /**
   * Unix timestamp (milliseconds) when the change occurred. May be null for events that occurred before history tracking was implemented.
   */
  timestamp: number | null;
  /**
   * Method used for the state change - 'totp': User set up TOTP authenticator - 'passkey': User registered a passkey - 'user_disabled': User disabled their own MFA - 'admin_removal': Admin removed MFA via backoffice - 'unknown': Method unknown (for pre-tracking events)
   */
  method: PayloadMethod;
  /**
   * ID of the actor who made the change - For user actions: the user's own ID - For admin actions: the admin's user ID
   */
  actorId: string;
  /**
   * Type of actor
   */
  actorType: PayloadActorType;
  /**
   * Optional: Additional context or reason e.g., "Account recovery request - ticket #12345"
   */
  reason?: string | undefined;
};

/**
 * MFA configuration. When enabled, the user will be required to provide a second factor of authentication when logging in.
 */
export type MfaConfiguration = {
  enabled: boolean;
  enabledAt?: number | undefined;
  recoveryCodes: Array<string>;
  totp?: Totp | undefined;
  /**
   * History of MFA state changes (enabled/disabled events). Most recent events first.
   */
  history?: Array<PayloadHistory> | undefined;
};

export type NewOwner = {
  abuse?: Abuse | undefined;
  acceptanceState?: string | undefined;
  acceptedAt?: number | undefined;
  avatar?: string | undefined;
  billing: PayloadBilling;
  blocked: number | null;
  blockReason?: string | undefined;
  created?: number | undefined;
  createdAt: number;
  credentials?: Array<Credentials> | undefined;
  customerId?: string | null | undefined;
  orbCustomerId?: string | null | undefined;
  dataCache?: PayloadDataCache | undefined;
  deletedAt?: number | null | undefined;
  deploymentSecret: string;
  dismissedTeams?: Array<string> | undefined;
  dismissedToasts?: Array<PayloadDismissedToasts> | undefined;
  favoriteProjectsAndSpaces?:
    | Array<PayloadFavoriteProjectsAndSpaces>
    | undefined;
  email: string;
  id: string;
  importFlowGitNamespace?: PayloadImportFlowGitNamespace | null | undefined;
  importFlowGitNamespaceId?: PayloadImportFlowGitNamespaceId | null | undefined;
  importFlowGitProvider?: PayloadImportFlowGitProvider | null | undefined;
  preferredScopesAndGitNamespaces?:
    | Array<PayloadPreferredScopesAndGitNamespaces>
    | undefined;
  isDomainReseller?: boolean | undefined;
  isZeitPub?: boolean | undefined;
  testAccountExpiresAt?: number | undefined;
  maxActiveSlots?: number | undefined;
  name?: string | undefined;
  phoneNumber?: string | undefined;
  platformVersion: number | null;
  preventAutoBlocking?: PreventAutoBlocking | undefined;
  /**
   * Overrides our DEFAULT project domains limit per account or per project.
   */
  projectDomainsLimit?: number | undefined;
  /**
   * Represents configuration for remote caching
   */
  remoteCaching?: UserEventPayloadRemoteCaching | undefined;
  removedAliasesAt?: number | undefined;
  removedBillingSubscriptionAt?: number | undefined;
  removedConfigurationsAt?: number | undefined;
  removedDeploymentsAt?: number | undefined;
  removedDomiansAt?: number | undefined;
  removedEventsAt?: number | undefined;
  removedProjectsAt?: number | undefined;
  removedSecretsAt?: number | undefined;
  removedSharedEnvVarsAt?: number | undefined;
  removedEdgeConfigsAt?: number | undefined;
  resourceConfig?: PayloadResourceConfig | undefined;
  /**
   * User | Team resource limits
   */
  resourceLimits?: { [k: string]: ResourceLimits } | undefined;
  activeDashboardViews?: Array<PayloadActiveDashboardViews> | undefined;
  secondaryEmails?: Array<SecondaryEmails> | undefined;
  emailDomains?: Array<string> | undefined;
  emailNotifications?: EmailNotifications | undefined;
  siftScore?: number | undefined;
  siftScores?: { [k: string]: SiftScores } | undefined;
  siftRoute?: PayloadSiftRoute | undefined;
  sfdcId?: string | undefined;
  softBlock?: PayloadSoftBlock | null | undefined;
  stagingPrefix: string;
  sysToken: string;
  /**
   * A helper that allows to describe a relationship attribute. It receives the shape of a relationship plus the foreignKey name to make it mandatory in the resulting type.
   */
  teams?: Array<Teams> | undefined;
  /**
   * Introduced 2022-04-12 An array of teamIds (for trial teams created after 2022-04-01), created by the user in question. Used in determining whether the team has a trial available in utils/api-teams/user-has-trial-available.ts.
   */
  trialTeamIds?: Array<string> | undefined;
  /**
   * Introduced 2022-04-19 Number of maximum trials to allocate to a user. When undefined, defaults to MAX_TRIALS in utils/api-teams/user-has-trial-available.ts. This is set to trialTeamIds + 1 by services/api-backoffice/src/handlers/add-additional-trial.ts.
   */
  maxTrials?: number | undefined;
  /**
   * Deprecated on 2022-04-12 in favor of trialTeamIds and using utils/api-teams/user-has-trial-available.ts.
   */
  trialTeamId?: string | undefined;
  type: UserEventPayload138Type;
  /**
   * Contains the timestamps when a user was notified about their usage
   */
  usageAlerts?: UsageAlerts | null | undefined;
  overageUsageAlerts?: OverageUsageAlerts | undefined;
  /**
   * Contains the timestamps for usage summary emails.
   */
  overageMetadata?: OverageMetadata | undefined;
  username: string;
  updatedAt: number;
  /**
   * Whether the Vercel Toolbar is enabled for preview deployments.
   */
  enablePreviewFeedback?: PayloadEnablePreviewFeedback | undefined;
  /**
   * Information about which features are blocked for a user. Blocks can be either soft (the user can still access the feature, but with a warning, e.g. prompting an upgrade) or hard (the user cannot access the feature at all).
   */
  featureBlocks?: PayloadFeatureBlocks | undefined;
  defaultTeamId?: string | undefined;
  version: Version;
  /**
   * Whether MFA is enforced for this user. Set to true when the user has a
   */
  isMFAEnforced?: boolean | undefined;
  /**
   * An archive of information about the Northstar migration, derived from the old (deprecated) property, `northstarMigrationEvents`.
   */
  northstarMigration?: NorthstarMigration | undefined;
  /**
   * The salesforce opportunity ID that this user is linked to. This is used to automatically associate a team of the user's choosing with the opportunity.
   */
  opportunityId?: string | undefined;
  /**
   * MFA configuration. When enabled, the user will be required to provide a second factor of authentication when logging in.
   */
  mfaConfiguration?: MfaConfiguration | undefined;
  /**
   * Indicates that the underlying user entity is a managed user for the enterprise it's associated with The intention is that this field is only set to true for users that are provisioned by the enterprise which means that the domain associated with the user's email is the same domain associated with the team Allowing us to query information about the user's team at login time through the domain verification service
   */
  isEnterpriseManaged?: boolean | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtyEight = {
  userId: string;
  integrationId: string;
  configurationId: string;
  integrationSlug: string;
  integrationName?: string | undefined;
  newOwner: NewOwner | null;
};

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

export const UserEventPayload136Action = {
  Disable: "disable",
  Enable: "enable",
} as const;
export type UserEventPayload136Action = ClosedEnum<
  typeof UserEventPayload136Action
>;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtySix = {
  action: UserEventPayload136Action;
};

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

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtyFive = {
  projectId: string;
  rulesetName: string;
  active: boolean;
  action?: UserEventPayload135Action | undefined;
};

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

export type RuleGroups = {
  active: boolean;
  action?: UserEventPayload134Action | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtyFour = {
  projectId: string;
  rulesetName: string;
  ruleGroups: { [k: string]: RuleGroups };
};

export type ConfigChanges = {};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtyThree = {
  projectId: string;
  projectName?: string | undefined;
  restore: boolean;
  configVersion: number;
  configChangeCount: number;
  configChanges: Array<ConfigChanges>;
};

export type ConfigVersion = string | number;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirtyTwo = {
  projectId: string;
  projectName: string;
  configVersion: string | number;
};

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

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndThirty = {
  projectId: string;
  scope: string;
  source: string;
  expiresAt?: number | null | undefined;
};

/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export const UserEventPayload129Type = {
  Encrypted: "encrypted",
  Plain: "plain",
  Sensitive: "sensitive",
  System: "system",
} as const;
/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export type UserEventPayload129Type = ClosedEnum<
  typeof UserEventPayload129Type
>;

/**
 * environments this env variable targets
 */
export const UserEventPayload129Target = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
/**
 * environments this env variable targets
 */
export type UserEventPayload129Target = ClosedEnum<
  typeof UserEventPayload129Target
>;

export type OldEnvVar = {
  /**
   * The date when the Shared Env Var was created.
   */
  created?: Date | undefined;
  /**
   * The name of the Shared Env Var.
   */
  key?: string | undefined;
  /**
   * The unique identifier of the owner (team) the Shared Env Var was created for.
   */
  ownerId?: string | null | undefined;
  /**
   * The unique identifier of the Shared Env Var.
   */
  id?: string | undefined;
  /**
   * The unique identifier of the user who created the Shared Env Var.
   */
  createdBy?: string | null | undefined;
  /**
   * The unique identifier of the user who deleted the Shared Env Var.
   */
  deletedBy?: string | null | undefined;
  /**
   * The unique identifier of the user who last updated the Shared Env Var.
   */
  updatedBy?: string | null | undefined;
  /**
   * Timestamp for when the Shared Env Var was created.
   */
  createdAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was (soft) deleted.
   */
  deletedAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was last updated.
   */
  updatedAt?: number | undefined;
  /**
   * The value of the Shared Env Var.
   */
  value?: string | undefined;
  /**
   * The unique identifiers of the projects which the Shared Env Var is linked to.
   */
  projectId?: Array<string> | undefined;
  /**
   * The type of this cosmos doc instance, if blank, assume secret.
   */
  type?: UserEventPayload129Type | undefined;
  /**
   * environments this env variable targets
   */
  target?: Array<UserEventPayload129Target> | undefined;
  /**
   * whether or not this env varible applies to custom environments
   */
  applyToAllCustomEnvironments?: boolean | undefined;
  /**
   * The custom environment IDs that this Shared Env Var is scoped to.
   */
  customEnvironmentIds?: Array<string> | undefined;
  /**
   * whether or not this env variable is decrypted
   */
  decrypted?: boolean | undefined;
  /**
   * A user provided comment that describes what this Shared Env Var is for.
   */
  comment?: string | undefined;
  /**
   * The last editor full name or username.
   */
  lastEditedByDisplayName?: string | undefined;
};

/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export const UserEventPayload129NewEnvVarType = {
  Encrypted: "encrypted",
  Plain: "plain",
  Sensitive: "sensitive",
  System: "system",
} as const;
/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export type UserEventPayload129NewEnvVarType = ClosedEnum<
  typeof UserEventPayload129NewEnvVarType
>;

/**
 * environments this env variable targets
 */
export const UserEventPayload129NewEnvVarTarget = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
/**
 * environments this env variable targets
 */
export type UserEventPayload129NewEnvVarTarget = ClosedEnum<
  typeof UserEventPayload129NewEnvVarTarget
>;

export type NewEnvVar = {
  /**
   * The date when the Shared Env Var was created.
   */
  created?: Date | undefined;
  /**
   * The name of the Shared Env Var.
   */
  key?: string | undefined;
  /**
   * The unique identifier of the owner (team) the Shared Env Var was created for.
   */
  ownerId?: string | null | undefined;
  /**
   * The unique identifier of the Shared Env Var.
   */
  id?: string | undefined;
  /**
   * The unique identifier of the user who created the Shared Env Var.
   */
  createdBy?: string | null | undefined;
  /**
   * The unique identifier of the user who deleted the Shared Env Var.
   */
  deletedBy?: string | null | undefined;
  /**
   * The unique identifier of the user who last updated the Shared Env Var.
   */
  updatedBy?: string | null | undefined;
  /**
   * Timestamp for when the Shared Env Var was created.
   */
  createdAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was (soft) deleted.
   */
  deletedAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was last updated.
   */
  updatedAt?: number | undefined;
  /**
   * The value of the Shared Env Var.
   */
  value?: string | undefined;
  /**
   * The unique identifiers of the projects which the Shared Env Var is linked to.
   */
  projectId?: Array<string> | undefined;
  /**
   * The type of this cosmos doc instance, if blank, assume secret.
   */
  type?: UserEventPayload129NewEnvVarType | undefined;
  /**
   * environments this env variable targets
   */
  target?: Array<UserEventPayload129NewEnvVarTarget> | undefined;
  /**
   * whether or not this env varible applies to custom environments
   */
  applyToAllCustomEnvironments?: boolean | undefined;
  /**
   * The custom environment IDs that this Shared Env Var is scoped to.
   */
  customEnvironmentIds?: Array<string> | undefined;
  /**
   * whether or not this env variable is decrypted
   */
  decrypted?: boolean | undefined;
  /**
   * A user provided comment that describes what this Shared Env Var is for.
   */
  comment?: string | undefined;
  /**
   * The last editor full name or username.
   */
  lastEditedByDisplayName?: string | undefined;
};

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

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

export type OldProjects = {
  projectName?: string | undefined;
  projectId: string;
};

export type NewProjects = {
  projectName?: string | undefined;
  projectId: string;
};

export type UpdateDiff = {
  id: string;
  key?: string | undefined;
  newKey?: string | undefined;
  oldTarget?: Array<OldTarget> | undefined;
  newTarget?: Array<NewTarget> | undefined;
  oldType?: string | undefined;
  newType?: string | undefined;
  oldProjects?: Array<OldProjects> | undefined;
  newProjects?: Array<NewProjects> | undefined;
  oldCustomEnvironmentIds?: Array<string> | undefined;
  newCustomEnvironmentIds?: Array<string> | undefined;
  changedValue: boolean;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyNine = {
  oldEnvVar?: OldEnvVar | undefined;
  newEnvVar?: NewEnvVar | undefined;
  updateDiff?: UpdateDiff | undefined;
};

/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export const PayloadType = {
  Encrypted: "encrypted",
  Plain: "plain",
  Sensitive: "sensitive",
  System: "system",
} as const;
/**
 * The type of this cosmos doc instance, if blank, assume secret.
 */
export type PayloadType = ClosedEnum<typeof PayloadType>;

/**
 * environments this env variable targets
 */
export const UserEventPayloadTarget = {
  Development: "development",
  Preview: "preview",
  Production: "production",
} as const;
/**
 * environments this env variable targets
 */
export type UserEventPayloadTarget = ClosedEnum<typeof UserEventPayloadTarget>;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyEight = {
  /**
   * The date when the Shared Env Var was created.
   */
  created?: Date | undefined;
  /**
   * The name of the Shared Env Var.
   */
  key?: string | undefined;
  /**
   * The unique identifier of the owner (team) the Shared Env Var was created for.
   */
  ownerId?: string | null | undefined;
  /**
   * The unique identifier of the Shared Env Var.
   */
  id?: string | undefined;
  /**
   * The unique identifier of the user who created the Shared Env Var.
   */
  createdBy?: string | null | undefined;
  /**
   * The unique identifier of the user who deleted the Shared Env Var.
   */
  deletedBy?: string | null | undefined;
  /**
   * The unique identifier of the user who last updated the Shared Env Var.
   */
  updatedBy?: string | null | undefined;
  /**
   * Timestamp for when the Shared Env Var was created.
   */
  createdAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was (soft) deleted.
   */
  deletedAt?: number | undefined;
  /**
   * Timestamp for when the Shared Env Var was last updated.
   */
  updatedAt?: number | undefined;
  /**
   * The value of the Shared Env Var.
   */
  value?: string | undefined;
  /**
   * The unique identifiers of the projects which the Shared Env Var is linked to.
   */
  projectId?: Array<string> | undefined;
  /**
   * The type of this cosmos doc instance, if blank, assume secret.
   */
  type?: PayloadType | undefined;
  /**
   * environments this env variable targets
   */
  target?: Array<UserEventPayloadTarget> | undefined;
  /**
   * whether or not this env varible applies to custom environments
   */
  applyToAllCustomEnvironments?: boolean | undefined;
  /**
   * The custom environment IDs that this Shared Env Var is scoped to.
   */
  customEnvironmentIds?: Array<string> | undefined;
  /**
   * whether or not this env variable is decrypted
   */
  decrypted?: boolean | undefined;
  /**
   * A user provided comment that describes what this Shared Env Var is for.
   */
  comment?: string | undefined;
  /**
   * The last editor full name or username.
   */
  lastEditedByDisplayName?: string | undefined;
  projectNames?: Array<string> | undefined;
  ipAddress?: string | undefined;
};

export type PayloadTarget = string | Array<string>;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentySeven = {
  key?: string | undefined;
  projectId?: string | undefined;
  projectName?: string | undefined;
  target?: string | Array<string> | undefined;
  customEnvironmentSlugs?: Array<string> | undefined;
  id?: string | undefined;
  gitBranch?: string | undefined;
  edgeConfigId?: string | null | undefined;
  edgeConfigTokenId?: string | null | undefined;
  source?: string | undefined;
  ipAddress?: string | undefined;
  deploymentId: string;
  deploymentUrl: string;
};

export type Target = string | Array<string>;

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentySix = {
  key?: string | undefined;
  projectId?: string | undefined;
  projectName?: string | undefined;
  target?: string | Array<string> | undefined;
  customEnvironmentSlugs?: Array<string> | undefined;
  id?: string | undefined;
  gitBranch?: string | undefined;
  edgeConfigId?: string | null | undefined;
  edgeConfigTokenId?: string | null | undefined;
  source?: string | undefined;
  ipAddress?: string | undefined;
};

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

export type PayloadPreviousRule = {
  email: string;
};

export type NextRule = {
  email: string;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyFive = {
  team: UserEventPayload125Team;
  previousRule?: PayloadPreviousRule | undefined;
  nextRule?: NextRule | undefined;
};

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

export type PreviousRule = {
  email: string;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyFour = {
  team: UserEventPayload124Team;
  previousRule: PreviousRule;
};

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

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyTwo = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  /**
   * ids of deleted tokens
   */
  edgeConfigTokenIds: Array<string>;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwentyOne = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  edgeConfigTokenId: string;
  label: string;
};

export type EdgeConfig = {
  id: string;
  slug: string;
};

export const UserEventPayload120Type = {
  Team: "team",
  User: "user",
} as const;
export type UserEventPayload120Type = ClosedEnum<
  typeof UserEventPayload120Type
>;

export type FromAccount = {
  id: string;
  type: UserEventPayload120Type;
  slug?: string | undefined;
  username?: string | undefined;
};

export const UserEventPayload120ToAccountType = {
  Team: "team",
  User: "user",
} as const;
export type UserEventPayload120ToAccountType = ClosedEnum<
  typeof UserEventPayload120ToAccountType
>;

export type ToAccount = {
  id: string;
  type: UserEventPayload120ToAccountType;
  slug?: string | undefined;
  username?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwenty = {
  edgeConfig: EdgeConfig;
  fromAccount: FromAccount;
  toAccount: ToAccount;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndNineteen = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  edgeConfigDigest?: string | undefined;
};

export type EdgeConfigSchema = {};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndEighteen = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  edgeConfigSchema?: EdgeConfigSchema | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndSeventeen = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  edgeConfigDigest: string;
  edgeConfigBackupVersionId: string;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndSixteen = {
  edgeConfigId: string;
  edgeConfigSlug: string;
  edgeConfigDigest: string;
};

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

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

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

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndTwelve = {
  drainUrl: string | null;
  integrationName?: string | undefined;
};

/**
 * The payload of the event, if requested.
 */
export type OneHundredAndEleven = {
  drainUrl: string | null;
  drainName: string | null;
  integrationName?: string | undefined;
};

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

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

/** @internal */
export const AnalyticsUsage$inboundSchema: z.ZodType<
  AnalyticsUsage,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const Artifacts$inboundSchema: z.ZodType<
  Artifacts,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const Bandwidth$inboundSchema: z.ZodType<
  Bandwidth,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const BlobTotalAdvancedRequests$inboundSchema: z.ZodType<
  BlobTotalAdvancedRequests,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const BlobTotalAvgSizeInBytes$inboundSchema: z.ZodType<
  BlobTotalAvgSizeInBytes,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const BlobTotalGetResponseObjectSizeInBytes$inboundSchema: z.ZodType<
  BlobTotalGetResponseObjectSizeInBytes,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const BlobTotalSimpleRequests$inboundSchema: z.ZodType<
  BlobTotalSimpleRequests,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ConnectDataTransfer$inboundSchema: z.ZodType<
  ConnectDataTransfer,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const DataCacheRead$inboundSchema: z.ZodType<
  DataCacheRead,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const DataCacheWrite$inboundSchema: z.ZodType<
  DataCacheWrite,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeConfigRead$inboundSchema: z.ZodType<
  EdgeConfigRead,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeConfigWrite$inboundSchema: z.ZodType<
  EdgeConfigWrite,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeFunctionExecutionUnits$inboundSchema: z.ZodType<
  EdgeFunctionExecutionUnits,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeMiddlewareInvocations$inboundSchema: z.ZodType<
  EdgeMiddlewareInvocations,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeRequestAdditionalCpuDuration$inboundSchema: z.ZodType<
  EdgeRequestAdditionalCpuDuration,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const EdgeRequest$inboundSchema: z.ZodType<
  EdgeRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ElasticConcurrencyBuildSlots$inboundSchema: z.ZodType<
  ElasticConcurrencyBuildSlots,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FastDataTransfer$inboundSchema: z.ZodType<
  FastDataTransfer,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FastOriginTransfer$inboundSchema: z.ZodType<
  FastOriginTransfer,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FluidCpuDuration$inboundSchema: z.ZodType<
  FluidCpuDuration,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FluidDuration$inboundSchema: z.ZodType<
  FluidDuration,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FunctionDuration$inboundSchema: z.ZodType<
  FunctionDuration,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const FunctionInvocation$inboundSchema: z.ZodType<
  FunctionInvocation,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ImageOptimizationCacheRead$inboundSchema: z.ZodType<
  ImageOptimizationCacheRead,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ImageOptimizationCacheWrite$inboundSchema: z.ZodType<
  ImageOptimizationCacheWrite,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ImageOptimizationTransformation$inboundSchema: z.ZodType<
  ImageOptimizationTransformation,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const LogDrainsVolume$inboundSchema: z.ZodType<
  LogDrainsVolume,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const MonitoringMetric$inboundSchema: z.ZodType<
  MonitoringMetric,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const BlobDataTransfer$inboundSchema: z.ZodType<
  BlobDataTransfer,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ObservabilityEvent$inboundSchema: z.ZodType<
  ObservabilityEvent,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const OnDemandConcurrencyMinutes$inboundSchema: z.ZodType<
  OnDemandConcurrencyMinutes,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const RuntimeCacheRead$inboundSchema: z.ZodType<
  RuntimeCacheRead,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const RuntimeCacheWrite$inboundSchema: z.ZodType<
  RuntimeCacheWrite,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const ServerlessFunctionExecution$inboundSchema: z.ZodType<
  ServerlessFunctionExecution,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const SourceImages$inboundSchema: z.ZodType<
  SourceImages,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const WafOwaspExcessBytes$inboundSchema: z.ZodType<
  WafOwaspExcessBytes,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const WafOwaspRequests$inboundSchema: z.ZodType<
  WafOwaspRequests,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const WafRateLimitRequest$inboundSchema: z.ZodType<
  WafRateLimitRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const WebAnalyticsEvent$inboundSchema: z.ZodType<
  WebAnalyticsEvent,
  z.ZodTypeDef,
  unknown
> = z.object({
  currentThreshold: types.number(),
  warningAt: z.nullable(types.number()).optional(),
  blockedAt: z.nullable(types.number()).optional(),
});

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

/** @internal */
export const OverageUsageAlerts$inboundSchema: z.ZodType<
  OverageUsageAlerts,
  z.ZodTypeDef,
  unknown
> = z.object({
  analyticsUsage: types.optional(z.lazy(() => AnalyticsUsage$inboundSchema)),
  artifacts: types.optional(z.lazy(() => Artifacts$inboundSchema)),
  bandwidth: types.optional(z.lazy(() => Bandwidth$inboundSchema)),
  blobTotalAdvancedRequests: types.optional(
    z.lazy(() => BlobTotalAdvancedRequests$inboundSchema),
  ),
  blobTotalAvgSizeInBytes: types.optional(
    z.lazy(() => BlobTotalAvgSizeInBytes$inboundSchema),
  ),
  blobTotalGetResponseObjectSizeInBytes: types.optional(
    z.lazy(() => BlobTotalGetResponseObjectSizeInBytes$inboundSchema),
  ),
  blobTotalSimpleRequests: types.optional(
    z.lazy(() => BlobTotalSimpleRequests$inboundSchema),
  ),
  connectDataTransfer: types.optional(
    z.lazy(() => ConnectDataTransfer$inboundSchema),
  ),
  dataCacheRead: types.optional(z.lazy(() => DataCacheRead$inboundSchema)),
  dataCacheWrite: types.optional(z.lazy(() => DataCacheWrite$inboundSchema)),
  edgeConfigRead: types.optional(z.lazy(() => EdgeConfigRead$inboundSchema)),
  edgeConfigWrite: types.optional(z.lazy(() => EdgeConfigWrite$inboundSchema)),
  edgeFunctionExecutionUnits: types.optional(
    z.lazy(() => EdgeFunctionExecutionUnits$inboundSchema),
  ),
  edgeMiddlewareInvocations: types.optional(
    z.lazy(() => EdgeMiddlewareInvocations$inboundSchema),
  ),
  edgeRequestAdditionalCpuDuration: types.optional(
    z.lazy(() => EdgeRequestAdditionalCpuDuration$inboundSchema),
  ),
  edgeRequest: types.optional(z.lazy(() => EdgeRequest$inboundSchema)),
  elasticConcurrencyBuildSlots: types.optional(
    z.lazy(() => ElasticConcurrencyBuildSlots$inboundSchema),
  ),
  fastDataTransfer: types.optional(
    z.lazy(() => FastDataTransfer$inboundSchema),
  ),
  fastOriginTransfer: types.optional(
    z.lazy(() => FastOriginTransfer$inboundSchema),
  ),
  fluidCpuDuration: types.optional(
    z.lazy(() => FluidCpuDuration$inboundSchema),
  ),
  fluidDuration: types.optional(z.lazy(() => FluidDuration$inboundSchema)),
  functionDuration: types.optional(
    z.lazy(() => FunctionDuration$inboundSchema),
  ),
  functionInvocation: types.optional(
    z.lazy(() => FunctionInvocation$inboundSchema),
  ),
  imageOptimizationCacheRead: types.optional(
    z.lazy(() => ImageOptimizationCacheRead$inboundSchema),
  ),
  imageOptimizationCacheWrite: types.optional(
    z.lazy(() => ImageOptimizationCacheWrite$inboundSchema),
  ),
  imageOptimizationTransformation: types.optional(
    z.lazy(() => ImageOptimizationTransformation$inboundSchema),
  ),
  logDrainsVolume: types.optional(z.lazy(() => LogDrainsVolume$inboundSchema)),
  monitoringMetric: types.optional(
    z.lazy(() => MonitoringMetric$inboundSchema),
  ),
  blobDataTransfer: types.optional(
    z.lazy(() => BlobDataTransfer$inboundSchema),
  ),
  observabilityEvent: types.optional(
    z.lazy(() => ObservabilityEvent$inboundSchema),
  ),
  onDemandConcurrencyMinutes: types.optional(
    z.lazy(() => OnDemandConcurrencyMinutes$inboundSchema),
  ),
  runtimeCacheRead: types.optional(
    z.lazy(() => RuntimeCacheRead$inboundSchema),
  ),
  runtimeCacheWrite: types.optional(
    z.lazy(() => RuntimeCacheWrite$inboundSchema),
  ),
  serverlessFunctionExecution: types.optional(
    z.lazy(() => ServerlessFunctionExecution$inboundSchema),
  ),
  sourceImages: types.optional(z.lazy(() => SourceImages$inboundSchema)),
  wafOwaspExcessBytes: types.optional(
    z.lazy(() => WafOwaspExcessBytes$inboundSchema),
  ),
  wafOwaspRequests: types.optional(
    z.lazy(() => WafOwaspRequests$inboundSchema),
  ),
  wafRateLimitRequest: types.optional(
    z.lazy(() => WafRateLimitRequest$inboundSchema),
  ),
  webAnalyticsEvent: types.optional(
    z.lazy(() => WebAnalyticsEvent$inboundSchema),
  ),
});

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

/** @internal */
export const OverageMetadata$inboundSchema: z.ZodType<
  OverageMetadata,
  z.ZodTypeDef,
  unknown
> = z.object({
  firstTimeOnDemandNotificationSentAt: types.optional(types.number()),
  dailyOverageSummaryEmailSentAt: types.optional(types.number()),
  weeklyOverageSummaryEmailSentAt: types.optional(types.number()),
  overageSummaryExpiresAt: types.optional(types.number()),
  increasedOnDemandEmailSentAt: types.optional(types.number()),
  increasedOnDemandEmailAttemptedAt: types.optional(types.number()),
});

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

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

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

/** @internal */
export const PayloadWebAnalytics$inboundSchema: z.ZodType<
  PayloadWebAnalytics,
  z.ZodTypeDef,
  unknown
> = z.object({
  updatedAt: types.number(),
  blockedFrom: types.optional(types.number()),
  blockedUntil: types.optional(types.number()),
  blockReason: BlockReason$inboundSchema,
  graceEmailSentAt: types.optional(types.number()),
});

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

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

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

/** @internal */
export const Monitoring$inboundSchema: z.ZodType<
  Monitoring,
  z.ZodTypeDef,
  unknown
> = z.object({
  updatedAt: types.number(),
  blockedFrom: types.optional(types.number()),
  blockedUntil: types.optional(types.number()),
  blockReason: PayloadBlockReason$inboundSchema,
  blockType: BlockType$inboundSchema,
});

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

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

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

/** @internal */
export const ObservabilityPlus$inboundSchema: z.ZodType<
  ObservabilityPlus,
  z.ZodTypeDef,
  unknown
> = z.object({
  updatedAt: types.number(),
  blockedFrom: types.optional(types.number()),
  blockedUntil: types.optional(types.number()),
  blockReason: UserEventPayloadBlockReason$inboundSchema,
  blockType: PayloadBlockType$inboundSchema,
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const Blob1$inboundSchema: z.ZodType<Blob1, z.ZodTypeDef, unknown> = z
  .object({
    updatedAt: types.number(),
    blockedFrom: types.optional(types.number()),
    blockedUntil: types.optional(types.number()),
    blockReason: types.literal("limits_exceeded"),
    overageReason: OverageReason$inboundSchema,
  });

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

/** @internal */
export const BlobT$inboundSchema: z.ZodType<BlobT, z.ZodTypeDef, unknown> = z
  .union([
    z.lazy(() => Blob1$inboundSchema),
    z.lazy(() => Blob2$inboundSchema).and(
      z.object({ blockReason: z.literal("admin_override") }),
    ),
    z.lazy(() => Blob2$inboundSchema).and(
      z.object({ blockReason: z.literal("hard_blocked") }),
    ),
  ]);

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

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

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

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

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

/** @internal */
export const Postgres1$inboundSchema: z.ZodType<
  Postgres1,
  z.ZodTypeDef,
  unknown
> = z.object({
  updatedAt: types.number(),
  blockedFrom: types.optional(types.number()),
  blockedUntil: types.optional(types.number()),
  blockReason: types.literal("limits_exceeded"),
  overageReason: PostgresOverageReason$inboundSchema,
});

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

/** @internal */
export const Postgres$inboundSchema: z.ZodType<
  Postgres,
  z.ZodTypeDef,
  unknown
> = z.union([
  z.lazy(() => Postgres1$inboundSchema),
  z.lazy(() => Postgres2$inboundSchema).and(
    z.object({ blockReason: z.literal("admin_override") }),
  ),
  z.lazy(() => Postgres2$inboundSchema).and(
    z.object({ blockReason: z.literal("hard_blocked") }),
  ),
]);

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

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

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

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

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

/** @internal */
export const Redis1$inboundSchema: z.ZodType<Redis1, z.ZodTypeDef, unknown> = z
  .object({
    updatedAt: types.number(),
    blockedFrom: types.optional(types.number()),
    blockedUntil: types.optional(types.number()),
    blockReason: types.literal("limits_exceeded"),
    overageReason: RedisOverageReason$inboundSchema,
  });

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

/** @internal */
export const Redis$inboundSchema: z.ZodType<Redis, z.ZodTypeDef, unknown> = z
  .union([
    z.lazy(() => Redis1$inboundSchema),
    z.lazy(() => Redis2$inboundSchema).and(
      z.object({ blockReason: z.literal("admin_override") }),
    ),
    z.lazy(() => Redis2$inboundSchema).and(
      z.object({ blockReason: z.literal("hard_blocked") }),
    ),
  ]);

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const PayloadFeatureBlocks$inboundSchema: z.ZodType<
  PayloadFeatureBlocks,
  z.ZodTypeDef,
  unknown
> = z.object({
  webAnalytics: types.optional(z.lazy(() => PayloadWebAnalytics$inboundSchema)),
  monitoring: types.optional(z.lazy(() => Monitoring$inboundSchema)),
  observabilityPlus: types.optional(
    z.lazy(() => ObservabilityPlus$inboundSchema),
  ),
  dataCache: types.optional(
    z.lazy(() => UserEventPayloadDataCache$inboundSchema),
  ),
  imageOptimizationTransformation: types.optional(
    z.lazy(() => PayloadImageOptimizationTransformation$inboundSchema),
  ),
  sourceImages: types.optional(z.lazy(() => PayloadSourceImages$inboundSchema)),
  blob: types.optional(
    z.union([
      z.lazy(() => Blob1$inboundSchema),
      z.lazy(() =>
        Blob2$inboundSchema
      ).and(z.object({ blockReason: z.literal("admin_override") })),
      z.lazy(() =>
        Blob2$inboundSchema
      ).and(z.object({ blockReason: z.literal("hard_blocked") })),
    ]),
  ),
  postgres: types.optional(
    z.union([
      z.lazy(() => Postgres1$inboundSchema),
      z.lazy(() =>
        Postgres2$inboundSchema
      ).and(z.object({ blockReason: z.literal("admin_override") })),
      z.lazy(() =>
        Postgres2$inboundSchema
      ).and(z.object({ blockReason: z.literal("hard_blocked") })),
    ]),
  ),
  redis: types.optional(
    z.union([
      z.lazy(() => Redis1$inboundSchema),
      z.lazy(() =>
        Redis2$inboundSchema
      ).and(z.object({ blockReason: z.literal("admin_override") })),
      z.lazy(() =>
        Redis2$inboundSchema
      ).and(z.object({ blockReason: z.literal("hard_blocked") })),
    ]),
  ),
  microfrontendsRequest: types.optional(
    z.lazy(() => MicrofrontendsRequest$inboundSchema),
  ),
  workflowStorage: types.optional(z.lazy(() => WorkflowStorage$inboundSchema)),
  workflowStep: types.optional(z.lazy(() => WorkflowStep$inboundSchema)),
  connexTokenRequests: types.optional(
    z.lazy(() => ConnexTokenRequests$inboundSchema),
  ),
});

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

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

/** @internal */
export const NorthstarMigration$inboundSchema: z.ZodType<
  NorthstarMigration,
  z.ZodTypeDef,
  unknown
> = z.object({
  teamId: types.string(),
  projects: types.number(),
  stores: types.number(),
  integrationConfigurations: types.number(),
  integrationClients: types.number(),
  startTime: types.number(),
  endTime: types.number(),
});

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

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

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

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

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

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

/** @internal */
export const PayloadHistory$inboundSchema: z.ZodType<
  PayloadHistory,
  z.ZodTypeDef,
  unknown
> = z.object({
  action: UserEventPayload138NewOwnerAction$inboundSchema,
  timestamp: types.nullable(types.number()),
  method: PayloadMethod$inboundSchema,
  actorId: types.string(),
  actorType: PayloadActorType$inboundSchema,
  reason: types.optional(types.string()),
});

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

/** @internal */
export const MfaConfiguration$inboundSchema: z.ZodType<
  MfaConfiguration,
  z.ZodTypeDef,
  unknown
> = z.object({
  enabled: types.boolean(),
  enabledAt: types.optional(types.number()),
  recoveryCodes: z.array(types.string()),
  totp: types.optional(z.lazy(() => Totp$inboundSchema)),
  history: types.optional(z.array(z.lazy(() => PayloadHistory$inboundSchema))),
});

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

/** @internal */
export const NewOwner$inboundSchema: z.ZodType<
  NewOwner,
  z.ZodTypeDef,
  unknown
> = z.object({
  abuse: types.optional(Abuse$inboundSchema),
  acceptanceState: types.optional(types.string()),
  acceptedAt: types.optional(types.number()),
  avatar: types.optional(types.string()),
  billing: PayloadBilling$inboundSchema,
  blocked: types.nullable(types.number()),
  blockReason: types.optional(types.string()),
  created: types.optional(types.number()),
  createdAt: types.number(),
  credentials: types.optional(z.array(Credentials$inboundSchema)),
  customerId: z.nullable(types.string()).optional(),
  orbCustomerId: z.nullable(types.string()).optional(),
  dataCache: types.optional(PayloadDataCache$inboundSchema),
  deletedAt: z.nullable(types.number()).optional(),
  deploymentSecret: types.string(),
  dismissedTeams: types.optional(z.array(types.string())),
  dismissedToasts: types.optional(
    z.array(PayloadDismissedToasts$inboundSchema),
  ),
  favoriteProjectsAndSpaces: types.optional(
    z.array(PayloadFavoriteProjectsAndSpaces$inboundSchema),
  ),
  email: types.string(),
  id: types.string(),
  importFlowGitNamespace: z.nullable(
    PayloadImportFlowGitNamespace$inboundSchema,
  ).optional(),
  importFlowGitNamespaceId: z.nullable(
    PayloadImportFlowGitNamespaceId$inboundSchema,
  ).optional(),
  importFlowGitProvider: z.nullable(PayloadImportFlowGitProvider$inboundSchema)
    .optional(),
  preferredScopesAndGitNamespaces: types.optional(
    z.array(PayloadPreferredScopesAndGitNamespaces$inboundSchema),
  ),
  isDomainReseller: types.optional(types.boolean()),
  isZeitPub: types.optional(types.boolean()),
  testAccountExpiresAt: types.optional(types.number()),
  maxActiveSlots: types.optional(types.number()),
  name: types.optional(types.string()),
  phoneNumber: types.optional(types.string()),
  platformVersion: types.nullable(types.number()),
  preventAutoBlocking: types.optional(PreventAutoBlocking$inboundSchema),
  projectDomainsLimit: types.optional(types.number()),
  remoteCaching: types.optional(UserEventPayloadRemoteCaching$inboundSchema),
  removedAliasesAt: types.optional(types.number()),
  removedBillingSubscriptionAt: types.optional(types.number()),
  removedConfigurationsAt: types.optional(types.number()),
  removedDeploymentsAt: types.optional(types.number()),
  removedDomiansAt: types.optional(types.number()),
  removedEventsAt: types.optional(types.number()),
  removedProjectsAt: types.optional(types.number()),
  removedSecretsAt: types.optional(types.number()),
  removedSharedEnvVarsAt: types.optional(types.number()),
  removedEdgeConfigsAt: types.optional(types.number()),
  resourceConfig: types.optional(PayloadResourceConfig$inboundSchema),
  resourceLimits: types.optional(z.record(ResourceLimits$inboundSchema)),
  activeDashboardViews: types.optional(
    z.array(PayloadActiveDashboardViews$inboundSchema),
  ),
  secondaryEmails: types.optional(z.array(SecondaryEmails$inboundSchema)),
  emailDomains: types.optional(z.array(types.string())),
  emailNotifications: types.optional(EmailNotifications$inboundSchema),
  siftScore: types.optional(types.number()),
  siftScores: types.optional(z.record(SiftScores$inboundSchema)),
  siftRoute: types.optional(PayloadSiftRoute$inboundSchema),
  sfdcId: types.optional(types.string()),
  softBlock: z.nullable(PayloadSoftBlock$inboundSchema).optional(),
  stagingPrefix: types.string(),
  sysToken: types.string(),
  teams: types.optional(z.array(Teams$inboundSchema)),
  trialTeamIds: types.optional(z.array(types.string())),
  maxTrials: types.optional(types.number()),
  trialTeamId: types.optional(types.string()),
  type: UserEventPayload138Type$inboundSchema,
  usageAlerts: z.nullable(z.lazy(() => UsageAlerts$inboundSchema)).optional(),
  overageUsageAlerts: types.optional(
    z.lazy(() => OverageUsageAlerts$inboundSchema),
  ),
  overageMetadata: types.optional(z.lazy(() => OverageMetadata$inboundSchema)),
  username: types.string(),
  updatedAt: types.number(),
  enablePreviewFeedback: types.optional(
    PayloadEnablePreviewFeedback$inboundSchema,
  ),
  featureBlocks: types.optional(
    z.lazy(() => PayloadFeatureBlocks$inboundSchema),
  ),
  defaultTeamId: types.optional(types.string()),
  version: Version$inboundSchema,
  isMFAEnforced: types.optional(types.boolean()),
  northstarMigration: types.optional(
    z.lazy(() => NorthstarMigration$inboundSchema),
  ),
  opportunityId: types.optional(types.string()),
  mfaConfiguration: types.optional(
    z.lazy(() => MfaConfiguration$inboundSchema),
  ),
  isEnterpriseManaged: types.optional(types.boolean()),
});

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

/** @internal */
export const OneHundredAndThirtyEight$inboundSchema: z.ZodType<
  OneHundredAndThirtyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  userId: types.string(),
  integrationId: types.string(),
  configurationId: types.string(),
  integrationSlug: types.string(),
  integrationName: types.optional(types.string()),
  newOwner: types.nullable(z.lazy(() => NewOwner$inboundSchema)),
});

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const OneHundredAndThirtyFour$inboundSchema: z.ZodType<
  OneHundredAndThirtyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  rulesetName: types.string(),
  ruleGroups: z.record(z.lazy(() => RuleGroups$inboundSchema)),
});

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

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

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

/** @internal */
export const OneHundredAndThirtyThree$inboundSchema: z.ZodType<
  OneHundredAndThirtyThree,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.optional(types.string()),
  restore: types.boolean(),
  configVersion: types.number(),
  configChangeCount: types.number(),
  configChanges: z.array(z.lazy(() => ConfigChanges$inboundSchema)),
});

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

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

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

/** @internal */
export const OneHundredAndThirtyTwo$inboundSchema: z.ZodType<
  OneHundredAndThirtyTwo,
  z.ZodTypeDef,
  unknown
> = z.object({
  projectId: types.string(),
  projectName: types.string(),
  configVersion: smartUnion([types.string(), types.number()]),
});

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

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

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

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

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

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

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

/** @internal */
export const OldEnvVar$inboundSchema: z.ZodType<
  OldEnvVar,
  z.ZodTypeDef,
  unknown
> = z.object({
  created: types.optional(types.date()),
  key: types.optional(types.string()),
  ownerId: z.nullable(types.string()).optional(),
  id: types.optional(types.string()),
  createdBy: z.nullable(types.string()).optional(),
  deletedBy: z.nullable(types.string()).optional(),
  updatedBy: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  deletedAt: types.optional(types.number()),
  updatedAt: types.optional(types.number()),
  value: types.optional(types.string()),
  projectId: types.optional(z.array(types.string())),
  type: types.optional(UserEventPayload129Type$inboundSchema),
  target: types.optional(z.array(UserEventPayload129Target$inboundSchema)),
  applyToAllCustomEnvironments: types.optional(types.boolean()),
  customEnvironmentIds: types.optional(z.array(types.string())),
  decrypted: types.optional(types.boolean()),
  comment: types.optional(types.string()),
  lastEditedByDisplayName: types.optional(types.string()),
});

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

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

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

/** @internal */
export const NewEnvVar$inboundSchema: z.ZodType<
  NewEnvVar,
  z.ZodTypeDef,
  unknown
> = z.object({
  created: types.optional(types.date()),
  key: types.optional(types.string()),
  ownerId: z.nullable(types.string()).optional(),
  id: types.optional(types.string()),
  createdBy: z.nullable(types.string()).optional(),
  deletedBy: z.nullable(types.string()).optional(),
  updatedBy: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  deletedAt: types.optional(types.number()),
  updatedAt: types.optional(types.number()),
  value: types.optional(types.string()),
  projectId: types.optional(z.array(types.string())),
  type: types.optional(UserEventPayload129NewEnvVarType$inboundSchema),
  target: types.optional(
    z.array(UserEventPayload129NewEnvVarTarget$inboundSchema),
  ),
  applyToAllCustomEnvironments: types.optional(types.boolean()),
  customEnvironmentIds: types.optional(z.array(types.string())),
  decrypted: types.optional(types.boolean()),
  comment: types.optional(types.string()),
  lastEditedByDisplayName: types.optional(types.string()),
});

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

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

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

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

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

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

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

/** @internal */
export const UpdateDiff$inboundSchema: z.ZodType<
  UpdateDiff,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
  key: types.optional(types.string()),
  newKey: types.optional(types.string()),
  oldTarget: types.optional(z.array(OldTarget$inboundSchema)),
  newTarget: types.optional(z.array(NewTarget$inboundSchema)),
  oldType: types.optional(types.string()),
  newType: types.optional(types.string()),
  oldProjects: types.optional(z.array(z.lazy(() => OldProjects$inboundSchema))),
  newProjects: types.optional(z.array(z.lazy(() => NewProjects$inboundSchema))),
  oldCustomEnvironmentIds: types.optional(z.array(types.string())),
  newCustomEnvironmentIds: types.optional(z.array(types.string())),
  changedValue: types.boolean(),
});

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

/** @internal */
export const OneHundredAndTwentyNine$inboundSchema: z.ZodType<
  OneHundredAndTwentyNine,
  z.ZodTypeDef,
  unknown
> = z.object({
  oldEnvVar: types.optional(z.lazy(() => OldEnvVar$inboundSchema)),
  newEnvVar: types.optional(z.lazy(() => NewEnvVar$inboundSchema)),
  updateDiff: types.optional(z.lazy(() => UpdateDiff$inboundSchema)),
});

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

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

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

/** @internal */
export const OneHundredAndTwentyEight$inboundSchema: z.ZodType<
  OneHundredAndTwentyEight,
  z.ZodTypeDef,
  unknown
> = z.object({
  created: types.optional(types.date()),
  key: types.optional(types.string()),
  ownerId: z.nullable(types.string()).optional(),
  id: types.optional(types.string()),
  createdBy: z.nullable(types.string()).optional(),
  deletedBy: z.nullable(types.string()).optional(),
  updatedBy: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  deletedAt: types.optional(types.number()),
  updatedAt: types.optional(types.number()),
  value: types.optional(types.string()),
  projectId: types.optional(z.array(types.string())),
  type: types.optional(PayloadType$inboundSchema),
  target: types.optional(z.array(UserEventPayloadTarget$inboundSchema)),
  applyToAllCustomEnvironments: types.optional(types.boolean()),
  customEnvironmentIds: types.optional(z.array(types.string())),
  decrypted: types.optional(types.boolean()),
  comment: types.optional(types.string()),
  lastEditedByDisplayName: types.optional(types.string()),
  projectNames: types.optional(z.array(types.string())),
  ipAddress: types.optional(types.string()),
});

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

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

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

/** @internal */
export const OneHundredAndTwentySeven$inboundSchema: z.ZodType<
  OneHundredAndTwentySeven,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: types.optional(types.string()),
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  target: types.optional(smartUnion([types.string(), z.array(types.string())])),
  customEnvironmentSlugs: types.optional(z.array(types.string())),
  id: types.optional(types.string()),
  gitBranch: types.optional(types.string()),
  edgeConfigId: z.nullable(types.string()).optional(),
  edgeConfigTokenId: z.nullable(types.string()).optional(),
  source: types.optional(types.string()),
  ipAddress: types.optional(types.string()),
  deploymentId: types.string(),
  deploymentUrl: types.string(),
});

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

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

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

/** @internal */
export const OneHundredAndTwentySix$inboundSchema: z.ZodType<
  OneHundredAndTwentySix,
  z.ZodTypeDef,
  unknown
> = z.object({
  key: types.optional(types.string()),
  projectId: types.optional(types.string()),
  projectName: types.optional(types.string()),
  target: types.optional(smartUnion([types.string(), z.array(types.string())])),
  customEnvironmentSlugs: types.optional(z.array(types.string())),
  id: types.optional(types.string()),
  gitBranch: types.optional(types.string()),
  edgeConfigId: z.nullable(types.string()).optional(),
  edgeConfigTokenId: z.nullable(types.string()).optional(),
  source: types.optional(types.string()),
  ipAddress: types.optional(types.string()),
});

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

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

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

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

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

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

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

/** @internal */
export const OneHundredAndTwentyFive$inboundSchema: z.ZodType<
  OneHundredAndTwentyFive,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => UserEventPayload125Team$inboundSchema),
  previousRule: types.optional(z.lazy(() => PayloadPreviousRule$inboundSchema)),
  nextRule: types.optional(z.lazy(() => NextRule$inboundSchema)),
});

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

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

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

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

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

/** @internal */
export const OneHundredAndTwentyFour$inboundSchema: z.ZodType<
  OneHundredAndTwentyFour,
  z.ZodTypeDef,
  unknown
> = z.object({
  team: z.lazy(() => UserEventPayload124Team$inboundSchema),
  previousRule: z.lazy(() => PreviousRule$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const OneHundredAndTwentyOne$inboundSchema: z.ZodType<
  OneHundredAndTwentyOne,
  z.ZodTypeDef,
  unknown
> = z.object({
  edgeConfigId: types.string(),
  edgeConfigSlug: types.string(),
  edgeConfigTokenId: types.string(),
  label: types.string(),
});

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

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

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

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

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

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

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

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

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

/** @internal */
export const OneHundredAndTwenty$inboundSchema: z.ZodType<
  OneHundredAndTwenty,
  z.ZodTypeDef,
  unknown
> = z.object({
  edgeConfig: z.lazy(() => EdgeConfig$inboundSchema),
  fromAccount: z.lazy(() => FromAccount$inboundSchema),
  toAccount: z.lazy(() => ToAccount$inboundSchema),
});

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

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

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

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

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

/** @internal */
export const OneHundredAndEighteen$inboundSchema: z.ZodType<
  OneHundredAndEighteen,
  z.ZodTypeDef,
  unknown
> = z.object({
  edgeConfigId: types.string(),
  edgeConfigSlug: types.string(),
  edgeConfigSchema: types.optional(
    z.lazy(() => EdgeConfigSchema$inboundSchema),
  ),
});

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

/** @internal */
export const OneHundredAndSeventeen$inboundSchema: z.ZodType<
  OneHundredAndSeventeen,
  z.ZodTypeDef,
  unknown
> = z.object({
  edgeConfigId: types.string(),
  edgeConfigSlug: types.string(),
  edgeConfigDigest: types.string(),
  edgeConfigBackupVersionId: types.string(),
});

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

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

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

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

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

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

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

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

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

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

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

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

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