/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: f898c270cc77
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
/** @internal */
export const ReferenceId$inboundSchema = smartUnion([z.int(), z.string()]);
/** @internal */
export const ReferenceId$outboundSchema = smartUnion([z.int(), z.string()]);
export function referenceIdToJSON(referenceId) {
    return JSON.stringify(ReferenceId$outboundSchema.parse(referenceId));
}
export function referenceIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ReferenceId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReferenceId' from JSON`);
}
/** @internal */
export const ReferenceChunk$inboundSchema = z.object({
    type: z.literal("reference").default("reference"),
    reference_ids: z.array(smartUnion([z.int(), z.string()])),
}).transform((v) => {
    return remap$(v, {
        "reference_ids": "referenceIds",
    });
});
/** @internal */
export const ReferenceChunk$outboundSchema = z.object({
    type: z.literal("reference").default("reference"),
    referenceIds: z.array(smartUnion([z.int(), z.string()])),
}).transform((v) => {
    return remap$(v, {
        referenceIds: "reference_ids",
    });
});
export function referenceChunkToJSON(referenceChunk) {
    return JSON.stringify(ReferenceChunk$outboundSchema.parse(referenceChunk));
}
export function referenceChunkFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ReferenceChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReferenceChunk' from JSON`);
}
//# sourceMappingURL=referencechunk.js.map