"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.additionalDataFromJSON = exports.additionalDataToJSON = exports.AdditionalData$ = exports.AdditionalData$outboundSchema = exports.AdditionalData$inboundSchema = exports.valueFromJSON = exports.valueToJSON = exports.Value$ = exports.Value$outboundSchema = exports.Value$inboundSchema = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
/** @internal */
exports.Value$inboundSchema = z
    .union([z.string(), z.array(z.string())]);
/** @internal */
exports.Value$outboundSchema = z.union([z.string(), z.array(z.string())]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Value$;
(function (Value$) {
    /** @deprecated use `Value$inboundSchema` instead. */
    Value$.inboundSchema = exports.Value$inboundSchema;
    /** @deprecated use `Value$outboundSchema` instead. */
    Value$.outboundSchema = exports.Value$outboundSchema;
})(Value$ || (exports.Value$ = Value$ = {}));
function valueToJSON(value) {
    return JSON.stringify(exports.Value$outboundSchema.parse(value));
}
exports.valueToJSON = valueToJSON;
function valueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Value$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Value' from JSON`);
}
exports.valueFromJSON = valueFromJSON;
/** @internal */
exports.AdditionalData$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    value: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.AdditionalData$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    value: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AdditionalData$;
(function (AdditionalData$) {
    /** @deprecated use `AdditionalData$inboundSchema` instead. */
    AdditionalData$.inboundSchema = exports.AdditionalData$inboundSchema;
    /** @deprecated use `AdditionalData$outboundSchema` instead. */
    AdditionalData$.outboundSchema = exports.AdditionalData$outboundSchema;
})(AdditionalData$ || (exports.AdditionalData$ = AdditionalData$ = {}));
function additionalDataToJSON(additionalData) {
    return JSON.stringify(exports.AdditionalData$outboundSchema.parse(additionalData));
}
exports.additionalDataToJSON = additionalDataToJSON;
function additionalDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AdditionalData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AdditionalData' from JSON`);
}
exports.additionalDataFromJSON = additionalDataFromJSON;
//# sourceMappingURL=additionaldata.js.map