/*
 * 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 {
  GetMicrofrontendsInGroupAlias,
  GetMicrofrontendsInGroupAlias$inboundSchema,
  GetMicrofrontendsInGroupAnalytics,
  GetMicrofrontendsInGroupAnalytics$inboundSchema,
  GetMicrofrontendsInGroupBlobs,
  GetMicrofrontendsInGroupBlobs$inboundSchema,
  GetMicrofrontendsInGroupConnectConfigurations,
  GetMicrofrontendsInGroupConnectConfigurations$inboundSchema,
  GetMicrofrontendsInGroupCreator,
  GetMicrofrontendsInGroupCreator$inboundSchema,
  GetMicrofrontendsInGroupCrons,
  GetMicrofrontendsInGroupCrons$inboundSchema,
  GetMicrofrontendsInGroupCustomEnvironments,
  GetMicrofrontendsInGroupCustomEnvironments$inboundSchema,
  GetMicrofrontendsInGroupDataCache,
  GetMicrofrontendsInGroupDataCache$inboundSchema,
  GetMicrofrontendsInGroupDeploymentExpiration,
  GetMicrofrontendsInGroupDeploymentExpiration$inboundSchema,
  GetMicrofrontendsInGroupEnv,
  GetMicrofrontendsInGroupEnv$inboundSchema,
  GetMicrofrontendsInGroupExpiration,
  GetMicrofrontendsInGroupExpiration$inboundSchema,
  GetMicrofrontendsInGroupFramework,
  GetMicrofrontendsInGroupFramework$inboundSchema,
  GetMicrofrontendsInGroupIpBuckets,
  GetMicrofrontendsInGroupIpBuckets$inboundSchema,
  GetMicrofrontendsInGroupJobs,
  GetMicrofrontendsInGroupJobs$inboundSchema,
  GetMicrofrontendsInGroupLatestDeployments,
  GetMicrofrontendsInGroupLatestDeployments$inboundSchema,
  GetMicrofrontendsInGroupLink,
  GetMicrofrontendsInGroupLink$inboundSchema,
  GetMicrofrontendsInGroupMicrofrontends,
  GetMicrofrontendsInGroupMicrofrontends$inboundSchema,
  GetMicrofrontendsInGroupNodeVersion,
  GetMicrofrontendsInGroupNodeVersion$inboundSchema,
  GetMicrofrontendsInGroupOptionsAllowlist,
  GetMicrofrontendsInGroupOptionsAllowlist$inboundSchema,
  GetMicrofrontendsInGroupPassport,
  GetMicrofrontendsInGroupPassport$inboundSchema,
  GetMicrofrontendsInGroupPasswordProtection,
  GetMicrofrontendsInGroupPasswordProtection$inboundSchema,
  GetMicrofrontendsInGroupProtectionConfig,
  GetMicrofrontendsInGroupProtectionConfig$inboundSchema,
  GetMicrofrontendsInGroupResourceConfig,
  GetMicrofrontendsInGroupResourceConfig$inboundSchema,
  GetMicrofrontendsInGroupRollbackDescription,
  GetMicrofrontendsInGroupRollbackDescription$inboundSchema,
  GetMicrofrontendsInGroupRollingRelease,
  GetMicrofrontendsInGroupRollingRelease$inboundSchema,
  GetMicrofrontendsInGroupSandbox,
  GetMicrofrontendsInGroupSandbox$inboundSchema,
  GetMicrofrontendsInGroupServices,
  GetMicrofrontendsInGroupServices$inboundSchema,
  GetMicrofrontendsInGroupSpeedInsights,
  GetMicrofrontendsInGroupSpeedInsights$inboundSchema,
} from "./getmicrofrontendsingroupbuildmachinetype.js";
import {
  GetMicrofrontendsInGroupAbuse,
  GetMicrofrontendsInGroupAbuse$inboundSchema,
  GetMicrofrontendsInGroupDefaultResourceConfig,
  GetMicrofrontendsInGroupDefaultResourceConfig$inboundSchema,
  GetMicrofrontendsInGroupDeploymentPolicy,
  GetMicrofrontendsInGroupDeploymentPolicy$inboundSchema,
  GetMicrofrontendsInGroupFeatures,
  GetMicrofrontendsInGroupFeatures$inboundSchema,
  GetMicrofrontendsInGroupGitComments,
  GetMicrofrontendsInGroupGitComments$inboundSchema,
  GetMicrofrontendsInGroupGitProviderOptions,
  GetMicrofrontendsInGroupGitProviderOptions$inboundSchema,
  GetMicrofrontendsInGroupInternalRoutes2,
  GetMicrofrontendsInGroupInternalRoutes2$inboundSchema,
  GetMicrofrontendsInGroupLastAliasRequest,
  GetMicrofrontendsInGroupLastAliasRequest$inboundSchema,
  GetMicrofrontendsInGroupLastRollbackTarget,
  GetMicrofrontendsInGroupLastRollbackTarget$inboundSchema,
  GetMicrofrontendsInGroupOidcTokenConfig,
  GetMicrofrontendsInGroupOidcTokenConfig$inboundSchema,
  GetMicrofrontendsInGroupPermissions,
  GetMicrofrontendsInGroupPermissions$inboundSchema,
  GetMicrofrontendsInGroupProtectionBypass,
  GetMicrofrontendsInGroupProtectionBypass$inboundSchema,
  GetMicrofrontendsInGroupSecurity,
  GetMicrofrontendsInGroupSecurity$inboundSchema,
  GetMicrofrontendsInGroupSsoProtection,
  GetMicrofrontendsInGroupSsoProtection$inboundSchema,
  GetMicrofrontendsInGroupStaticIps,
  GetMicrofrontendsInGroupStaticIps$inboundSchema,
  GetMicrofrontendsInGroupTargets,
  GetMicrofrontendsInGroupTargets$inboundSchema,
  GetMicrofrontendsInGroupTier,
  GetMicrofrontendsInGroupTier$inboundSchema,
  GetMicrofrontendsInGroupTrustedIps,
  GetMicrofrontendsInGroupTrustedIps$inboundSchema,
  GetMicrofrontendsInGroupTrustedSources,
  GetMicrofrontendsInGroupTrustedSources$inboundSchema,
  GetMicrofrontendsInGroupUsageStatus,
  GetMicrofrontendsInGroupUsageStatus$inboundSchema,
  GetMicrofrontendsInGroupWebAnalytics,
  GetMicrofrontendsInGroupWebAnalytics$inboundSchema,
} from "./getmicrofrontendsingroupinternalroutes2.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

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

export type GetMicrofrontendsInGroupInternalRoutes =
  | GetMicrofrontendsInGroupInternalRoutes1
  | GetMicrofrontendsInGroupInternalRoutes2;

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

export type GetMicrofrontendsInGroupValuePreviousValue =
  | string
  | number
  | boolean;

export type GetMicrofrontendsInGroupValueCurrentValue =
  | string
  | number
  | boolean;

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

export type GetMicrofrontendsInGroupValue =
  | GetMicrofrontendsInGroupValue3
  | string
  | number
  | boolean;

export type GetMicrofrontendsInGroupDismissedToasts = {
  key: string;
  dismissedAt: number;
  action: GetMicrofrontendsInGroupAction;
  value: GetMicrofrontendsInGroupValue3 | string | number | boolean | null;
};

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

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

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

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

export type GetMicrofrontendsInGroupProjects = {
  accountId: string;
  creator?: GetMicrofrontendsInGroupCreator | undefined;
  alias: Array<GetMicrofrontendsInGroupAlias>;
  analytics?: GetMicrofrontendsInGroupAnalytics | undefined;
  appliedCve55182Migration?: boolean | undefined;
  speedInsights?: GetMicrofrontendsInGroupSpeedInsights | undefined;
  autoExposeSystemEnvs?: boolean | undefined;
  autoAssignCustomDomains?: boolean | undefined;
  autoAssignCustomDomainsUpdatedBy?: string | undefined;
  buildCommand?: string | null | undefined;
  commandForIgnoringBuildStep?: string | null | undefined;
  connectConfigurations?:
    | Array<GetMicrofrontendsInGroupConnectConfigurations>
    | null
    | undefined;
  connectConfigurationId?: string | null | undefined;
  connectBuildsEnabled?: boolean | undefined;
  passiveConnectConfigurationId?: string | null | undefined;
  createdAt?: number | undefined;
  customerSupportCodeVisibility?: boolean | undefined;
  crons?: GetMicrofrontendsInGroupCrons | undefined;
  dataCache?: GetMicrofrontendsInGroupDataCache | undefined;
  /**
   * Retention policies for deployments. These are enforced at the project level, but we also maintain an instance of this at the team level as a default policy that gets applied to new projects.
   */
  deploymentExpiration: GetMicrofrontendsInGroupDeploymentExpiration;
  expiration?: GetMicrofrontendsInGroupExpiration | undefined;
  devCommand?: string | null | undefined;
  directoryListing: boolean;
  installCommand?: string | null | undefined;
  env?: Array<GetMicrofrontendsInGroupEnv> | undefined;
  customEnvironments?:
    | Array<GetMicrofrontendsInGroupCustomEnvironments>
    | undefined;
  framework?: GetMicrofrontendsInGroupFramework | null | undefined;
  services?: Array<GetMicrofrontendsInGroupServices> | undefined;
  gitForkProtection?: boolean | undefined;
  gitLFS?: boolean | undefined;
  id: string;
  ipBuckets?: Array<GetMicrofrontendsInGroupIpBuckets> | undefined;
  jobs?: GetMicrofrontendsInGroupJobs | undefined;
  latestDeployments?:
    | Array<GetMicrofrontendsInGroupLatestDeployments>
    | undefined;
  link?: GetMicrofrontendsInGroupLink | undefined;
  blobs?: GetMicrofrontendsInGroupBlobs | undefined;
  microfrontends?: GetMicrofrontendsInGroupMicrofrontends | undefined;
  name: string;
  nodeVersion: GetMicrofrontendsInGroupNodeVersion;
  optionsAllowlist?:
    | GetMicrofrontendsInGroupOptionsAllowlist
    | null
    | undefined;
  outputDirectory?: string | null | undefined;
  passwordProtection?:
    | GetMicrofrontendsInGroupPasswordProtection
    | null
    | undefined;
  passport?: GetMicrofrontendsInGroupPassport | null | undefined;
  protectionConfig?: GetMicrofrontendsInGroupProtectionConfig | undefined;
  sandbox?: GetMicrofrontendsInGroupSandbox | undefined;
  productionDeploymentsFastLane?: boolean | undefined;
  resourceConfig: GetMicrofrontendsInGroupResourceConfig;
  /**
   * Description of why a project was rolled back, and by whom. Note that lastAliasRequest contains the from/to details of the rollback.
   */
  rollbackDescription?: GetMicrofrontendsInGroupRollbackDescription | undefined;
  /**
   * Project-level rolling release configuration that defines how deployments should be gradually rolled out
   */
  rollingRelease?: GetMicrofrontendsInGroupRollingRelease | null | undefined;
  defaultResourceConfig: GetMicrofrontendsInGroupDefaultResourceConfig;
  rootDirectory?: string | null | undefined;
  serverlessFunctionZeroConfigFailover?: boolean | undefined;
  skewProtectionBoundaryAt?: number | undefined;
  skewProtectionMaxAge?: number | undefined;
  skewProtectionAllowedDomains?: Array<string> | undefined;
  skipGitConnectDuringLink?: boolean | undefined;
  staticIps?: GetMicrofrontendsInGroupStaticIps | undefined;
  sourceFilesOutsideRootDirectory?: boolean | undefined;
  enableAffectedProjectsDeployments?: boolean | undefined;
  enableExternalRewriteCaching?: boolean | undefined;
  ssoProtection?: GetMicrofrontendsInGroupSsoProtection | null | undefined;
  targets?: { [k: string]: GetMicrofrontendsInGroupTargets | null } | undefined;
  transferCompletedAt?: number | undefined;
  transferStartedAt?: number | undefined;
  transferToAccountId?: string | undefined;
  transferredFromAccountId?: string | undefined;
  updatedAt?: number | undefined;
  live?: boolean | undefined;
  enablePreviewFeedback?: boolean | null | undefined;
  enableProductionFeedback?: boolean | null | undefined;
  permissions?: GetMicrofrontendsInGroupPermissions | undefined;
  lastRollbackTarget?:
    | GetMicrofrontendsInGroupLastRollbackTarget
    | null
    | undefined;
  lastAliasRequest?:
    | GetMicrofrontendsInGroupLastAliasRequest
    | null
    | undefined;
  protectionBypass?:
    | { [k: string]: GetMicrofrontendsInGroupProtectionBypass }
    | undefined;
  hasActiveBranches?: boolean | undefined;
  trustedIps?: GetMicrofrontendsInGroupTrustedIps | null | undefined;
  trustedSources?: GetMicrofrontendsInGroupTrustedSources | null | undefined;
  gitComments?: GetMicrofrontendsInGroupGitComments | undefined;
  gitProviderOptions?: GetMicrofrontendsInGroupGitProviderOptions | undefined;
  paused?: boolean | undefined;
  concurrencyBucketName?: string | undefined;
  webAnalytics?: GetMicrofrontendsInGroupWebAnalytics | undefined;
  security?: GetMicrofrontendsInGroupSecurity | undefined;
  oidcTokenConfig?: GetMicrofrontendsInGroupOidcTokenConfig | undefined;
  /**
   * Project shape. `null` on a rule list clears the project's override for that rule type (fall back to team for every env); omitting is equivalent. Setting `deploymentPolicy` itself to `null` clears every override at once. Kept structurally distinct from {@link TeamDeploymentPolicy} so the two storage locations don't share a type by accident.
   */
  deploymentPolicy?:
    | GetMicrofrontendsInGroupDeploymentPolicy
    | null
    | undefined;
  tier?: GetMicrofrontendsInGroupTier | undefined;
  usageStatus?: GetMicrofrontendsInGroupUsageStatus | undefined;
  features?: GetMicrofrontendsInGroupFeatures | undefined;
  v0?: boolean | undefined;
  v0Created?: boolean | undefined;
  abuse?: GetMicrofrontendsInGroupAbuse | undefined;
  internalRoutes?:
    | Array<
      | GetMicrofrontendsInGroupInternalRoutes1
      | GetMicrofrontendsInGroupInternalRoutes2
    >
    | undefined;
  hasDeployments?: boolean | undefined;
  dismissedToasts?: Array<GetMicrofrontendsInGroupDismissedToasts> | undefined;
  protectedSourcemaps?: boolean | undefined;
  tracing?: GetMicrofrontendsInGroupTracing | undefined;
  avatar?: string | null | undefined;
};

export type GetMicrofrontendsInGroupResponseBody = {
  projects: Array<GetMicrofrontendsInGroupProjects>;
};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/** @internal */
export const GetMicrofrontendsInGroupProjects$inboundSchema: z.ZodType<
  GetMicrofrontendsInGroupProjects,
  z.ZodTypeDef,
  unknown
> = z.object({
  accountId: types.string(),
  creator: types.optional(GetMicrofrontendsInGroupCreator$inboundSchema),
  alias: z.array(GetMicrofrontendsInGroupAlias$inboundSchema),
  analytics: types.optional(GetMicrofrontendsInGroupAnalytics$inboundSchema),
  appliedCve55182Migration: types.optional(types.boolean()),
  speedInsights: types.optional(
    GetMicrofrontendsInGroupSpeedInsights$inboundSchema,
  ),
  autoExposeSystemEnvs: types.optional(types.boolean()),
  autoAssignCustomDomains: types.optional(types.boolean()),
  autoAssignCustomDomainsUpdatedBy: types.optional(types.string()),
  buildCommand: z.nullable(types.string()).optional(),
  commandForIgnoringBuildStep: z.nullable(types.string()).optional(),
  connectConfigurations: z.nullable(
    z.array(GetMicrofrontendsInGroupConnectConfigurations$inboundSchema),
  ).optional(),
  connectConfigurationId: z.nullable(types.string()).optional(),
  connectBuildsEnabled: types.optional(types.boolean()),
  passiveConnectConfigurationId: z.nullable(types.string()).optional(),
  createdAt: types.optional(types.number()),
  customerSupportCodeVisibility: types.optional(types.boolean()),
  crons: types.optional(GetMicrofrontendsInGroupCrons$inboundSchema),
  dataCache: types.optional(GetMicrofrontendsInGroupDataCache$inboundSchema),
  deploymentExpiration:
    GetMicrofrontendsInGroupDeploymentExpiration$inboundSchema,
  expiration: types.optional(GetMicrofrontendsInGroupExpiration$inboundSchema),
  devCommand: z.nullable(types.string()).optional(),
  directoryListing: types.boolean(),
  installCommand: z.nullable(types.string()).optional(),
  env: types.optional(z.array(GetMicrofrontendsInGroupEnv$inboundSchema)),
  customEnvironments: types.optional(
    z.array(GetMicrofrontendsInGroupCustomEnvironments$inboundSchema),
  ),
  framework: z.nullable(GetMicrofrontendsInGroupFramework$inboundSchema)
    .optional(),
  services: types.optional(
    z.array(GetMicrofrontendsInGroupServices$inboundSchema),
  ),
  gitForkProtection: types.optional(types.boolean()),
  gitLFS: types.optional(types.boolean()),
  id: types.string(),
  ipBuckets: types.optional(
    z.array(GetMicrofrontendsInGroupIpBuckets$inboundSchema),
  ),
  jobs: types.optional(GetMicrofrontendsInGroupJobs$inboundSchema),
  latestDeployments: types.optional(
    z.array(GetMicrofrontendsInGroupLatestDeployments$inboundSchema),
  ),
  link: types.optional(GetMicrofrontendsInGroupLink$inboundSchema),
  blobs: types.optional(GetMicrofrontendsInGroupBlobs$inboundSchema),
  microfrontends: types.optional(
    GetMicrofrontendsInGroupMicrofrontends$inboundSchema,
  ),
  name: types.string(),
  nodeVersion: GetMicrofrontendsInGroupNodeVersion$inboundSchema,
  optionsAllowlist: z.nullable(
    GetMicrofrontendsInGroupOptionsAllowlist$inboundSchema,
  ).optional(),
  outputDirectory: z.nullable(types.string()).optional(),
  passwordProtection: z.nullable(
    GetMicrofrontendsInGroupPasswordProtection$inboundSchema,
  ).optional(),
  passport: z.nullable(GetMicrofrontendsInGroupPassport$inboundSchema)
    .optional(),
  protectionConfig: types.optional(
    GetMicrofrontendsInGroupProtectionConfig$inboundSchema,
  ),
  sandbox: types.optional(GetMicrofrontendsInGroupSandbox$inboundSchema),
  productionDeploymentsFastLane: types.optional(types.boolean()),
  resourceConfig: GetMicrofrontendsInGroupResourceConfig$inboundSchema,
  rollbackDescription: types.optional(
    GetMicrofrontendsInGroupRollbackDescription$inboundSchema,
  ),
  rollingRelease: z.nullable(
    GetMicrofrontendsInGroupRollingRelease$inboundSchema,
  ).optional(),
  defaultResourceConfig:
    GetMicrofrontendsInGroupDefaultResourceConfig$inboundSchema,
  rootDirectory: z.nullable(types.string()).optional(),
  serverlessFunctionZeroConfigFailover: types.optional(types.boolean()),
  skewProtectionBoundaryAt: types.optional(types.number()),
  skewProtectionMaxAge: types.optional(types.number()),
  skewProtectionAllowedDomains: types.optional(z.array(types.string())),
  skipGitConnectDuringLink: types.optional(types.boolean()),
  staticIps: types.optional(GetMicrofrontendsInGroupStaticIps$inboundSchema),
  sourceFilesOutsideRootDirectory: types.optional(types.boolean()),
  enableAffectedProjectsDeployments: types.optional(types.boolean()),
  enableExternalRewriteCaching: types.optional(types.boolean()),
  ssoProtection: z.nullable(GetMicrofrontendsInGroupSsoProtection$inboundSchema)
    .optional(),
  targets: types.optional(
    z.record(types.nullable(GetMicrofrontendsInGroupTargets$inboundSchema)),
  ),
  transferCompletedAt: types.optional(types.number()),
  transferStartedAt: types.optional(types.number()),
  transferToAccountId: types.optional(types.string()),
  transferredFromAccountId: types.optional(types.string()),
  updatedAt: types.optional(types.number()),
  live: types.optional(types.boolean()),
  enablePreviewFeedback: z.nullable(types.boolean()).optional(),
  enableProductionFeedback: z.nullable(types.boolean()).optional(),
  permissions: types.optional(
    GetMicrofrontendsInGroupPermissions$inboundSchema,
  ),
  lastRollbackTarget: z.nullable(
    GetMicrofrontendsInGroupLastRollbackTarget$inboundSchema,
  ).optional(),
  lastAliasRequest: z.nullable(
    GetMicrofrontendsInGroupLastAliasRequest$inboundSchema,
  ).optional(),
  protectionBypass: types.optional(
    z.record(GetMicrofrontendsInGroupProtectionBypass$inboundSchema),
  ),
  hasActiveBranches: types.optional(types.boolean()),
  trustedIps: z.nullable(GetMicrofrontendsInGroupTrustedIps$inboundSchema)
    .optional(),
  trustedSources: z.nullable(
    GetMicrofrontendsInGroupTrustedSources$inboundSchema,
  ).optional(),
  gitComments: types.optional(
    GetMicrofrontendsInGroupGitComments$inboundSchema,
  ),
  gitProviderOptions: types.optional(
    GetMicrofrontendsInGroupGitProviderOptions$inboundSchema,
  ),
  paused: types.optional(types.boolean()),
  concurrencyBucketName: types.optional(types.string()),
  webAnalytics: types.optional(
    GetMicrofrontendsInGroupWebAnalytics$inboundSchema,
  ),
  security: types.optional(GetMicrofrontendsInGroupSecurity$inboundSchema),
  oidcTokenConfig: types.optional(
    GetMicrofrontendsInGroupOidcTokenConfig$inboundSchema,
  ),
  deploymentPolicy: z.nullable(
    GetMicrofrontendsInGroupDeploymentPolicy$inboundSchema,
  ).optional(),
  tier: types.optional(GetMicrofrontendsInGroupTier$inboundSchema),
  usageStatus: types.optional(
    GetMicrofrontendsInGroupUsageStatus$inboundSchema,
  ),
  features: types.optional(GetMicrofrontendsInGroupFeatures$inboundSchema),
  v0: types.optional(types.boolean()),
  v0Created: types.optional(types.boolean()),
  abuse: types.optional(GetMicrofrontendsInGroupAbuse$inboundSchema),
  internalRoutes: types.optional(
    z.array(smartUnion([
      z.lazy(() => GetMicrofrontendsInGroupInternalRoutes1$inboundSchema),
      GetMicrofrontendsInGroupInternalRoutes2$inboundSchema,
    ])),
  ),
  hasDeployments: types.optional(types.boolean()),
  dismissedToasts: types.optional(
    z.array(
      z.lazy(() => GetMicrofrontendsInGroupDismissedToasts$inboundSchema),
    ),
  ),
  protectedSourcemaps: types.optional(types.boolean()),
  tracing: types.optional(
    z.lazy(() => GetMicrofrontendsInGroupTracing$inboundSchema),
  ),
  avatar: z.nullable(types.string()).optional(),
});

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

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

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