"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Output$ = exports.Output$outboundSchema = exports.Output$inboundSchema = exports.Batch$ = exports.Batch$outboundSchema = exports.Batch$inboundSchema = exports.FirstSeqNum$ = exports.FirstSeqNum$outboundSchema = exports.FirstSeqNum$inboundSchema = exports.NextSeqNum$ = exports.NextSeqNum$outboundSchema = exports.NextSeqNum$inboundSchema = void 0;
exports.nextSeqNumToJSON = nextSeqNumToJSON;
exports.nextSeqNumFromJSON = nextSeqNumFromJSON;
exports.firstSeqNumToJSON = firstSeqNumToJSON;
exports.firstSeqNumFromJSON = firstSeqNumFromJSON;
exports.batchToJSON = batchToJSON;
exports.batchFromJSON = batchFromJSON;
exports.outputToJSON = outputToJSON;
exports.outputFromJSON = outputFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const sequencedrecordbatch_js_1 = require("./sequencedrecordbatch.js");
/** @internal */
exports.NextSeqNum$inboundSchema = z.object({
    next_seq_num: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "next_seq_num": "nextSeqNum",
    });
});
/** @internal */
exports.NextSeqNum$outboundSchema = z.object({
    nextSeqNum: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        nextSeqNum: "next_seq_num",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var NextSeqNum$;
(function (NextSeqNum$) {
    /** @deprecated use `NextSeqNum$inboundSchema` instead. */
    NextSeqNum$.inboundSchema = exports.NextSeqNum$inboundSchema;
    /** @deprecated use `NextSeqNum$outboundSchema` instead. */
    NextSeqNum$.outboundSchema = exports.NextSeqNum$outboundSchema;
})(NextSeqNum$ || (exports.NextSeqNum$ = NextSeqNum$ = {}));
function nextSeqNumToJSON(nextSeqNum) {
    return JSON.stringify(exports.NextSeqNum$outboundSchema.parse(nextSeqNum));
}
function nextSeqNumFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.NextSeqNum$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NextSeqNum' from JSON`);
}
/** @internal */
exports.FirstSeqNum$inboundSchema = z.object({
    first_seq_num: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "first_seq_num": "firstSeqNum",
    });
});
/** @internal */
exports.FirstSeqNum$outboundSchema = z.object({
    firstSeqNum: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        firstSeqNum: "first_seq_num",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var FirstSeqNum$;
(function (FirstSeqNum$) {
    /** @deprecated use `FirstSeqNum$inboundSchema` instead. */
    FirstSeqNum$.inboundSchema = exports.FirstSeqNum$inboundSchema;
    /** @deprecated use `FirstSeqNum$outboundSchema` instead. */
    FirstSeqNum$.outboundSchema = exports.FirstSeqNum$outboundSchema;
})(FirstSeqNum$ || (exports.FirstSeqNum$ = FirstSeqNum$ = {}));
function firstSeqNumToJSON(firstSeqNum) {
    return JSON.stringify(exports.FirstSeqNum$outboundSchema.parse(firstSeqNum));
}
function firstSeqNumFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FirstSeqNum$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FirstSeqNum' from JSON`);
}
/** @internal */
exports.Batch$inboundSchema = z
    .object({
    batch: sequencedrecordbatch_js_1.SequencedRecordBatch$inboundSchema,
});
/** @internal */
exports.Batch$outboundSchema = z.object({
    batch: sequencedrecordbatch_js_1.SequencedRecordBatch$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Batch$;
(function (Batch$) {
    /** @deprecated use `Batch$inboundSchema` instead. */
    Batch$.inboundSchema = exports.Batch$inboundSchema;
    /** @deprecated use `Batch$outboundSchema` instead. */
    Batch$.outboundSchema = exports.Batch$outboundSchema;
})(Batch$ || (exports.Batch$ = Batch$ = {}));
function batchToJSON(batch) {
    return JSON.stringify(exports.Batch$outboundSchema.parse(batch));
}
function batchFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Batch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Batch' from JSON`);
}
/** @internal */
exports.Output$inboundSchema = z
    .union([
    z.lazy(() => exports.Batch$inboundSchema),
    z.lazy(() => exports.FirstSeqNum$inboundSchema),
    z.lazy(() => exports.NextSeqNum$inboundSchema),
]);
/** @internal */
exports.Output$outboundSchema = z.union([
    z.lazy(() => exports.Batch$outboundSchema),
    z.lazy(() => exports.FirstSeqNum$outboundSchema),
    z.lazy(() => exports.NextSeqNum$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Output$;
(function (Output$) {
    /** @deprecated use `Output$inboundSchema` instead. */
    Output$.inboundSchema = exports.Output$inboundSchema;
    /** @deprecated use `Output$outboundSchema` instead. */
    Output$.outboundSchema = exports.Output$outboundSchema;
})(Output$ || (exports.Output$ = Output$ = {}));
function outputToJSON(output) {
    return JSON.stringify(exports.Output$outboundSchema.parse(output));
}
function outputFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Output$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Output' from JSON`);
}
//# sourceMappingURL=output.js.map