/*
 * 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";
import { Operation$inboundSchema, Operation$outboundSchema, } from "./operation.js";
import { PermittedOperationGroups$inboundSchema, PermittedOperationGroups$outboundSchema, } from "./permittedoperationgroups.js";
import { ResourceSet$inboundSchema, ResourceSet$outboundSchema, } from "./resourceset.js";
/** @internal */
export const AccessTokenScope$inboundSchema = z.object({
    access_tokens: z.nullable(ResourceSet$inboundSchema).optional(),
    basins: z.nullable(ResourceSet$inboundSchema).optional(),
    op_groups: z.nullable(PermittedOperationGroups$inboundSchema).optional(),
    ops: z.nullable(z.array(Operation$inboundSchema)).optional(),
    streams: z.nullable(ResourceSet$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "access_tokens": "accessTokens",
        "op_groups": "opGroups",
    });
});
/** @internal */
export const AccessTokenScope$outboundSchema = z.object({
    accessTokens: z.nullable(ResourceSet$outboundSchema).optional(),
    basins: z.nullable(ResourceSet$outboundSchema).optional(),
    opGroups: z.nullable(PermittedOperationGroups$outboundSchema).optional(),
    ops: z.nullable(z.array(Operation$outboundSchema)).optional(),
    streams: z.nullable(ResourceSet$outboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        accessTokens: "access_tokens",
        opGroups: "op_groups",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AccessTokenScope$;
(function (AccessTokenScope$) {
    /** @deprecated use `AccessTokenScope$inboundSchema` instead. */
    AccessTokenScope$.inboundSchema = AccessTokenScope$inboundSchema;
    /** @deprecated use `AccessTokenScope$outboundSchema` instead. */
    AccessTokenScope$.outboundSchema = AccessTokenScope$outboundSchema;
})(AccessTokenScope$ || (AccessTokenScope$ = {}));
export function accessTokenScopeToJSON(accessTokenScope) {
    return JSON.stringify(AccessTokenScope$outboundSchema.parse(accessTokenScope));
}
export function accessTokenScopeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AccessTokenScope$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccessTokenScope' from JSON`);
}
//# sourceMappingURL=accesstokenscope.js.map