/*
 * 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 PatchUrlProtectionBypassRequestBodyAction = {
    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 PatchUrlProtectionBypassRequestBodyAction$inboundSchema = z
    .nativeEnum(PatchUrlProtectionBypassRequestBodyAction);
/** @internal */
export const PatchUrlProtectionBypassRequestBodyAction$outboundSchema = PatchUrlProtectionBypassRequestBodyAction$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PatchUrlProtectionBypassRequestBodyAction$;
(function (PatchUrlProtectionBypassRequestBodyAction$) {
    /** @deprecated use `PatchUrlProtectionBypassRequestBodyAction$inboundSchema` instead. */
    PatchUrlProtectionBypassRequestBodyAction$.inboundSchema = PatchUrlProtectionBypassRequestBodyAction$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequestBodyAction$outboundSchema` instead. */
    PatchUrlProtectionBypassRequestBodyAction$.outboundSchema = PatchUrlProtectionBypassRequestBodyAction$outboundSchema;
})(PatchUrlProtectionBypassRequestBodyAction$ || (PatchUrlProtectionBypassRequestBodyAction$ = {}));
/** @internal */
export const Override$inboundSchema = z.object({
    scope: RequestBodyScope$inboundSchema,
    action: PatchUrlProtectionBypassRequestBodyAction$inboundSchema,
});
/** @internal */
export const Override$outboundSchema = z.object({
    scope: RequestBodyScope$outboundSchema,
    action: PatchUrlProtectionBypassRequestBodyAction$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 PatchUrlProtectionBypassRequestBody3$inboundSchema = z.object({
    override: z.lazy(() => Override$inboundSchema),
});
/** @internal */
export const PatchUrlProtectionBypassRequestBody3$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 PatchUrlProtectionBypassRequestBody3$;
(function (PatchUrlProtectionBypassRequestBody3$) {
    /** @deprecated use `PatchUrlProtectionBypassRequestBody3$inboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody3$.inboundSchema = PatchUrlProtectionBypassRequestBody3$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequestBody3$outboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody3$.outboundSchema = PatchUrlProtectionBypassRequestBody3$outboundSchema;
})(PatchUrlProtectionBypassRequestBody3$ || (PatchUrlProtectionBypassRequestBody3$ = {}));
export function patchUrlProtectionBypassRequestBody3ToJSON(patchUrlProtectionBypassRequestBody3) {
    return JSON.stringify(PatchUrlProtectionBypassRequestBody3$outboundSchema.parse(patchUrlProtectionBypassRequestBody3));
}
export function patchUrlProtectionBypassRequestBody3FromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchUrlProtectionBypassRequestBody3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchUrlProtectionBypassRequestBody3' 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 PatchUrlProtectionBypassRequestBody2$inboundSchema = z.object({
    scope: z.union([
        z.lazy(() => Scope1$inboundSchema),
        z.lazy(() => Scope2$inboundSchema),
    ]),
});
/** @internal */
export const PatchUrlProtectionBypassRequestBody2$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 PatchUrlProtectionBypassRequestBody2$;
(function (PatchUrlProtectionBypassRequestBody2$) {
    /** @deprecated use `PatchUrlProtectionBypassRequestBody2$inboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody2$.inboundSchema = PatchUrlProtectionBypassRequestBody2$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequestBody2$outboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody2$.outboundSchema = PatchUrlProtectionBypassRequestBody2$outboundSchema;
})(PatchUrlProtectionBypassRequestBody2$ || (PatchUrlProtectionBypassRequestBody2$ = {}));
export function patchUrlProtectionBypassRequestBody2ToJSON(patchUrlProtectionBypassRequestBody2) {
    return JSON.stringify(PatchUrlProtectionBypassRequestBody2$outboundSchema.parse(patchUrlProtectionBypassRequestBody2));
}
export function patchUrlProtectionBypassRequestBody2FromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchUrlProtectionBypassRequestBody2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchUrlProtectionBypassRequestBody2' 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 PatchUrlProtectionBypassRequestBody1$inboundSchema = z.object({
    revoke: z.lazy(() => RequestBodyRevoke$inboundSchema).optional(),
});
/** @internal */
export const PatchUrlProtectionBypassRequestBody1$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 PatchUrlProtectionBypassRequestBody1$;
(function (PatchUrlProtectionBypassRequestBody1$) {
    /** @deprecated use `PatchUrlProtectionBypassRequestBody1$inboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody1$.inboundSchema = PatchUrlProtectionBypassRequestBody1$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequestBody1$outboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody1$.outboundSchema = PatchUrlProtectionBypassRequestBody1$outboundSchema;
})(PatchUrlProtectionBypassRequestBody1$ || (PatchUrlProtectionBypassRequestBody1$ = {}));
export function patchUrlProtectionBypassRequestBody1ToJSON(patchUrlProtectionBypassRequestBody1) {
    return JSON.stringify(PatchUrlProtectionBypassRequestBody1$outboundSchema.parse(patchUrlProtectionBypassRequestBody1));
}
export function patchUrlProtectionBypassRequestBody1FromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchUrlProtectionBypassRequestBody1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchUrlProtectionBypassRequestBody1' from JSON`);
}
/** @internal */
export const PatchUrlProtectionBypassRequestBody$inboundSchema = z.union([
    z.lazy(() => PatchUrlProtectionBypassRequestBody2$inboundSchema),
    z.lazy(() => PatchUrlProtectionBypassRequestBody3$inboundSchema),
    z.lazy(() => PatchUrlProtectionBypassRequestBody1$inboundSchema),
]);
/** @internal */
export const PatchUrlProtectionBypassRequestBody$outboundSchema = z.union([
    z.lazy(() => PatchUrlProtectionBypassRequestBody2$outboundSchema),
    z.lazy(() => PatchUrlProtectionBypassRequestBody3$outboundSchema),
    z.lazy(() => PatchUrlProtectionBypassRequestBody1$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var PatchUrlProtectionBypassRequestBody$;
(function (PatchUrlProtectionBypassRequestBody$) {
    /** @deprecated use `PatchUrlProtectionBypassRequestBody$inboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody$.inboundSchema = PatchUrlProtectionBypassRequestBody$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequestBody$outboundSchema` instead. */
    PatchUrlProtectionBypassRequestBody$.outboundSchema = PatchUrlProtectionBypassRequestBody$outboundSchema;
})(PatchUrlProtectionBypassRequestBody$ || (PatchUrlProtectionBypassRequestBody$ = {}));
export function patchUrlProtectionBypassRequestBodyToJSON(patchUrlProtectionBypassRequestBody) {
    return JSON.stringify(PatchUrlProtectionBypassRequestBody$outboundSchema.parse(patchUrlProtectionBypassRequestBody));
}
export function patchUrlProtectionBypassRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchUrlProtectionBypassRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchUrlProtectionBypassRequestBody' from JSON`);
}
/** @internal */
export const PatchUrlProtectionBypassRequest$inboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
    RequestBody: z.union([
        z.lazy(() => PatchUrlProtectionBypassRequestBody2$inboundSchema),
        z.lazy(() => PatchUrlProtectionBypassRequestBody3$inboundSchema),
        z.lazy(() => PatchUrlProtectionBypassRequestBody1$inboundSchema),
    ]).optional(),
}).transform((v) => {
    return remap$(v, {
        "RequestBody": "requestBody",
    });
});
/** @internal */
export const PatchUrlProtectionBypassRequest$outboundSchema = z.object({
    id: z.string(),
    teamId: z.string().optional(),
    slug: z.string().optional(),
    requestBody: z.union([
        z.lazy(() => PatchUrlProtectionBypassRequestBody2$outboundSchema),
        z.lazy(() => PatchUrlProtectionBypassRequestBody3$outboundSchema),
        z.lazy(() => PatchUrlProtectionBypassRequestBody1$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 PatchUrlProtectionBypassRequest$;
(function (PatchUrlProtectionBypassRequest$) {
    /** @deprecated use `PatchUrlProtectionBypassRequest$inboundSchema` instead. */
    PatchUrlProtectionBypassRequest$.inboundSchema = PatchUrlProtectionBypassRequest$inboundSchema;
    /** @deprecated use `PatchUrlProtectionBypassRequest$outboundSchema` instead. */
    PatchUrlProtectionBypassRequest$.outboundSchema = PatchUrlProtectionBypassRequest$outboundSchema;
})(PatchUrlProtectionBypassRequest$ || (PatchUrlProtectionBypassRequest$ = {}));
export function patchUrlProtectionBypassRequestToJSON(patchUrlProtectionBypassRequest) {
    return JSON.stringify(PatchUrlProtectionBypassRequest$outboundSchema.parse(patchUrlProtectionBypassRequest));
}
export function patchUrlProtectionBypassRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => PatchUrlProtectionBypassRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchUrlProtectionBypassRequest' from JSON`);
}
//# sourceMappingURL=patchurlprotectionbypassop.js.map