/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../lib/schemas.js";
export const GetAliasProtectionBypassAliasesResponseScope = {
    EmailInvite: "email_invite",
};
export const GetAliasProtectionBypassAliasesScope = {
    AliasProtectionOverride: "alias-protection-override",
};
export const ProtectionBypassAccess = {
    Requested: "requested",
    Granted: "granted",
};
export const GetAliasProtectionBypassScope = {
    User: "user",
};
export const ProtectionBypassScope = {
    ShareableLink: "shareable-link",
};
/** @internal */
export const GetAliasRequest$inboundSchema = z.object({
    from: z.number().optional(),
    idOrAlias: z.string(),
    projectId: z.string().optional(),
    since: z.number().optional(),
    until: z.number().optional(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
/** @internal */
export const GetAliasRequest$outboundSchema = z.object({
    from: z.number().optional(),
    idOrAlias: z.string(),
    projectId: z.string().optional(),
    since: z.number().optional(),
    until: z.number().optional(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasRequest$;
(function (GetAliasRequest$) {
    /** @deprecated use `GetAliasRequest$inboundSchema` instead. */
    GetAliasRequest$.inboundSchema = GetAliasRequest$inboundSchema;
    /** @deprecated use `GetAliasRequest$outboundSchema` instead. */
    GetAliasRequest$.outboundSchema = GetAliasRequest$outboundSchema;
})(GetAliasRequest$ || (GetAliasRequest$ = {}));
export function getAliasRequestToJSON(getAliasRequest) {
    return JSON.stringify(GetAliasRequest$outboundSchema.parse(getAliasRequest));
}
export function getAliasRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAliasRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAliasRequest' from JSON`);
}
/** @internal */
export const GetAliasCreator$inboundSchema = z.object({
    uid: z.string(),
    email: z.string(),
    username: z.string(),
});
/** @internal */
export const GetAliasCreator$outboundSchema = z.object({
    uid: z.string(),
    email: z.string(),
    username: 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 GetAliasCreator$;
(function (GetAliasCreator$) {
    /** @deprecated use `GetAliasCreator$inboundSchema` instead. */
    GetAliasCreator$.inboundSchema = GetAliasCreator$inboundSchema;
    /** @deprecated use `GetAliasCreator$outboundSchema` instead. */
    GetAliasCreator$.outboundSchema = GetAliasCreator$outboundSchema;
})(GetAliasCreator$ || (GetAliasCreator$ = {}));
export function getAliasCreatorToJSON(getAliasCreator) {
    return JSON.stringify(GetAliasCreator$outboundSchema.parse(getAliasCreator));
}
export function getAliasCreatorFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAliasCreator$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAliasCreator' from JSON`);
}
/** @internal */
export const GetAliasDeployment$inboundSchema = z.object({
    id: z.string(),
    url: z.string(),
    meta: z.string().optional(),
});
/** @internal */
export const GetAliasDeployment$outboundSchema = z.object({
    id: z.string(),
    url: z.string(),
    meta: z.string().optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasDeployment$;
(function (GetAliasDeployment$) {
    /** @deprecated use `GetAliasDeployment$inboundSchema` instead. */
    GetAliasDeployment$.inboundSchema = GetAliasDeployment$inboundSchema;
    /** @deprecated use `GetAliasDeployment$outboundSchema` instead. */
    GetAliasDeployment$.outboundSchema = GetAliasDeployment$outboundSchema;
})(GetAliasDeployment$ || (GetAliasDeployment$ = {}));
export function getAliasDeploymentToJSON(getAliasDeployment) {
    return JSON.stringify(GetAliasDeployment$outboundSchema.parse(getAliasDeployment));
}
export function getAliasDeploymentFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAliasDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAliasDeployment' from JSON`);
}
/** @internal */
export const GetAliasProtectionBypassAliasesResponseScope$inboundSchema = z
    .nativeEnum(GetAliasProtectionBypassAliasesResponseScope);
/** @internal */
export const GetAliasProtectionBypassAliasesResponseScope$outboundSchema = GetAliasProtectionBypassAliasesResponseScope$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasProtectionBypassAliasesResponseScope$;
(function (GetAliasProtectionBypassAliasesResponseScope$) {
    /** @deprecated use `GetAliasProtectionBypassAliasesResponseScope$inboundSchema` instead. */
    GetAliasProtectionBypassAliasesResponseScope$.inboundSchema = GetAliasProtectionBypassAliasesResponseScope$inboundSchema;
    /** @deprecated use `GetAliasProtectionBypassAliasesResponseScope$outboundSchema` instead. */
    GetAliasProtectionBypassAliasesResponseScope$.outboundSchema = GetAliasProtectionBypassAliasesResponseScope$outboundSchema;
})(GetAliasProtectionBypassAliasesResponseScope$ || (GetAliasProtectionBypassAliasesResponseScope$ = {}));
/** @internal */
export const ProtectionBypass4$inboundSchema = z.object({
    createdAt: z.number(),
    lastUpdatedAt: z.number(),
    lastUpdatedBy: z.string(),
    scope: GetAliasProtectionBypassAliasesResponseScope$inboundSchema,
});
/** @internal */
export const ProtectionBypass4$outboundSchema = z.object({
    createdAt: z.number(),
    lastUpdatedAt: z.number(),
    lastUpdatedBy: z.string(),
    scope: GetAliasProtectionBypassAliasesResponseScope$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypass4$;
(function (ProtectionBypass4$) {
    /** @deprecated use `ProtectionBypass4$inboundSchema` instead. */
    ProtectionBypass4$.inboundSchema = ProtectionBypass4$inboundSchema;
    /** @deprecated use `ProtectionBypass4$outboundSchema` instead. */
    ProtectionBypass4$.outboundSchema = ProtectionBypass4$outboundSchema;
})(ProtectionBypass4$ || (ProtectionBypass4$ = {}));
export function protectionBypass4ToJSON(protectionBypass4) {
    return JSON.stringify(ProtectionBypass4$outboundSchema.parse(protectionBypass4));
}
export function protectionBypass4FromJSON(jsonString) {
    return safeParse(jsonString, (x) => ProtectionBypass4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProtectionBypass4' from JSON`);
}
/** @internal */
export const GetAliasProtectionBypassAliasesScope$inboundSchema = z.nativeEnum(GetAliasProtectionBypassAliasesScope);
/** @internal */
export const GetAliasProtectionBypassAliasesScope$outboundSchema = GetAliasProtectionBypassAliasesScope$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasProtectionBypassAliasesScope$;
(function (GetAliasProtectionBypassAliasesScope$) {
    /** @deprecated use `GetAliasProtectionBypassAliasesScope$inboundSchema` instead. */
    GetAliasProtectionBypassAliasesScope$.inboundSchema = GetAliasProtectionBypassAliasesScope$inboundSchema;
    /** @deprecated use `GetAliasProtectionBypassAliasesScope$outboundSchema` instead. */
    GetAliasProtectionBypassAliasesScope$.outboundSchema = GetAliasProtectionBypassAliasesScope$outboundSchema;
})(GetAliasProtectionBypassAliasesScope$ || (GetAliasProtectionBypassAliasesScope$ = {}));
/** @internal */
export const ProtectionBypass3$inboundSchema = z.object({
    createdAt: z.number(),
    createdBy: z.string(),
    scope: GetAliasProtectionBypassAliasesScope$inboundSchema,
});
/** @internal */
export const ProtectionBypass3$outboundSchema = z.object({
    createdAt: z.number(),
    createdBy: z.string(),
    scope: GetAliasProtectionBypassAliasesScope$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypass3$;
(function (ProtectionBypass3$) {
    /** @deprecated use `ProtectionBypass3$inboundSchema` instead. */
    ProtectionBypass3$.inboundSchema = ProtectionBypass3$inboundSchema;
    /** @deprecated use `ProtectionBypass3$outboundSchema` instead. */
    ProtectionBypass3$.outboundSchema = ProtectionBypass3$outboundSchema;
})(ProtectionBypass3$ || (ProtectionBypass3$ = {}));
export function protectionBypass3ToJSON(protectionBypass3) {
    return JSON.stringify(ProtectionBypass3$outboundSchema.parse(protectionBypass3));
}
export function protectionBypass3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => ProtectionBypass3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProtectionBypass3' from JSON`);
}
/** @internal */
export const ProtectionBypassAccess$inboundSchema = z.nativeEnum(ProtectionBypassAccess);
/** @internal */
export const ProtectionBypassAccess$outboundSchema = ProtectionBypassAccess$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypassAccess$;
(function (ProtectionBypassAccess$) {
    /** @deprecated use `ProtectionBypassAccess$inboundSchema` instead. */
    ProtectionBypassAccess$.inboundSchema = ProtectionBypassAccess$inboundSchema;
    /** @deprecated use `ProtectionBypassAccess$outboundSchema` instead. */
    ProtectionBypassAccess$.outboundSchema = ProtectionBypassAccess$outboundSchema;
})(ProtectionBypassAccess$ || (ProtectionBypassAccess$ = {}));
/** @internal */
export const GetAliasProtectionBypassScope$inboundSchema = z.nativeEnum(GetAliasProtectionBypassScope);
/** @internal */
export const GetAliasProtectionBypassScope$outboundSchema = GetAliasProtectionBypassScope$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasProtectionBypassScope$;
(function (GetAliasProtectionBypassScope$) {
    /** @deprecated use `GetAliasProtectionBypassScope$inboundSchema` instead. */
    GetAliasProtectionBypassScope$.inboundSchema = GetAliasProtectionBypassScope$inboundSchema;
    /** @deprecated use `GetAliasProtectionBypassScope$outboundSchema` instead. */
    GetAliasProtectionBypassScope$.outboundSchema = GetAliasProtectionBypassScope$outboundSchema;
})(GetAliasProtectionBypassScope$ || (GetAliasProtectionBypassScope$ = {}));
/** @internal */
export const ProtectionBypass2$inboundSchema = z.object({
    createdAt: z.number(),
    lastUpdatedAt: z.number(),
    lastUpdatedBy: z.string(),
    access: ProtectionBypassAccess$inboundSchema,
    scope: GetAliasProtectionBypassScope$inboundSchema,
});
/** @internal */
export const ProtectionBypass2$outboundSchema = z.object({
    createdAt: z.number(),
    lastUpdatedAt: z.number(),
    lastUpdatedBy: z.string(),
    access: ProtectionBypassAccess$outboundSchema,
    scope: GetAliasProtectionBypassScope$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypass2$;
(function (ProtectionBypass2$) {
    /** @deprecated use `ProtectionBypass2$inboundSchema` instead. */
    ProtectionBypass2$.inboundSchema = ProtectionBypass2$inboundSchema;
    /** @deprecated use `ProtectionBypass2$outboundSchema` instead. */
    ProtectionBypass2$.outboundSchema = ProtectionBypass2$outboundSchema;
})(ProtectionBypass2$ || (ProtectionBypass2$ = {}));
export function protectionBypass2ToJSON(protectionBypass2) {
    return JSON.stringify(ProtectionBypass2$outboundSchema.parse(protectionBypass2));
}
export function protectionBypass2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => ProtectionBypass2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProtectionBypass2' from JSON`);
}
/** @internal */
export const ProtectionBypassScope$inboundSchema = z.nativeEnum(ProtectionBypassScope);
/** @internal */
export const ProtectionBypassScope$outboundSchema = ProtectionBypassScope$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypassScope$;
(function (ProtectionBypassScope$) {
    /** @deprecated use `ProtectionBypassScope$inboundSchema` instead. */
    ProtectionBypassScope$.inboundSchema = ProtectionBypassScope$inboundSchema;
    /** @deprecated use `ProtectionBypassScope$outboundSchema` instead. */
    ProtectionBypassScope$.outboundSchema = ProtectionBypassScope$outboundSchema;
})(ProtectionBypassScope$ || (ProtectionBypassScope$ = {}));
/** @internal */
export const ProtectionBypass1$inboundSchema = z.object({
    createdAt: z.number(),
    createdBy: z.string(),
    scope: ProtectionBypassScope$inboundSchema,
});
/** @internal */
export const ProtectionBypass1$outboundSchema = z.object({
    createdAt: z.number(),
    createdBy: z.string(),
    scope: ProtectionBypassScope$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ProtectionBypass1$;
(function (ProtectionBypass1$) {
    /** @deprecated use `ProtectionBypass1$inboundSchema` instead. */
    ProtectionBypass1$.inboundSchema = ProtectionBypass1$inboundSchema;
    /** @deprecated use `ProtectionBypass1$outboundSchema` instead. */
    ProtectionBypass1$.outboundSchema = ProtectionBypass1$outboundSchema;
})(ProtectionBypass1$ || (ProtectionBypass1$ = {}));
export function protectionBypass1ToJSON(protectionBypass1) {
    return JSON.stringify(ProtectionBypass1$outboundSchema.parse(protectionBypass1));
}
export function protectionBypass1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => ProtectionBypass1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProtectionBypass1' from JSON`);
}
/** @internal */
export const GetAliasProtectionBypass$inboundSchema = z.union([
    z.lazy(() => ProtectionBypass1$inboundSchema),
    z.lazy(() => ProtectionBypass3$inboundSchema),
    z.lazy(() => ProtectionBypass4$inboundSchema),
    z.lazy(() => ProtectionBypass2$inboundSchema),
]);
/** @internal */
export const GetAliasProtectionBypass$outboundSchema = z.union([
    z.lazy(() => ProtectionBypass1$outboundSchema),
    z.lazy(() => ProtectionBypass3$outboundSchema),
    z.lazy(() => ProtectionBypass4$outboundSchema),
    z.lazy(() => ProtectionBypass2$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GetAliasProtectionBypass$;
(function (GetAliasProtectionBypass$) {
    /** @deprecated use `GetAliasProtectionBypass$inboundSchema` instead. */
    GetAliasProtectionBypass$.inboundSchema = GetAliasProtectionBypass$inboundSchema;
    /** @deprecated use `GetAliasProtectionBypass$outboundSchema` instead. */
    GetAliasProtectionBypass$.outboundSchema = GetAliasProtectionBypass$outboundSchema;
})(GetAliasProtectionBypass$ || (GetAliasProtectionBypass$ = {}));
export function getAliasProtectionBypassToJSON(getAliasProtectionBypass) {
    return JSON.stringify(GetAliasProtectionBypass$outboundSchema.parse(getAliasProtectionBypass));
}
export function getAliasProtectionBypassFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAliasProtectionBypass$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAliasProtectionBypass' from JSON`);
}
/** @internal */
export const GetAliasResponseBody$inboundSchema = z.object({
    alias: z.string(),
    created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    createdAt: z.nullable(z.number()).optional(),
    creator: z.lazy(() => GetAliasCreator$inboundSchema).optional(),
    deletedAt: z.nullable(z.number()).optional(),
    deployment: z.lazy(() => GetAliasDeployment$inboundSchema).optional(),
    deploymentId: z.nullable(z.string()),
    projectId: z.nullable(z.string()),
    redirect: z.nullable(z.string()).optional(),
    redirectStatusCode: z.nullable(z.number()).optional(),
    uid: z.string(),
    updatedAt: z.nullable(z.number()).optional(),
    protectionBypass: z.record(z.union([
        z.lazy(() => ProtectionBypass1$inboundSchema),
        z.lazy(() => ProtectionBypass3$inboundSchema),
        z.lazy(() => ProtectionBypass4$inboundSchema),
        z.lazy(() => ProtectionBypass2$inboundSchema),
    ])).optional(),
});
/** @internal */
export const GetAliasResponseBody$outboundSchema = z.object({
    alias: z.string(),
    created: z.date().transform(v => v.toISOString()),
    createdAt: z.nullable(z.number()).optional(),
    creator: z.lazy(() => GetAliasCreator$outboundSchema).optional(),
    deletedAt: z.nullable(z.number()).optional(),
    deployment: z.lazy(() => GetAliasDeployment$outboundSchema).optional(),
    deploymentId: z.nullable(z.string()),
    projectId: z.nullable(z.string()),
    redirect: z.nullable(z.string()).optional(),
    redirectStatusCode: z.nullable(z.number()).optional(),
    uid: z.string(),
    updatedAt: z.nullable(z.number()).optional(),
    protectionBypass: z.record(z.union([
        z.lazy(() => ProtectionBypass1$outboundSchema),
        z.lazy(() => ProtectionBypass3$outboundSchema),
        z.lazy(() => ProtectionBypass4$outboundSchema),
        z.lazy(() => ProtectionBypass2$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 GetAliasResponseBody$;
(function (GetAliasResponseBody$) {
    /** @deprecated use `GetAliasResponseBody$inboundSchema` instead. */
    GetAliasResponseBody$.inboundSchema = GetAliasResponseBody$inboundSchema;
    /** @deprecated use `GetAliasResponseBody$outboundSchema` instead. */
    GetAliasResponseBody$.outboundSchema = GetAliasResponseBody$outboundSchema;
})(GetAliasResponseBody$ || (GetAliasResponseBody$ = {}));
export function getAliasResponseBodyToJSON(getAliasResponseBody) {
    return JSON.stringify(GetAliasResponseBody$outboundSchema.parse(getAliasResponseBody));
}
export function getAliasResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GetAliasResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAliasResponseBody' from JSON`);
}
//# sourceMappingURL=getaliasop.js.map