"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.UploadChunkResponse$ = exports.UploadChunkResponse$outboundSchema = exports.UploadChunkResponse$inboundSchema = exports.UploadChunkResponseBody$ = exports.UploadChunkResponseBody$outboundSchema = exports.UploadChunkResponseBody$inboundSchema = exports.UploadChunkRequest$ = exports.UploadChunkRequest$outboundSchema = exports.UploadChunkRequest$inboundSchema = exports.UploadChunkGlobals$ = exports.UploadChunkGlobals$outboundSchema = exports.UploadChunkGlobals$inboundSchema = void 0;
exports.uploadChunkGlobalsToJSON = uploadChunkGlobalsToJSON;
exports.uploadChunkGlobalsFromJSON = uploadChunkGlobalsFromJSON;
exports.uploadChunkRequestToJSON = uploadChunkRequestToJSON;
exports.uploadChunkRequestFromJSON = uploadChunkRequestFromJSON;
exports.uploadChunkResponseBodyToJSON = uploadChunkResponseBodyToJSON;
exports.uploadChunkResponseBodyFromJSON = uploadChunkResponseBodyFromJSON;
exports.uploadChunkResponseToJSON = uploadChunkResponseToJSON;
exports.uploadChunkResponseFromJSON = uploadChunkResponseFromJSON;
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.UploadChunkGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.UploadChunkGlobals$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 UploadChunkGlobals$;
(function (UploadChunkGlobals$) {
    /** @deprecated use `UploadChunkGlobals$inboundSchema` instead. */
    UploadChunkGlobals$.inboundSchema = exports.UploadChunkGlobals$inboundSchema;
    /** @deprecated use `UploadChunkGlobals$outboundSchema` instead. */
    UploadChunkGlobals$.outboundSchema = exports.UploadChunkGlobals$outboundSchema;
})(UploadChunkGlobals$ || (exports.UploadChunkGlobals$ = UploadChunkGlobals$ = {}));
function uploadChunkGlobalsToJSON(uploadChunkGlobals) {
    return JSON.stringify(exports.UploadChunkGlobals$outboundSchema.parse(uploadChunkGlobals));
}
function uploadChunkGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadChunkGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkGlobals' from JSON`);
}
/** @internal */
exports.UploadChunkRequest$inboundSchema = z.object({
    resource_type: components.UploadResourceType$inboundSchema.default("auto"),
    "Content-Range": z.string(),
    "X-Unique-Upload-Id": z.string(),
    upload_request: components.UploadRequest$inboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "resource_type": "resourceType",
        "Content-Range": "contentRange",
        "X-Unique-Upload-Id": "xUniqueUploadId",
        "upload_request": "uploadRequest",
    });
});
/** @internal */
exports.UploadChunkRequest$outboundSchema = z.object({
    resourceType: components.UploadResourceType$outboundSchema.default("auto"),
    contentRange: z.string(),
    xUniqueUploadId: z.string(),
    uploadRequest: components.UploadRequest$outboundSchema,
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        resourceType: "resource_type",
        contentRange: "Content-Range",
        xUniqueUploadId: "X-Unique-Upload-Id",
        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 UploadChunkRequest$;
(function (UploadChunkRequest$) {
    /** @deprecated use `UploadChunkRequest$inboundSchema` instead. */
    UploadChunkRequest$.inboundSchema = exports.UploadChunkRequest$inboundSchema;
    /** @deprecated use `UploadChunkRequest$outboundSchema` instead. */
    UploadChunkRequest$.outboundSchema = exports.UploadChunkRequest$outboundSchema;
})(UploadChunkRequest$ || (exports.UploadChunkRequest$ = UploadChunkRequest$ = {}));
function uploadChunkRequestToJSON(uploadChunkRequest) {
    return JSON.stringify(exports.UploadChunkRequest$outboundSchema.parse(uploadChunkRequest));
}
function uploadChunkRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadChunkRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkRequest' from JSON`);
}
/** @internal */
exports.UploadChunkResponseBody$inboundSchema = z.union([
    components.NonFinalChunkUploadResponse$inboundSchema,
    components.AsyncUploadResponse$inboundSchema,
    components.UploadResponse$inboundSchema,
]);
/** @internal */
exports.UploadChunkResponseBody$outboundSchema = z.union([
    components.NonFinalChunkUploadResponse$outboundSchema,
    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 UploadChunkResponseBody$;
(function (UploadChunkResponseBody$) {
    /** @deprecated use `UploadChunkResponseBody$inboundSchema` instead. */
    UploadChunkResponseBody$.inboundSchema = exports.UploadChunkResponseBody$inboundSchema;
    /** @deprecated use `UploadChunkResponseBody$outboundSchema` instead. */
    UploadChunkResponseBody$.outboundSchema = exports.UploadChunkResponseBody$outboundSchema;
})(UploadChunkResponseBody$ || (exports.UploadChunkResponseBody$ = UploadChunkResponseBody$ = {}));
function uploadChunkResponseBodyToJSON(uploadChunkResponseBody) {
    return JSON.stringify(exports.UploadChunkResponseBody$outboundSchema.parse(uploadChunkResponseBody));
}
function uploadChunkResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadChunkResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkResponseBody' from JSON`);
}
/** @internal */
exports.UploadChunkResponse$inboundSchema = z.union([
    z.union([
        components.NonFinalChunkUploadResponse$inboundSchema,
        components.AsyncUploadResponse$inboundSchema,
        components.UploadResponse$inboundSchema,
    ]),
    z.string(),
]);
/** @internal */
exports.UploadChunkResponse$outboundSchema = z.union([
    z.union([
        components.NonFinalChunkUploadResponse$outboundSchema,
        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 UploadChunkResponse$;
(function (UploadChunkResponse$) {
    /** @deprecated use `UploadChunkResponse$inboundSchema` instead. */
    UploadChunkResponse$.inboundSchema = exports.UploadChunkResponse$inboundSchema;
    /** @deprecated use `UploadChunkResponse$outboundSchema` instead. */
    UploadChunkResponse$.outboundSchema = exports.UploadChunkResponse$outboundSchema;
})(UploadChunkResponse$ || (exports.UploadChunkResponse$ = UploadChunkResponse$ = {}));
function uploadChunkResponseToJSON(uploadChunkResponse) {
    return JSON.stringify(exports.UploadChunkResponse$outboundSchema.parse(uploadChunkResponse));
}
function uploadChunkResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UploadChunkResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkResponse' from JSON`);
}
//# sourceMappingURL=uploadchunk.js.map