/*
 * 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 { AccessTokenScope$inboundSchema, AccessTokenScope$outboundSchema, } from "./accesstokenscope.js";
/** @internal */
export const AccessTokenInfo$inboundSchema = z.object({
    auto_prefix_streams: z.boolean().default(false),
    expires_at: z.nullable(z.string()).optional(),
    id: z.string(),
    scope: AccessTokenScope$inboundSchema,
}).transform((v) => {
    return remap$(v, {
        "auto_prefix_streams": "autoPrefixStreams",
        "expires_at": "expiresAt",
    });
});
/** @internal */
export const AccessTokenInfo$outboundSchema = z.object({
    autoPrefixStreams: z.boolean().default(false),
    expiresAt: z.nullable(z.string()).optional(),
    id: z.string(),
    scope: AccessTokenScope$outboundSchema,
}).transform((v) => {
    return remap$(v, {
        autoPrefixStreams: "auto_prefix_streams",
        expiresAt: "expires_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AccessTokenInfo$;
(function (AccessTokenInfo$) {
    /** @deprecated use `AccessTokenInfo$inboundSchema` instead. */
    AccessTokenInfo$.inboundSchema = AccessTokenInfo$inboundSchema;
    /** @deprecated use `AccessTokenInfo$outboundSchema` instead. */
    AccessTokenInfo$.outboundSchema = AccessTokenInfo$outboundSchema;
})(AccessTokenInfo$ || (AccessTokenInfo$ = {}));
export function accessTokenInfoToJSON(accessTokenInfo) {
    return JSON.stringify(AccessTokenInfo$outboundSchema.parse(accessTokenInfo));
}
export function accessTokenInfoFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AccessTokenInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccessTokenInfo' from JSON`);
}
//# sourceMappingURL=accesstokeninfo.js.map