/*
 * 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";
/**
 * The status of the asynchronous upload. Will be 'pending' for async uploads.
 */
export const AsyncUploadResponseStatus = {
    Pending: "pending",
};
/**
 * The type of resource being uploaded. This field may be omitted if resource_type is not known at the time of the call.
 */
export const AsyncUploadResponseResourceType = {
    Image: "image",
    Video: "video",
    Raw: "raw",
};
/**
 * The storage type of the asset. Defaults to 'upload'.
 */
export const AsyncUploadResponseType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
};
/** @internal */
export const AsyncUploadResponseStatus$inboundSchema = z.nativeEnum(AsyncUploadResponseStatus);
/** @internal */
export const AsyncUploadResponseStatus$outboundSchema = AsyncUploadResponseStatus$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AsyncUploadResponseStatus$;
(function (AsyncUploadResponseStatus$) {
    /** @deprecated use `AsyncUploadResponseStatus$inboundSchema` instead. */
    AsyncUploadResponseStatus$.inboundSchema = AsyncUploadResponseStatus$inboundSchema;
    /** @deprecated use `AsyncUploadResponseStatus$outboundSchema` instead. */
    AsyncUploadResponseStatus$.outboundSchema = AsyncUploadResponseStatus$outboundSchema;
})(AsyncUploadResponseStatus$ || (AsyncUploadResponseStatus$ = {}));
/** @internal */
export const AsyncUploadResponseResourceType$inboundSchema = z.nativeEnum(AsyncUploadResponseResourceType);
/** @internal */
export const AsyncUploadResponseResourceType$outboundSchema = AsyncUploadResponseResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AsyncUploadResponseResourceType$;
(function (AsyncUploadResponseResourceType$) {
    /** @deprecated use `AsyncUploadResponseResourceType$inboundSchema` instead. */
    AsyncUploadResponseResourceType$.inboundSchema = AsyncUploadResponseResourceType$inboundSchema;
    /** @deprecated use `AsyncUploadResponseResourceType$outboundSchema` instead. */
    AsyncUploadResponseResourceType$.outboundSchema = AsyncUploadResponseResourceType$outboundSchema;
})(AsyncUploadResponseResourceType$ || (AsyncUploadResponseResourceType$ = {}));
/** @internal */
export const AsyncUploadResponseType$inboundSchema = z.nativeEnum(AsyncUploadResponseType);
/** @internal */
export const AsyncUploadResponseType$outboundSchema = AsyncUploadResponseType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AsyncUploadResponseType$;
(function (AsyncUploadResponseType$) {
    /** @deprecated use `AsyncUploadResponseType$inboundSchema` instead. */
    AsyncUploadResponseType$.inboundSchema = AsyncUploadResponseType$inboundSchema;
    /** @deprecated use `AsyncUploadResponseType$outboundSchema` instead. */
    AsyncUploadResponseType$.outboundSchema = AsyncUploadResponseType$outboundSchema;
})(AsyncUploadResponseType$ || (AsyncUploadResponseType$ = {}));
/** @internal */
export const AsyncUploadResponse$inboundSchema = z.object({
    status: AsyncUploadResponseStatus$inboundSchema,
    resource_type: AsyncUploadResponseResourceType$inboundSchema.optional(),
    type: AsyncUploadResponseType$inboundSchema.default("upload"),
    public_id: z.string().optional(),
    batch_id: z.string(),
    requester_ip: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "resource_type": "resourceType",
        "public_id": "publicId",
        "batch_id": "batchId",
        "requester_ip": "requesterIp",
    });
});
/** @internal */
export const AsyncUploadResponse$outboundSchema = z.object({
    status: AsyncUploadResponseStatus$outboundSchema,
    resourceType: AsyncUploadResponseResourceType$outboundSchema.optional(),
    type: AsyncUploadResponseType$outboundSchema.default("upload"),
    publicId: z.string().optional(),
    batchId: z.string(),
    requesterIp: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        resourceType: "resource_type",
        publicId: "public_id",
        batchId: "batch_id",
        requesterIp: "requester_ip",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var AsyncUploadResponse$;
(function (AsyncUploadResponse$) {
    /** @deprecated use `AsyncUploadResponse$inboundSchema` instead. */
    AsyncUploadResponse$.inboundSchema = AsyncUploadResponse$inboundSchema;
    /** @deprecated use `AsyncUploadResponse$outboundSchema` instead. */
    AsyncUploadResponse$.outboundSchema = AsyncUploadResponse$outboundSchema;
})(AsyncUploadResponse$ || (AsyncUploadResponse$ = {}));
export function asyncUploadResponseToJSON(asyncUploadResponse) {
    return JSON.stringify(AsyncUploadResponse$outboundSchema.parse(asyncUploadResponse));
}
export function asyncUploadResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => AsyncUploadResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AsyncUploadResponse' from JSON`);
}
//# sourceMappingURL=asyncuploadresponse.js.map