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