"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.UploadResponse$ = exports.UploadResponse$outboundSchema = exports.UploadResponse$inboundSchema = exports.UploadResponseBody$ = exports.UploadResponseBody$outboundSchema = exports.UploadResponseBody$inboundSchema = exports.UploadRequest$ = exports.UploadRequest$outboundSchema = exports.UploadRequest$inboundSchema = exports.UploadGlobals$ = exports.UploadGlobals$outboundSchema = exports.UploadGlobals$inboundSchema = void 0;
exports.uploadGlobalsToJSON = uploadGlobalsToJSON;
exports.uploadGlobalsFromJSON = uploadGlobalsFromJSON;
exports.uploadRequestToJSON = uploadRequestToJSON;
exports.uploadRequestFromJSON = uploadRequestFromJSON;
exports.uploadResponseBodyToJSON = uploadResponseBodyToJSON;
exports.uploadResponseBodyFromJSON = uploadResponseBodyFromJSON;
exports.uploadResponseToJSON = uploadResponseToJSON;
exports.uploadResponseFromJSON = uploadResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
/** @internal */
exports.UploadGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.UploadGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        cloudName: "cloud_name",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UploadGlobals$;
(function (UploadGlobals$) {
    /** @deprecated use `UploadGlobals$inboundSchema` instead. */
    UploadGlobals$.inboundSchema = exports.UploadGlobals$inboundSchema;
    /** @deprecated use `UploadGlobals$outboundSchema` instead. */
    UploadGlobals$.outboundSchema = exports.UploadGlobals$outboundSchema;
})(UploadGlobals$ || (exports.UploadGlobals$ = UploadGlobals$ = {}));
function uploadGlobalsToJSON(uploadGlobals) {
    return JSON.stringify(exports.UploadGlobals$outboundSchema.parse(uploadGlobals));
}
function uploadGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadGlobals' from JSON`);
}
/** @internal */
exports.UploadRequest$inboundSchema = z.object({
    resource_type: components.UploadResourceType$inboundSchema.default("auto"),
    upload_request: components.UploadRequest$inboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "resource_type": "resourceType",
        "upload_request": "uploadRequest",
    });
});
/** @internal */
exports.UploadRequest$outboundSchema = z.object({
    resourceType: components.UploadResourceType$outboundSchema.default("auto"),
    uploadRequest: components.UploadRequest$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        resourceType: "resource_type",
        uploadRequest: "upload_request",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UploadRequest$;
(function (UploadRequest$) {
    /** @deprecated use `UploadRequest$inboundSchema` instead. */
    UploadRequest$.inboundSchema = exports.UploadRequest$inboundSchema;
    /** @deprecated use `UploadRequest$outboundSchema` instead. */
    UploadRequest$.outboundSchema = exports.UploadRequest$outboundSchema;
})(UploadRequest$ || (exports.UploadRequest$ = UploadRequest$ = {}));
function uploadRequestToJSON(uploadRequest) {
    return JSON.stringify(exports.UploadRequest$outboundSchema.parse(uploadRequest));
}
function uploadRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadRequest' from JSON`);
}
/** @internal */
exports.UploadResponseBody$inboundSchema = z.union([
    components.AsyncUploadResponse$inboundSchema,
    components.UploadResponse$inboundSchema,
]);
/** @internal */
exports.UploadResponseBody$outboundSchema = z.union([
    components.AsyncUploadResponse$outboundSchema,
    components.UploadResponse$outboundSchema,
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UploadResponseBody$;
(function (UploadResponseBody$) {
    /** @deprecated use `UploadResponseBody$inboundSchema` instead. */
    UploadResponseBody$.inboundSchema = exports.UploadResponseBody$inboundSchema;
    /** @deprecated use `UploadResponseBody$outboundSchema` instead. */
    UploadResponseBody$.outboundSchema = exports.UploadResponseBody$outboundSchema;
})(UploadResponseBody$ || (exports.UploadResponseBody$ = UploadResponseBody$ = {}));
function uploadResponseBodyToJSON(uploadResponseBody) {
    return JSON.stringify(exports.UploadResponseBody$outboundSchema.parse(uploadResponseBody));
}
function uploadResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponseBody' from JSON`);
}
/** @internal */
exports.UploadResponse$inboundSchema = z.union([
    z.union([
        components.AsyncUploadResponse$inboundSchema,
        components.UploadResponse$inboundSchema,
    ]),
    z.string(),
]);
/** @internal */
exports.UploadResponse$outboundSchema = z.union([
    z.union([
        components.AsyncUploadResponse$outboundSchema,
        components.UploadResponse$outboundSchema,
    ]),
    z.string(),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var UploadResponse$;
(function (UploadResponse$) {
    /** @deprecated use `UploadResponse$inboundSchema` instead. */
    UploadResponse$.inboundSchema = exports.UploadResponse$inboundSchema;
    /** @deprecated use `UploadResponse$outboundSchema` instead. */
    UploadResponse$.outboundSchema = exports.UploadResponse$outboundSchema;
})(UploadResponse$ || (exports.UploadResponse$ = UploadResponse$ = {}));
function uploadResponseToJSON(uploadResponse) {
    return JSON.stringify(exports.UploadResponse$outboundSchema.parse(uploadResponse));
}
function uploadResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponse' from JSON`);
}
//# sourceMappingURL=upload.js.map