"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.Source$ = exports.Source$outboundSchema = exports.Source$inboundSchema = exports.Uri$ = exports.Uri$outboundSchema = exports.Uri$inboundSchema = exports.AssetId$ = exports.AssetId$outboundSchema = exports.AssetId$inboundSchema = void 0;
exports.assetIdToJSON = assetIdToJSON;
exports.assetIdFromJSON = assetIdFromJSON;
exports.uriToJSON = uriToJSON;
exports.uriFromJSON = uriFromJSON;
exports.sourceToJSON = sourceToJSON;
exports.sourceFromJSON = sourceFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/** @internal */
exports.AssetId$inboundSchema = z.object({
    asset_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "asset_id": "assetId",
    });
});
/** @internal */
exports.AssetId$outboundSchema = z.object({
    assetId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        assetId: "asset_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AssetId$;
(function (AssetId$) {
    /** @deprecated use `AssetId$inboundSchema` instead. */
    AssetId$.inboundSchema = exports.AssetId$inboundSchema;
    /** @deprecated use `AssetId$outboundSchema` instead. */
    AssetId$.outboundSchema = exports.AssetId$outboundSchema;
})(AssetId$ || (exports.AssetId$ = AssetId$ = {}));
function assetIdToJSON(assetId) {
    return JSON.stringify(exports.AssetId$outboundSchema.parse(assetId));
}
function assetIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AssetId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetId' from JSON`);
}
/** @internal */
exports.Uri$inboundSchema = z
    .object({
    uri: z.string(),
});
/** @internal */
exports.Uri$outboundSchema = z
    .object({
    uri: z.string(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Uri$;
(function (Uri$) {
    /** @deprecated use `Uri$inboundSchema` instead. */
    Uri$.inboundSchema = exports.Uri$inboundSchema;
    /** @deprecated use `Uri$outboundSchema` instead. */
    Uri$.outboundSchema = exports.Uri$outboundSchema;
})(Uri$ || (exports.Uri$ = Uri$ = {}));
function uriToJSON(uri) {
    return JSON.stringify(exports.Uri$outboundSchema.parse(uri));
}
function uriFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Uri$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Uri' from JSON`);
}
/** @internal */
exports.Source$inboundSchema = z
    .union([
    z.lazy(() => exports.Uri$inboundSchema),
    z.lazy(() => exports.AssetId$inboundSchema),
]);
/** @internal */
exports.Source$outboundSchema = z.union([
    z.lazy(() => exports.Uri$outboundSchema),
    z.lazy(() => exports.AssetId$outboundSchema),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Source$;
(function (Source$) {
    /** @deprecated use `Source$inboundSchema` instead. */
    Source$.inboundSchema = exports.Source$inboundSchema;
    /** @deprecated use `Source$outboundSchema` instead. */
    Source$.outboundSchema = exports.Source$outboundSchema;
})(Source$ || (exports.Source$ = Source$ = {}));
function sourceToJSON(source) {
    return JSON.stringify(exports.Source$outboundSchema.parse(source));
}
function sourceFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Source$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Source' from JSON`);
}
//# sourceMappingURL=source.js.map