/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../lib/primitives.js";
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
/**
 * The default redirect URI to use after successful SAML authentication.
 */
export const DefaultRedirectUri = {
    VercelCom: "vercel.com",
    V0Dev: "v0.dev",
    V0App: "v0.app",
};
export const Roles2 = {
    Owner: "OWNER",
    Member: "MEMBER",
    Developer: "DEVELOPER",
    Security: "SECURITY",
    Billing: "BILLING",
    Viewer: "VIEWER",
    ViewerForPlus: "VIEWER_FOR_PLUS",
    Contributor: "CONTRIBUTOR",
};
/**
 * Whether toolbar is enabled on preview deployments
 */
export const EnablePreviewFeedback = {
    Default: "default",
    On: "on",
    Off: "off",
    OnForce: "on-force",
    OffForce: "off-force",
    DefaultForce: "default-force",
};
/**
 * Whether toolbar is enabled on production deployments
 */
export const EnableProductionFeedback = {
    Default: "default",
    On: "on",
    Off: "off",
    OnForce: "on-force",
    OffForce: "off-force",
    DefaultForce: "default-force",
};
/**
 * Sensitive environment variable policy for this team
 */
export const SensitiveEnvironmentVariablePolicy = {
    Default: "default",
    On: "on",
    Off: "off",
};
export const Role = {
    Owner: "OWNER",
    Member: "MEMBER",
    Developer: "DEVELOPER",
    Security: "SECURITY",
    Billing: "BILLING",
    Viewer: "VIEWER",
    ViewerForPlus: "VIEWER_FOR_PLUS",
    Contributor: "CONTRIBUTOR",
};
export const TeamRoles = {
    Owner: "OWNER",
    Member: "MEMBER",
    Developer: "DEVELOPER",
    Security: "SECURITY",
    Billing: "BILLING",
    Viewer: "VIEWER",
    ViewerForPlus: "VIEWER_FOR_PLUS",
    Contributor: "CONTRIBUTOR",
};
export const TeamPermissions = {
    CreateProject: "CreateProject",
    FullProductionDeployment: "FullProductionDeployment",
    UsageViewer: "UsageViewer",
    EnvVariableManager: "EnvVariableManager",
    EnvironmentManager: "EnvironmentManager",
    V0Builder: "V0Builder",
    V0Chatter: "V0Chatter",
    V0Viewer: "V0Viewer",
};
export const Origin = {
    Link: "link",
    Saml: "saml",
    Mail: "mail",
    Import: "import",
    Teams: "teams",
    Github: "github",
    Gitlab: "gitlab",
    Bitbucket: "bitbucket",
    Dsync: "dsync",
    Feedback: "feedback",
    OrganizationTeams: "organization-teams",
};
/** @internal */
export const Connect$inboundSchema = z.object({
    enabled: z.boolean().optional(),
});
/** @internal */
export const Connect$outboundSchema = z.object({
    enabled: z.boolean().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Connect$;
(function (Connect$) {
    /** @deprecated use `Connect$inboundSchema` instead. */
    Connect$.inboundSchema = Connect$inboundSchema;
    /** @deprecated use `Connect$outboundSchema` instead. */
    Connect$.outboundSchema = Connect$outboundSchema;
})(Connect$ || (Connect$ = {}));
export function connectToJSON(connect) {
    return JSON.stringify(Connect$outboundSchema.parse(connect));
}
export function connectFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Connect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connect' from JSON`);
}
/** @internal */
export const Connection$inboundSchema = z.object({
    type: z.string(),
    status: z.string(),
    state: z.string(),
    connectedAt: z.number(),
    lastReceivedWebhookEvent: z.number().optional(),
});
/** @internal */
export const Connection$outboundSchema = z.object({
    type: z.string(),
    status: z.string(),
    state: z.string(),
    connectedAt: z.number(),
    lastReceivedWebhookEvent: z.number().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Connection$;
(function (Connection$) {
    /** @deprecated use `Connection$inboundSchema` instead. */
    Connection$.inboundSchema = Connection$inboundSchema;
    /** @deprecated use `Connection$outboundSchema` instead. */
    Connection$.outboundSchema = Connection$outboundSchema;
})(Connection$ || (Connection$ = {}));
export function connectionToJSON(connection) {
    return JSON.stringify(Connection$outboundSchema.parse(connection));
}
export function connectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Connection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connection' from JSON`);
}
/** @internal */
export const Directory$inboundSchema = z.object({
    type: z.string(),
    state: z.string(),
    connectedAt: z.number(),
    lastReceivedWebhookEvent: z.number().optional(),
});
/** @internal */
export const Directory$outboundSchema = z.object({
    type: z.string(),
    state: z.string(),
    connectedAt: z.number(),
    lastReceivedWebhookEvent: z.number().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Directory$;
(function (Directory$) {
    /** @deprecated use `Directory$inboundSchema` instead. */
    Directory$.inboundSchema = Directory$inboundSchema;
    /** @deprecated use `Directory$outboundSchema` instead. */
    Directory$.outboundSchema = Directory$outboundSchema;
})(Directory$ || (Directory$ = {}));
export function directoryToJSON(directory) {
    return JSON.stringify(Directory$outboundSchema.parse(directory));
}
export function directoryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Directory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Directory' from JSON`);
}
/** @internal */
export const DefaultRedirectUri$inboundSchema = z.nativeEnum(DefaultRedirectUri);
/** @internal */
export const DefaultRedirectUri$outboundSchema = DefaultRedirectUri$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var DefaultRedirectUri$;
(function (DefaultRedirectUri$) {
    /** @deprecated use `DefaultRedirectUri$inboundSchema` instead. */
    DefaultRedirectUri$.inboundSchema = DefaultRedirectUri$inboundSchema;
    /** @deprecated use `DefaultRedirectUri$outboundSchema` instead. */
    DefaultRedirectUri$.outboundSchema = DefaultRedirectUri$outboundSchema;
})(DefaultRedirectUri$ || (DefaultRedirectUri$ = {}));
/** @internal */
export const Roles2$inboundSchema = z
    .nativeEnum(Roles2);
/** @internal */
export const Roles2$outboundSchema = Roles2$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Roles2$;
(function (Roles2$) {
    /** @deprecated use `Roles2$inboundSchema` instead. */
    Roles2$.inboundSchema = Roles2$inboundSchema;
    /** @deprecated use `Roles2$outboundSchema` instead. */
    Roles2$.outboundSchema = Roles2$outboundSchema;
})(Roles2$ || (Roles2$ = {}));
/** @internal */
export const Roles1$inboundSchema = z
    .object({
    accessGroupId: z.string(),
});
/** @internal */
export const Roles1$outboundSchema = z.object({
    accessGroupId: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Roles1$;
(function (Roles1$) {
    /** @deprecated use `Roles1$inboundSchema` instead. */
    Roles1$.inboundSchema = Roles1$inboundSchema;
    /** @deprecated use `Roles1$outboundSchema` instead. */
    Roles1$.outboundSchema = Roles1$outboundSchema;
})(Roles1$ || (Roles1$ = {}));
export function roles1ToJSON(roles1) {
    return JSON.stringify(Roles1$outboundSchema.parse(roles1));
}
export function roles1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Roles1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Roles1' from JSON`);
}
/** @internal */
export const Roles$inboundSchema = z
    .union([z.lazy(() => Roles1$inboundSchema), Roles2$inboundSchema]);
/** @internal */
export const Roles$outboundSchema = z.union([z.lazy(() => Roles1$outboundSchema), Roles2$outboundSchema]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Roles$;
(function (Roles$) {
    /** @deprecated use `Roles$inboundSchema` instead. */
    Roles$.inboundSchema = Roles$inboundSchema;
    /** @deprecated use `Roles$outboundSchema` instead. */
    Roles$.outboundSchema = Roles$outboundSchema;
})(Roles$ || (Roles$ = {}));
export function rolesToJSON(roles) {
    return JSON.stringify(Roles$outboundSchema.parse(roles));
}
export function rolesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Roles$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Roles' from JSON`);
}
/** @internal */
export const Saml$inboundSchema = z
    .object({
    connection: z.lazy(() => Connection$inboundSchema).optional(),
    directory: z.lazy(() => Directory$inboundSchema).optional(),
    enforced: z.boolean(),
    defaultRedirectUri: DefaultRedirectUri$inboundSchema.optional(),
    roles: z.record(z.union([z.lazy(() => Roles1$inboundSchema), Roles2$inboundSchema])).optional(),
});
/** @internal */
export const Saml$outboundSchema = z.object({
    connection: z.lazy(() => Connection$outboundSchema).optional(),
    directory: z.lazy(() => Directory$outboundSchema).optional(),
    enforced: z.boolean(),
    defaultRedirectUri: DefaultRedirectUri$outboundSchema.optional(),
    roles: z.record(z.union([z.lazy(() => Roles1$outboundSchema), Roles2$outboundSchema])).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Saml$;
(function (Saml$) {
    /** @deprecated use `Saml$inboundSchema` instead. */
    Saml$.inboundSchema = Saml$inboundSchema;
    /** @deprecated use `Saml$outboundSchema` instead. */
    Saml$.outboundSchema = Saml$outboundSchema;
})(Saml$ || (Saml$ = {}));
export function samlToJSON(saml) {
    return JSON.stringify(Saml$outboundSchema.parse(saml));
}
export function samlFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Saml$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Saml' from JSON`);
}
/** @internal */
export const BuildEntitlements$inboundSchema = z.object({
    enhancedBuilds: z.boolean().optional(),
});
/** @internal */
export const BuildEntitlements$outboundSchema = z.object({
    enhancedBuilds: z.boolean().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var BuildEntitlements$;
(function (BuildEntitlements$) {
    /** @deprecated use `BuildEntitlements$inboundSchema` instead. */
    BuildEntitlements$.inboundSchema = BuildEntitlements$inboundSchema;
    /** @deprecated use `BuildEntitlements$outboundSchema` instead. */
    BuildEntitlements$.outboundSchema = BuildEntitlements$outboundSchema;
})(BuildEntitlements$ || (BuildEntitlements$ = {}));
export function buildEntitlementsToJSON(buildEntitlements) {
    return JSON.stringify(BuildEntitlements$outboundSchema.parse(buildEntitlements));
}
export function buildEntitlementsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => BuildEntitlements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BuildEntitlements' from JSON`);
}
/** @internal */
export const ResourceConfig$inboundSchema = z.object({
    concurrentBuilds: z.number().optional(),
    elasticConcurrencyEnabled: z.boolean().optional(),
    edgeConfigSize: z.number().optional(),
    edgeConfigs: z.number().optional(),
    kvDatabases: z.number().optional(),
    blobStores: z.number().optional(),
    postgresDatabases: z.number().optional(),
    buildEntitlements: z.lazy(() => BuildEntitlements$inboundSchema).optional(),
});
/** @internal */
export const ResourceConfig$outboundSchema = z.object({
    concurrentBuilds: z.number().optional(),
    elasticConcurrencyEnabled: z.boolean().optional(),
    edgeConfigSize: z.number().optional(),
    edgeConfigs: z.number().optional(),
    kvDatabases: z.number().optional(),
    blobStores: z.number().optional(),
    postgresDatabases: z.number().optional(),
    buildEntitlements: z.lazy(() => BuildEntitlements$outboundSchema).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ResourceConfig$;
(function (ResourceConfig$) {
    /** @deprecated use `ResourceConfig$inboundSchema` instead. */
    ResourceConfig$.inboundSchema = ResourceConfig$inboundSchema;
    /** @deprecated use `ResourceConfig$outboundSchema` instead. */
    ResourceConfig$.outboundSchema = ResourceConfig$outboundSchema;
})(ResourceConfig$ || (ResourceConfig$ = {}));
export function resourceConfigToJSON(resourceConfig) {
    return JSON.stringify(ResourceConfig$outboundSchema.parse(resourceConfig));
}
export function resourceConfigFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ResourceConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResourceConfig' from JSON`);
}
/** @internal */
export const RemoteCaching$inboundSchema = z.object({
    enabled: z.boolean().optional(),
});
/** @internal */
export const RemoteCaching$outboundSchema = z.object({
    enabled: z.boolean().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var RemoteCaching$;
(function (RemoteCaching$) {
    /** @deprecated use `RemoteCaching$inboundSchema` instead. */
    RemoteCaching$.inboundSchema = RemoteCaching$inboundSchema;
    /** @deprecated use `RemoteCaching$outboundSchema` instead. */
    RemoteCaching$.outboundSchema = RemoteCaching$outboundSchema;
})(RemoteCaching$ || (RemoteCaching$ = {}));
export function remoteCachingToJSON(remoteCaching) {
    return JSON.stringify(RemoteCaching$outboundSchema.parse(remoteCaching));
}
export function remoteCachingFromJSON(jsonString) {
    return safeParse(jsonString, (x) => RemoteCaching$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RemoteCaching' from JSON`);
}
/** @internal */
export const PasswordProtection$inboundSchema = z.object({
    deploymentType: z.string(),
});
/** @internal */
export const PasswordProtection$outboundSchema = z.object({
    deploymentType: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PasswordProtection$;
(function (PasswordProtection$) {
    /** @deprecated use `PasswordProtection$inboundSchema` instead. */
    PasswordProtection$.inboundSchema = PasswordProtection$inboundSchema;
    /** @deprecated use `PasswordProtection$outboundSchema` instead. */
    PasswordProtection$.outboundSchema = PasswordProtection$outboundSchema;
})(PasswordProtection$ || (PasswordProtection$ = {}));
export function passwordProtectionToJSON(passwordProtection) {
    return JSON.stringify(PasswordProtection$outboundSchema.parse(passwordProtection));
}
export function passwordProtectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PasswordProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PasswordProtection' from JSON`);
}
/** @internal */
export const SsoProtection$inboundSchema = z.object({
    deploymentType: z.string(),
});
/** @internal */
export const SsoProtection$outboundSchema = z.object({
    deploymentType: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SsoProtection$;
(function (SsoProtection$) {
    /** @deprecated use `SsoProtection$inboundSchema` instead. */
    SsoProtection$.inboundSchema = SsoProtection$inboundSchema;
    /** @deprecated use `SsoProtection$outboundSchema` instead. */
    SsoProtection$.outboundSchema = SsoProtection$outboundSchema;
})(SsoProtection$ || (SsoProtection$ = {}));
export function ssoProtectionToJSON(ssoProtection) {
    return JSON.stringify(SsoProtection$outboundSchema.parse(ssoProtection));
}
export function ssoProtectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SsoProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SsoProtection' from JSON`);
}
/** @internal */
export const DefaultDeploymentProtection$inboundSchema = z.object({
    passwordProtection: z.lazy(() => PasswordProtection$inboundSchema).optional(),
    ssoProtection: z.lazy(() => SsoProtection$inboundSchema).optional(),
});
/** @internal */
export const DefaultDeploymentProtection$outboundSchema = z.object({
    passwordProtection: z.lazy(() => PasswordProtection$outboundSchema)
        .optional(),
    ssoProtection: z.lazy(() => SsoProtection$outboundSchema).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var DefaultDeploymentProtection$;
(function (DefaultDeploymentProtection$) {
    /** @deprecated use `DefaultDeploymentProtection$inboundSchema` instead. */
    DefaultDeploymentProtection$.inboundSchema = DefaultDeploymentProtection$inboundSchema;
    /** @deprecated use `DefaultDeploymentProtection$outboundSchema` instead. */
    DefaultDeploymentProtection$.outboundSchema = DefaultDeploymentProtection$outboundSchema;
})(DefaultDeploymentProtection$ || (DefaultDeploymentProtection$ = {}));
export function defaultDeploymentProtectionToJSON(defaultDeploymentProtection) {
    return JSON.stringify(DefaultDeploymentProtection$outboundSchema.parse(defaultDeploymentProtection));
}
export function defaultDeploymentProtectionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => DefaultDeploymentProtection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultDeploymentProtection' from JSON`);
}
/** @internal */
export const EnablePreviewFeedback$inboundSchema = z.nativeEnum(EnablePreviewFeedback);
/** @internal */
export const EnablePreviewFeedback$outboundSchema = EnablePreviewFeedback$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var EnablePreviewFeedback$;
(function (EnablePreviewFeedback$) {
    /** @deprecated use `EnablePreviewFeedback$inboundSchema` instead. */
    EnablePreviewFeedback$.inboundSchema = EnablePreviewFeedback$inboundSchema;
    /** @deprecated use `EnablePreviewFeedback$outboundSchema` instead. */
    EnablePreviewFeedback$.outboundSchema = EnablePreviewFeedback$outboundSchema;
})(EnablePreviewFeedback$ || (EnablePreviewFeedback$ = {}));
/** @internal */
export const EnableProductionFeedback$inboundSchema = z.nativeEnum(EnableProductionFeedback);
/** @internal */
export const EnableProductionFeedback$outboundSchema = EnableProductionFeedback$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var EnableProductionFeedback$;
(function (EnableProductionFeedback$) {
    /** @deprecated use `EnableProductionFeedback$inboundSchema` instead. */
    EnableProductionFeedback$.inboundSchema = EnableProductionFeedback$inboundSchema;
    /** @deprecated use `EnableProductionFeedback$outboundSchema` instead. */
    EnableProductionFeedback$.outboundSchema = EnableProductionFeedback$outboundSchema;
})(EnableProductionFeedback$ || (EnableProductionFeedback$ = {}));
/** @internal */
export const SensitiveEnvironmentVariablePolicy$inboundSchema = z.nativeEnum(SensitiveEnvironmentVariablePolicy);
/** @internal */
export const SensitiveEnvironmentVariablePolicy$outboundSchema = SensitiveEnvironmentVariablePolicy$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SensitiveEnvironmentVariablePolicy$;
(function (SensitiveEnvironmentVariablePolicy$) {
    /** @deprecated use `SensitiveEnvironmentVariablePolicy$inboundSchema` instead. */
    SensitiveEnvironmentVariablePolicy$.inboundSchema = SensitiveEnvironmentVariablePolicy$inboundSchema;
    /** @deprecated use `SensitiveEnvironmentVariablePolicy$outboundSchema` instead. */
    SensitiveEnvironmentVariablePolicy$.outboundSchema = SensitiveEnvironmentVariablePolicy$outboundSchema;
})(SensitiveEnvironmentVariablePolicy$ || (SensitiveEnvironmentVariablePolicy$ = {}));
/** @internal */
export const IpBuckets$inboundSchema = z.object({
    bucket: z.string(),
    supportUntil: z.number().optional(),
});
/** @internal */
export const IpBuckets$outboundSchema = z.object({
    bucket: z.string(),
    supportUntil: z.number().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var IpBuckets$;
(function (IpBuckets$) {
    /** @deprecated use `IpBuckets$inboundSchema` instead. */
    IpBuckets$.inboundSchema = IpBuckets$inboundSchema;
    /** @deprecated use `IpBuckets$outboundSchema` instead. */
    IpBuckets$.outboundSchema = IpBuckets$outboundSchema;
})(IpBuckets$ || (IpBuckets$ = {}));
export function ipBucketsToJSON(ipBuckets) {
    return JSON.stringify(IpBuckets$outboundSchema.parse(ipBuckets));
}
export function ipBucketsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => IpBuckets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IpBuckets' from JSON`);
}
/** @internal */
export const Entitlements$inboundSchema = z.object({
    entitlement: z.string(),
});
/** @internal */
export const Entitlements$outboundSchema = z.object({
    entitlement: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Entitlements$;
(function (Entitlements$) {
    /** @deprecated use `Entitlements$inboundSchema` instead. */
    Entitlements$.inboundSchema = Entitlements$inboundSchema;
    /** @deprecated use `Entitlements$outboundSchema` instead. */
    Entitlements$.outboundSchema = Entitlements$outboundSchema;
})(Entitlements$ || (Entitlements$ = {}));
export function entitlementsToJSON(entitlements) {
    return JSON.stringify(Entitlements$outboundSchema.parse(entitlements));
}
export function entitlementsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Entitlements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entitlements' from JSON`);
}
/** @internal */
export const Role$inboundSchema = z.nativeEnum(Role);
/** @internal */
export const Role$outboundSchema = Role$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Role$;
(function (Role$) {
    /** @deprecated use `Role$inboundSchema` instead. */
    Role$.inboundSchema = Role$inboundSchema;
    /** @deprecated use `Role$outboundSchema` instead. */
    Role$.outboundSchema = Role$outboundSchema;
})(Role$ || (Role$ = {}));
/** @internal */
export const TeamRoles$inboundSchema = z
    .nativeEnum(TeamRoles);
/** @internal */
export const TeamRoles$outboundSchema = TeamRoles$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TeamRoles$;
(function (TeamRoles$) {
    /** @deprecated use `TeamRoles$inboundSchema` instead. */
    TeamRoles$.inboundSchema = TeamRoles$inboundSchema;
    /** @deprecated use `TeamRoles$outboundSchema` instead. */
    TeamRoles$.outboundSchema = TeamRoles$outboundSchema;
})(TeamRoles$ || (TeamRoles$ = {}));
/** @internal */
export const TeamPermissions$inboundSchema = z.nativeEnum(TeamPermissions);
/** @internal */
export const TeamPermissions$outboundSchema = TeamPermissions$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TeamPermissions$;
(function (TeamPermissions$) {
    /** @deprecated use `TeamPermissions$inboundSchema` instead. */
    TeamPermissions$.inboundSchema = TeamPermissions$inboundSchema;
    /** @deprecated use `TeamPermissions$outboundSchema` instead. */
    TeamPermissions$.outboundSchema = TeamPermissions$outboundSchema;
})(TeamPermissions$ || (TeamPermissions$ = {}));
/** @internal */
export const Origin$inboundSchema = z
    .nativeEnum(Origin);
/** @internal */
export const Origin$outboundSchema = Origin$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Origin$;
(function (Origin$) {
    /** @deprecated use `Origin$inboundSchema` instead. */
    Origin$.inboundSchema = Origin$inboundSchema;
    /** @deprecated use `Origin$outboundSchema` instead. */
    Origin$.outboundSchema = Origin$outboundSchema;
})(Origin$ || (Origin$ = {}));
/** @internal */
export const GitUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const GitUserId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GitUserId$;
(function (GitUserId$) {
    /** @deprecated use `GitUserId$inboundSchema` instead. */
    GitUserId$.inboundSchema = GitUserId$inboundSchema;
    /** @deprecated use `GitUserId$outboundSchema` instead. */
    GitUserId$.outboundSchema = GitUserId$outboundSchema;
})(GitUserId$ || (GitUserId$ = {}));
export function gitUserIdToJSON(gitUserId) {
    return JSON.stringify(GitUserId$outboundSchema.parse(gitUserId));
}
export function gitUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GitUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GitUserId' from JSON`);
}
/** @internal */
export const JoinedFrom$inboundSchema = z.object({
    origin: Origin$inboundSchema,
    commitId: z.string().optional(),
    repoId: z.string().optional(),
    repoPath: z.string().optional(),
    gitUserId: z.union([z.string(), z.number()]).optional(),
    gitUserLogin: z.string().optional(),
    ssoUserId: z.string().optional(),
    ssoConnectedAt: z.number().optional(),
    idpUserId: z.string().optional(),
    dsyncUserId: z.string().optional(),
    dsyncConnectedAt: z.number().optional(),
});
/** @internal */
export const JoinedFrom$outboundSchema = z.object({
    origin: Origin$outboundSchema,
    commitId: z.string().optional(),
    repoId: z.string().optional(),
    repoPath: z.string().optional(),
    gitUserId: z.union([z.string(), z.number()]).optional(),
    gitUserLogin: z.string().optional(),
    ssoUserId: z.string().optional(),
    ssoConnectedAt: z.number().optional(),
    idpUserId: z.string().optional(),
    dsyncUserId: z.string().optional(),
    dsyncConnectedAt: z.number().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var JoinedFrom$;
(function (JoinedFrom$) {
    /** @deprecated use `JoinedFrom$inboundSchema` instead. */
    JoinedFrom$.inboundSchema = JoinedFrom$inboundSchema;
    /** @deprecated use `JoinedFrom$outboundSchema` instead. */
    JoinedFrom$.outboundSchema = JoinedFrom$outboundSchema;
})(JoinedFrom$ || (JoinedFrom$ = {}));
export function joinedFromToJSON(joinedFrom) {
    return JSON.stringify(JoinedFrom$outboundSchema.parse(joinedFrom));
}
export function joinedFromFromJSON(jsonString) {
    return safeParse(jsonString, (x) => JoinedFrom$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JoinedFrom' from JSON`);
}
/** @internal */
export const Membership$inboundSchema = z.object({
    uid: z.string().optional(),
    entitlements: z.array(z.lazy(() => Entitlements$inboundSchema)).optional(),
    teamId: z.string().optional(),
    confirmed: z.boolean(),
    accessRequestedAt: z.number().optional(),
    role: Role$inboundSchema,
    teamRoles: z.array(TeamRoles$inboundSchema).optional(),
    teamPermissions: z.array(TeamPermissions$inboundSchema).optional(),
    createdAt: z.number(),
    created: z.number(),
    joinedFrom: z.lazy(() => JoinedFrom$inboundSchema).optional(),
});
/** @internal */
export const Membership$outboundSchema = z.object({
    uid: z.string().optional(),
    entitlements: z.array(z.lazy(() => Entitlements$outboundSchema)).optional(),
    teamId: z.string().optional(),
    confirmed: z.boolean(),
    accessRequestedAt: z.number().optional(),
    role: Role$outboundSchema,
    teamRoles: z.array(TeamRoles$outboundSchema).optional(),
    teamPermissions: z.array(TeamPermissions$outboundSchema).optional(),
    createdAt: z.number(),
    created: z.number(),
    joinedFrom: z.lazy(() => JoinedFrom$outboundSchema).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Membership$;
(function (Membership$) {
    /** @deprecated use `Membership$inboundSchema` instead. */
    Membership$.inboundSchema = Membership$inboundSchema;
    /** @deprecated use `Membership$outboundSchema` instead. */
    Membership$.outboundSchema = Membership$outboundSchema;
})(Membership$ || (Membership$ = {}));
export function membershipToJSON(membership) {
    return JSON.stringify(Membership$outboundSchema.parse(membership));
}
export function membershipFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Membership$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Membership' from JSON`);
}
/** @internal */
export const Team$inboundSchema = collectExtraKeys$(z.object({
    connect: z.lazy(() => Connect$inboundSchema).optional(),
    creatorId: z.string(),
    updatedAt: z.number(),
    emailDomain: z.nullable(z.string()).optional(),
    saml: z.lazy(() => Saml$inboundSchema).optional(),
    inviteCode: z.string().optional(),
    description: z.nullable(z.string()),
    stagingPrefix: z.string(),
    resourceConfig: z.lazy(() => ResourceConfig$inboundSchema).optional(),
    previewDeploymentSuffix: z.nullable(z.string()).optional(),
    remoteCaching: z.lazy(() => RemoteCaching$inboundSchema).optional(),
    defaultDeploymentProtection: z.lazy(() => DefaultDeploymentProtection$inboundSchema).optional(),
    enablePreviewFeedback: z.nullable(EnablePreviewFeedback$inboundSchema)
        .optional(),
    enableProductionFeedback: z.nullable(EnableProductionFeedback$inboundSchema).optional(),
    sensitiveEnvironmentVariablePolicy: z.nullable(SensitiveEnvironmentVariablePolicy$inboundSchema).optional(),
    hideIpAddresses: z.nullable(z.boolean()).optional(),
    hideIpAddressesInLogDrains: z.nullable(z.boolean()).optional(),
    ipBuckets: z.array(z.lazy(() => IpBuckets$inboundSchema)).optional(),
    id: z.string(),
    slug: z.string(),
    name: z.nullable(z.string()),
    avatar: z.nullable(z.string()),
    membership: z.lazy(() => Membership$inboundSchema),
    createdAt: z.number(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const Team$outboundSchema = z.object({
    connect: z.lazy(() => Connect$outboundSchema).optional(),
    creatorId: z.string(),
    updatedAt: z.number(),
    emailDomain: z.nullable(z.string()).optional(),
    saml: z.lazy(() => Saml$outboundSchema).optional(),
    inviteCode: z.string().optional(),
    description: z.nullable(z.string()),
    stagingPrefix: z.string(),
    resourceConfig: z.lazy(() => ResourceConfig$outboundSchema).optional(),
    previewDeploymentSuffix: z.nullable(z.string()).optional(),
    remoteCaching: z.lazy(() => RemoteCaching$outboundSchema).optional(),
    defaultDeploymentProtection: z.lazy(() => DefaultDeploymentProtection$outboundSchema).optional(),
    enablePreviewFeedback: z.nullable(EnablePreviewFeedback$outboundSchema)
        .optional(),
    enableProductionFeedback: z.nullable(EnableProductionFeedback$outboundSchema).optional(),
    sensitiveEnvironmentVariablePolicy: z.nullable(SensitiveEnvironmentVariablePolicy$outboundSchema).optional(),
    hideIpAddresses: z.nullable(z.boolean()).optional(),
    hideIpAddressesInLogDrains: z.nullable(z.boolean()).optional(),
    ipBuckets: z.array(z.lazy(() => IpBuckets$outboundSchema)).optional(),
    id: z.string(),
    slug: z.string(),
    name: z.nullable(z.string()),
    avatar: z.nullable(z.string()),
    membership: z.lazy(() => Membership$outboundSchema),
    createdAt: z.number(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Team$;
(function (Team$) {
    /** @deprecated use `Team$inboundSchema` instead. */
    Team$.inboundSchema = Team$inboundSchema;
    /** @deprecated use `Team$outboundSchema` instead. */
    Team$.outboundSchema = Team$outboundSchema;
})(Team$ || (Team$ = {}));
export function teamToJSON(team) {
    return JSON.stringify(Team$outboundSchema.parse(team));
}
export function teamFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Team$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Team' from JSON`);
}
//# sourceMappingURL=team.js.map