/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import * as components from "../components/index.js";
/** @internal */
export const UploadChunkGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const UploadChunkGlobals$outboundSchema = z.object({
    cloudName: z.string().optional(),
}).transform((v) => {
    return 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.
 */
export var UploadChunkGlobals$;
(function (UploadChunkGlobals$) {
    /** @deprecated use `UploadChunkGlobals$inboundSchema` instead. */
    UploadChunkGlobals$.inboundSchema = UploadChunkGlobals$inboundSchema;
    /** @deprecated use `UploadChunkGlobals$outboundSchema` instead. */
    UploadChunkGlobals$.outboundSchema = UploadChunkGlobals$outboundSchema;
})(UploadChunkGlobals$ || (UploadChunkGlobals$ = {}));
export function uploadChunkGlobalsToJSON(uploadChunkGlobals) {
    return JSON.stringify(UploadChunkGlobals$outboundSchema.parse(uploadChunkGlobals));
}
export function uploadChunkGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadChunkGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkGlobals' from JSON`);
}
/** @internal */
export const 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 remap$(v, {
        "resource_type": "resourceType",
        "Content-Range": "contentRange",
        "X-Unique-Upload-Id": "xUniqueUploadId",
        "upload_request": "uploadRequest",
    });
});
/** @internal */
export const UploadChunkRequest$outboundSchema = z.object({
    resourceType: components.UploadResourceType$outboundSchema.default("auto"),
    contentRange: z.string(),
    xUniqueUploadId: z.string(),
    uploadRequest: components.UploadRequest$outboundSchema,
}).transform((v) => {
    return 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.
 */
export var UploadChunkRequest$;
(function (UploadChunkRequest$) {
    /** @deprecated use `UploadChunkRequest$inboundSchema` instead. */
    UploadChunkRequest$.inboundSchema = UploadChunkRequest$inboundSchema;
    /** @deprecated use `UploadChunkRequest$outboundSchema` instead. */
    UploadChunkRequest$.outboundSchema = UploadChunkRequest$outboundSchema;
})(UploadChunkRequest$ || (UploadChunkRequest$ = {}));
export function uploadChunkRequestToJSON(uploadChunkRequest) {
    return JSON.stringify(UploadChunkRequest$outboundSchema.parse(uploadChunkRequest));
}
export function uploadChunkRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadChunkRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkRequest' from JSON`);
}
/** @internal */
export const UploadChunkResponseBody$inboundSchema = z.union([
    components.NonFinalChunkUploadResponse$inboundSchema,
    components.AsyncUploadResponse$inboundSchema,
    components.UploadResponse$inboundSchema,
]);
/** @internal */
export const 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.
 */
export var UploadChunkResponseBody$;
(function (UploadChunkResponseBody$) {
    /** @deprecated use `UploadChunkResponseBody$inboundSchema` instead. */
    UploadChunkResponseBody$.inboundSchema = UploadChunkResponseBody$inboundSchema;
    /** @deprecated use `UploadChunkResponseBody$outboundSchema` instead. */
    UploadChunkResponseBody$.outboundSchema = UploadChunkResponseBody$outboundSchema;
})(UploadChunkResponseBody$ || (UploadChunkResponseBody$ = {}));
export function uploadChunkResponseBodyToJSON(uploadChunkResponseBody) {
    return JSON.stringify(UploadChunkResponseBody$outboundSchema.parse(uploadChunkResponseBody));
}
export function uploadChunkResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadChunkResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkResponseBody' from JSON`);
}
/** @internal */
export const UploadChunkResponse$inboundSchema = z.union([
    z.union([
        components.NonFinalChunkUploadResponse$inboundSchema,
        components.AsyncUploadResponse$inboundSchema,
        components.UploadResponse$inboundSchema,
    ]),
    z.string(),
]);
/** @internal */
export const 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.
 */
export var UploadChunkResponse$;
(function (UploadChunkResponse$) {
    /** @deprecated use `UploadChunkResponse$inboundSchema` instead. */
    UploadChunkResponse$.inboundSchema = UploadChunkResponse$inboundSchema;
    /** @deprecated use `UploadChunkResponse$outboundSchema` instead. */
    UploadChunkResponse$.outboundSchema = UploadChunkResponse$outboundSchema;
})(UploadChunkResponse$ || (UploadChunkResponse$ = {}));
export function uploadChunkResponseToJSON(uploadChunkResponse) {
    return JSON.stringify(UploadChunkResponse$outboundSchema.parse(uploadChunkResponse));
}
export function uploadChunkResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadChunkResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadChunkResponse' from JSON`);
}
//# sourceMappingURL=uploadchunk.js.map