/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
export const RequestBodyScope = {
    AliasProtectionOverride: "alias-protection-override",
};
export const PatchAliasesIdProtectionBypassRequestBodyAction = {
    Create: "create",
    Revoke: "revoke",
};
/**
 * Invitation status for the user scoped bypass.
 */
export const ScopeAccess = {
    Denied: "denied",
    Granted: "granted",
};
/**
 * Invitation status for the user scoped bypass.
 */
export const Access = {
    Denied: "denied",
    Granted: "granted",
};
/** @internal */
export const RequestBodyScope$inboundSchema = z.nativeEnum(RequestBodyScope);
/** @internal */
export const RequestBodyScope$outboundSchema = RequestBodyScope$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var RequestBodyScope$;
(function (RequestBodyScope$) {
    /** @deprecated use `RequestBodyScope$inboundSchema` instead. */
    RequestBodyScope$.inboundSchema = RequestBodyScope$inboundSchema;
    /** @deprecated use `RequestBodyScope$outboundSchema` instead. */
    RequestBodyScope$.outboundSchema = RequestBodyScope$outboundSchema;
})(RequestBodyScope$ || (RequestBodyScope$ = {}));
/** @internal */
export const PatchAliasesIdProtectionBypassRequestBodyAction$inboundSchema = z
    .nativeEnum(PatchAliasesIdProtectionBypassRequestBodyAction);
/** @internal */
export const PatchAliasesIdProtectionBypassRequestBodyAction$outboundSchema = PatchAliasesIdProtectionBypassRequestBodyAction$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PatchAliasesIdProtectionBypassRequestBodyAction$;
(function (PatchAliasesIdProtectionBypassRequestBodyAction$) {
    /** @deprecated use `PatchAliasesIdProtectionBypassRequestBodyAction$inboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequestBodyAction$.inboundSchema = PatchAliasesIdProtectionBypassRequestBodyAction$inboundSchema;
    /** @deprecated use `PatchAliasesIdProtectionBypassRequestBodyAction$outboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequestBodyAction$.outboundSchema = PatchAliasesIdProtectionBypassRequestBodyAction$outboundSchema;
})(PatchAliasesIdProtectionBypassRequestBodyAction$ || (PatchAliasesIdProtectionBypassRequestBodyAction$ = {}));
/** @internal */
export const Override$inboundSchema = z.object({
    scope: RequestBodyScope$inboundSchema,
    action: PatchAliasesIdProtectionBypassRequestBodyAction$inboundSchema,
});
/** @internal */
export const Override$outboundSchema = z.object({
    scope: RequestBodyScope$outboundSchema,
    action: PatchAliasesIdProtectionBypassRequestBodyAction$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Override$;
(function (Override$) {
    /** @deprecated use `Override$inboundSchema` instead. */
    Override$.inboundSchema = Override$inboundSchema;
    /** @deprecated use `Override$outboundSchema` instead. */
    Override$.outboundSchema = Override$outboundSchema;
})(Override$ || (Override$ = {}));
export function overrideToJSON(override) {
    return JSON.stringify(Override$outboundSchema.parse(override));
}
export function overrideFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Override$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Override' from JSON`);
}
/** @internal */
export const RequestBody3$inboundSchema = z.object({
    override: z.lazy(() => Override$inboundSchema),
});
/** @internal */
export const RequestBody3$outboundSchema = z.object({
    override: z.lazy(() => Override$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var RequestBody3$;
(function (RequestBody3$) {
    /** @deprecated use `RequestBody3$inboundSchema` instead. */
    RequestBody3$.inboundSchema = RequestBody3$inboundSchema;
    /** @deprecated use `RequestBody3$outboundSchema` instead. */
    RequestBody3$.outboundSchema = RequestBody3$outboundSchema;
})(RequestBody3$ || (RequestBody3$ = {}));
export function requestBody3ToJSON(requestBody3) {
    return JSON.stringify(RequestBody3$outboundSchema.parse(requestBody3));
}
export function requestBody3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => RequestBody3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBody3' from JSON`);
}
/** @internal */
export const ScopeAccess$inboundSchema = z
    .nativeEnum(ScopeAccess);
/** @internal */
export const ScopeAccess$outboundSchema = ScopeAccess$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var ScopeAccess$;
(function (ScopeAccess$) {
    /** @deprecated use `ScopeAccess$inboundSchema` instead. */
    ScopeAccess$.inboundSchema = ScopeAccess$inboundSchema;
    /** @deprecated use `ScopeAccess$outboundSchema` instead. */
    ScopeAccess$.outboundSchema = ScopeAccess$outboundSchema;
})(ScopeAccess$ || (ScopeAccess$ = {}));
/** @internal */
export const Scope2$inboundSchema = z
    .object({
    userId: z.string().optional(),
    email: z.string(),
    access: ScopeAccess$inboundSchema,
});
/** @internal */
export const Scope2$outboundSchema = z.object({
    userId: z.string().optional(),
    email: z.string(),
    access: ScopeAccess$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Scope2$;
(function (Scope2$) {
    /** @deprecated use `Scope2$inboundSchema` instead. */
    Scope2$.inboundSchema = Scope2$inboundSchema;
    /** @deprecated use `Scope2$outboundSchema` instead. */
    Scope2$.outboundSchema = Scope2$outboundSchema;
})(Scope2$ || (Scope2$ = {}));
export function scope2ToJSON(scope2) {
    return JSON.stringify(Scope2$outboundSchema.parse(scope2));
}
export function scope2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Scope2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Scope2' from JSON`);
}
/** @internal */
export const Access$inboundSchema = z
    .nativeEnum(Access);
/** @internal */
export const Access$outboundSchema = Access$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Access$;
(function (Access$) {
    /** @deprecated use `Access$inboundSchema` instead. */
    Access$.inboundSchema = Access$inboundSchema;
    /** @deprecated use `Access$outboundSchema` instead. */
    Access$.outboundSchema = Access$outboundSchema;
})(Access$ || (Access$ = {}));
/** @internal */
export const Scope1$inboundSchema = z
    .object({
    userId: z.string(),
    email: z.string().optional(),
    access: Access$inboundSchema,
});
/** @internal */
export const Scope1$outboundSchema = z.object({
    userId: z.string(),
    email: z.string().optional(),
    access: Access$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Scope1$;
(function (Scope1$) {
    /** @deprecated use `Scope1$inboundSchema` instead. */
    Scope1$.inboundSchema = Scope1$inboundSchema;
    /** @deprecated use `Scope1$outboundSchema` instead. */
    Scope1$.outboundSchema = Scope1$outboundSchema;
})(Scope1$ || (Scope1$ = {}));
export function scope1ToJSON(scope1) {
    return JSON.stringify(Scope1$outboundSchema.parse(scope1));
}
export function scope1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => Scope1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Scope1' from JSON`);
}
/** @internal */
export const Scope$inboundSchema = z
    .union([
    z.lazy(() => Scope1$inboundSchema),
    z.lazy(() => Scope2$inboundSchema),
]);
/** @internal */
export const Scope$outboundSchema = z.union([
    z.lazy(() => Scope1$outboundSchema),
    z.lazy(() => Scope2$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Scope$;
(function (Scope$) {
    /** @deprecated use `Scope$inboundSchema` instead. */
    Scope$.inboundSchema = Scope$inboundSchema;
    /** @deprecated use `Scope$outboundSchema` instead. */
    Scope$.outboundSchema = Scope$outboundSchema;
})(Scope$ || (Scope$ = {}));
export function scopeToJSON(scope) {
    return JSON.stringify(Scope$outboundSchema.parse(scope));
}
export function scopeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Scope$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Scope' from JSON`);
}
/** @internal */
export const RequestBody2$inboundSchema = z.object({
    scope: z.union([
        z.lazy(() => Scope1$inboundSchema),
        z.lazy(() => Scope2$inboundSchema),
    ]),
});
/** @internal */
export const RequestBody2$outboundSchema = z.object({
    scope: z.union([
        z.lazy(() => Scope1$outboundSchema),
        z.lazy(() => Scope2$outboundSchema),
    ]),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var RequestBody2$;
(function (RequestBody2$) {
    /** @deprecated use `RequestBody2$inboundSchema` instead. */
    RequestBody2$.inboundSchema = RequestBody2$inboundSchema;
    /** @deprecated use `RequestBody2$outboundSchema` instead. */
    RequestBody2$.outboundSchema = RequestBody2$outboundSchema;
})(RequestBody2$ || (RequestBody2$ = {}));
export function requestBody2ToJSON(requestBody2) {
    return JSON.stringify(RequestBody2$outboundSchema.parse(requestBody2));
}
export function requestBody2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => RequestBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBody2' from JSON`);
}
/** @internal */
export const RequestBodyRevoke$inboundSchema = z.object({
    secret: z.string(),
    regenerate: z.boolean(),
});
/** @internal */
export const RequestBodyRevoke$outboundSchema = z.object({
    secret: z.string(),
    regenerate: z.boolean(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var RequestBodyRevoke$;
(function (RequestBodyRevoke$) {
    /** @deprecated use `RequestBodyRevoke$inboundSchema` instead. */
    RequestBodyRevoke$.inboundSchema = RequestBodyRevoke$inboundSchema;
    /** @deprecated use `RequestBodyRevoke$outboundSchema` instead. */
    RequestBodyRevoke$.outboundSchema = RequestBodyRevoke$outboundSchema;
})(RequestBodyRevoke$ || (RequestBodyRevoke$ = {}));
export function requestBodyRevokeToJSON(requestBodyRevoke) {
    return JSON.stringify(RequestBodyRevoke$outboundSchema.parse(requestBodyRevoke));
}
export function requestBodyRevokeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => RequestBodyRevoke$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBodyRevoke' from JSON`);
}
/** @internal */
export const RequestBody1$inboundSchema = z.object({
    revoke: z.lazy(() => RequestBodyRevoke$inboundSchema).optional(),
});
/** @internal */
export const RequestBody1$outboundSchema = z.object({
    revoke: z.lazy(() => RequestBodyRevoke$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 RequestBody1$;
(function (RequestBody1$) {
    /** @deprecated use `RequestBody1$inboundSchema` instead. */
    RequestBody1$.inboundSchema = RequestBody1$inboundSchema;
    /** @deprecated use `RequestBody1$outboundSchema` instead. */
    RequestBody1$.outboundSchema = RequestBody1$outboundSchema;
})(RequestBody1$ || (RequestBody1$ = {}));
export function requestBody1ToJSON(requestBody1) {
    return JSON.stringify(RequestBody1$outboundSchema.parse(requestBody1));
}
export function requestBody1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => RequestBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequestBody1' from JSON`);
}
/** @internal */
export const PatchAliasesIdProtectionBypassRequestBody$inboundSchema = z.union([
    z.lazy(() => RequestBody1$inboundSchema),
    z.lazy(() => RequestBody2$inboundSchema),
    z.lazy(() => RequestBody3$inboundSchema),
]);
/** @internal */
export const PatchAliasesIdProtectionBypassRequestBody$outboundSchema = z.union([
    z.lazy(() => RequestBody1$outboundSchema),
    z.lazy(() => RequestBody2$outboundSchema),
    z.lazy(() => RequestBody3$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PatchAliasesIdProtectionBypassRequestBody$;
(function (PatchAliasesIdProtectionBypassRequestBody$) {
    /** @deprecated use `PatchAliasesIdProtectionBypassRequestBody$inboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequestBody$.inboundSchema = PatchAliasesIdProtectionBypassRequestBody$inboundSchema;
    /** @deprecated use `PatchAliasesIdProtectionBypassRequestBody$outboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequestBody$.outboundSchema = PatchAliasesIdProtectionBypassRequestBody$outboundSchema;
})(PatchAliasesIdProtectionBypassRequestBody$ || (PatchAliasesIdProtectionBypassRequestBody$ = {}));
export function patchAliasesIdProtectionBypassRequestBodyToJSON(patchAliasesIdProtectionBypassRequestBody) {
    return JSON.stringify(PatchAliasesIdProtectionBypassRequestBody$outboundSchema.parse(patchAliasesIdProtectionBypassRequestBody));
}
export function patchAliasesIdProtectionBypassRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchAliasesIdProtectionBypassRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchAliasesIdProtectionBypassRequestBody' from JSON`);
}
/** @internal */
export const PatchAliasesIdProtectionBypassRequest$inboundSchema = z.object({
    id: z.string(),
    RequestBody: z.union([
        z.lazy(() => RequestBody1$inboundSchema),
        z.lazy(() => RequestBody2$inboundSchema),
        z.lazy(() => RequestBody3$inboundSchema),
    ]).optional(),
}).transform((v) => {
    return remap$(v, {
        "RequestBody": "requestBody",
    });
});
/** @internal */
export const PatchAliasesIdProtectionBypassRequest$outboundSchema = z.object({
    id: z.string(),
    requestBody: z.union([
        z.lazy(() => RequestBody1$outboundSchema),
        z.lazy(() => RequestBody2$outboundSchema),
        z.lazy(() => RequestBody3$outboundSchema),
    ]).optional(),
}).transform((v) => {
    return remap$(v, {
        requestBody: "RequestBody",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PatchAliasesIdProtectionBypassRequest$;
(function (PatchAliasesIdProtectionBypassRequest$) {
    /** @deprecated use `PatchAliasesIdProtectionBypassRequest$inboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequest$.inboundSchema = PatchAliasesIdProtectionBypassRequest$inboundSchema;
    /** @deprecated use `PatchAliasesIdProtectionBypassRequest$outboundSchema` instead. */
    PatchAliasesIdProtectionBypassRequest$.outboundSchema = PatchAliasesIdProtectionBypassRequest$outboundSchema;
})(PatchAliasesIdProtectionBypassRequest$ || (PatchAliasesIdProtectionBypassRequest$ = {}));
export function patchAliasesIdProtectionBypassRequestToJSON(patchAliasesIdProtectionBypassRequest) {
    return JSON.stringify(PatchAliasesIdProtectionBypassRequest$outboundSchema.parse(patchAliasesIdProtectionBypassRequest));
}
export function patchAliasesIdProtectionBypassRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchAliasesIdProtectionBypassRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchAliasesIdProtectionBypassRequest' from JSON`);
}
//# sourceMappingURL=patchaliasesidprotectionbypassop.js.map