/*
 * 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 UploadGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const UploadGlobals$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 UploadGlobals$;
(function (UploadGlobals$) {
    /** @deprecated use `UploadGlobals$inboundSchema` instead. */
    UploadGlobals$.inboundSchema = UploadGlobals$inboundSchema;
    /** @deprecated use `UploadGlobals$outboundSchema` instead. */
    UploadGlobals$.outboundSchema = UploadGlobals$outboundSchema;
})(UploadGlobals$ || (UploadGlobals$ = {}));
export function uploadGlobalsToJSON(uploadGlobals) {
    return JSON.stringify(UploadGlobals$outboundSchema.parse(uploadGlobals));
}
export function uploadGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadGlobals' from JSON`);
}
/** @internal */
export const UploadRequest$inboundSchema = z.object({
    resource_type: components.UploadResourceType$inboundSchema.default("auto"),
    upload_request: components.UploadRequest$inboundSchema,
}).transform((v) => {
    return remap$(v, {
        "resource_type": "resourceType",
        "upload_request": "uploadRequest",
    });
});
/** @internal */
export const UploadRequest$outboundSchema = z.object({
    resourceType: components.UploadResourceType$outboundSchema.default("auto"),
    uploadRequest: components.UploadRequest$outboundSchema,
}).transform((v) => {
    return 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.
 */
export var UploadRequest$;
(function (UploadRequest$) {
    /** @deprecated use `UploadRequest$inboundSchema` instead. */
    UploadRequest$.inboundSchema = UploadRequest$inboundSchema;
    /** @deprecated use `UploadRequest$outboundSchema` instead. */
    UploadRequest$.outboundSchema = UploadRequest$outboundSchema;
})(UploadRequest$ || (UploadRequest$ = {}));
export function uploadRequestToJSON(uploadRequest) {
    return JSON.stringify(UploadRequest$outboundSchema.parse(uploadRequest));
}
export function uploadRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadRequest' from JSON`);
}
/** @internal */
export const UploadResponseBody$inboundSchema = z.union([
    components.AsyncUploadResponse$inboundSchema,
    components.UploadResponse$inboundSchema,
]);
/** @internal */
export const 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.
 */
export var UploadResponseBody$;
(function (UploadResponseBody$) {
    /** @deprecated use `UploadResponseBody$inboundSchema` instead. */
    UploadResponseBody$.inboundSchema = UploadResponseBody$inboundSchema;
    /** @deprecated use `UploadResponseBody$outboundSchema` instead. */
    UploadResponseBody$.outboundSchema = UploadResponseBody$outboundSchema;
})(UploadResponseBody$ || (UploadResponseBody$ = {}));
export function uploadResponseBodyToJSON(uploadResponseBody) {
    return JSON.stringify(UploadResponseBody$outboundSchema.parse(uploadResponseBody));
}
export function uploadResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponseBody' from JSON`);
}
/** @internal */
export const UploadResponse$inboundSchema = z.union([
    z.union([
        components.AsyncUploadResponse$inboundSchema,
        components.UploadResponse$inboundSchema,
    ]),
    z.string(),
]);
/** @internal */
export const 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.
 */
export var UploadResponse$;
(function (UploadResponse$) {
    /** @deprecated use `UploadResponse$inboundSchema` instead. */
    UploadResponse$.inboundSchema = UploadResponse$inboundSchema;
    /** @deprecated use `UploadResponse$outboundSchema` instead. */
    UploadResponse$.outboundSchema = UploadResponse$outboundSchema;
})(UploadResponse$ || (UploadResponse$ = {}));
export function uploadResponseToJSON(uploadResponse) {
    return JSON.stringify(UploadResponse$outboundSchema.parse(uploadResponse));
}
export function uploadResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => UploadResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadResponse' from JSON`);
}
//# sourceMappingURL=upload.js.map