"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.DownloadAssetResponse$ = exports.DownloadAssetResponse$outboundSchema = exports.DownloadAssetResponse$inboundSchema = exports.DownloadAssetRequest$ = exports.DownloadAssetRequest$outboundSchema = exports.DownloadAssetRequest$inboundSchema = exports.DownloadAssetType$ = exports.DownloadAssetType$outboundSchema = exports.DownloadAssetType$inboundSchema = exports.DownloadAssetGlobals$ = exports.DownloadAssetGlobals$outboundSchema = exports.DownloadAssetGlobals$inboundSchema = exports.DownloadAssetType = void 0;
exports.downloadAssetGlobalsToJSON = downloadAssetGlobalsToJSON;
exports.downloadAssetGlobalsFromJSON = downloadAssetGlobalsFromJSON;
exports.downloadAssetRequestToJSON = downloadAssetRequestToJSON;
exports.downloadAssetRequestFromJSON = downloadAssetRequestFromJSON;
exports.downloadAssetResponseToJSON = downloadAssetResponseToJSON;
exports.downloadAssetResponseFromJSON = downloadAssetResponseFromJSON;
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"));
/**
 * The storage type of the asset. Defaults to 'upload'.
 */
exports.DownloadAssetType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
};
/** @internal */
exports.DownloadAssetGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.DownloadAssetGlobals$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 DownloadAssetGlobals$;
(function (DownloadAssetGlobals$) {
    /** @deprecated use `DownloadAssetGlobals$inboundSchema` instead. */
    DownloadAssetGlobals$.inboundSchema = exports.DownloadAssetGlobals$inboundSchema;
    /** @deprecated use `DownloadAssetGlobals$outboundSchema` instead. */
    DownloadAssetGlobals$.outboundSchema = exports.DownloadAssetGlobals$outboundSchema;
})(DownloadAssetGlobals$ || (exports.DownloadAssetGlobals$ = DownloadAssetGlobals$ = {}));
function downloadAssetGlobalsToJSON(downloadAssetGlobals) {
    return JSON.stringify(exports.DownloadAssetGlobals$outboundSchema.parse(downloadAssetGlobals));
}
function downloadAssetGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DownloadAssetGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DownloadAssetGlobals' from JSON`);
}
/** @internal */
exports.DownloadAssetType$inboundSchema = z.nativeEnum(exports.DownloadAssetType);
/** @internal */
exports.DownloadAssetType$outboundSchema = exports.DownloadAssetType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DownloadAssetType$;
(function (DownloadAssetType$) {
    /** @deprecated use `DownloadAssetType$inboundSchema` instead. */
    DownloadAssetType$.inboundSchema = exports.DownloadAssetType$inboundSchema;
    /** @deprecated use `DownloadAssetType$outboundSchema` instead. */
    DownloadAssetType$.outboundSchema = exports.DownloadAssetType$outboundSchema;
})(DownloadAssetType$ || (exports.DownloadAssetType$ = DownloadAssetType$ = {}));
/** @internal */
exports.DownloadAssetRequest$inboundSchema = z.object({
    resource_type: components.ResourceTypeParameter$inboundSchema,
    public_id: z.string(),
    format: z.string().optional(),
    type: exports.DownloadAssetType$inboundSchema.default("upload"),
    expires_at: z.number().int().optional(),
    attachment: z.boolean().default(false),
    target_filename: z.string().optional(),
    transformation: z.string().optional(),
    api_key: z.string(),
    signature: z.string(),
    timestamp: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "resource_type": "resourceType",
        "public_id": "publicId",
        "expires_at": "expiresAt",
        "target_filename": "targetFilename",
        "api_key": "apiKey",
    });
});
/** @internal */
exports.DownloadAssetRequest$outboundSchema = z.object({
    resourceType: components.ResourceTypeParameter$outboundSchema,
    publicId: z.string(),
    format: z.string().optional(),
    type: exports.DownloadAssetType$outboundSchema.default("upload"),
    expiresAt: z.number().int().optional(),
    attachment: z.boolean().default(false),
    targetFilename: z.string().optional(),
    transformation: z.string().optional(),
    apiKey: z.string(),
    signature: z.string(),
    timestamp: z.number().int(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        resourceType: "resource_type",
        publicId: "public_id",
        expiresAt: "expires_at",
        targetFilename: "target_filename",
        apiKey: "api_key",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DownloadAssetRequest$;
(function (DownloadAssetRequest$) {
    /** @deprecated use `DownloadAssetRequest$inboundSchema` instead. */
    DownloadAssetRequest$.inboundSchema = exports.DownloadAssetRequest$inboundSchema;
    /** @deprecated use `DownloadAssetRequest$outboundSchema` instead. */
    DownloadAssetRequest$.outboundSchema = exports.DownloadAssetRequest$outboundSchema;
})(DownloadAssetRequest$ || (exports.DownloadAssetRequest$ = DownloadAssetRequest$ = {}));
function downloadAssetRequestToJSON(downloadAssetRequest) {
    return JSON.stringify(exports.DownloadAssetRequest$outboundSchema.parse(downloadAssetRequest));
}
function downloadAssetRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DownloadAssetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DownloadAssetRequest' from JSON`);
}
/** @internal */
exports.DownloadAssetResponse$inboundSchema = z.union([
    z.instanceof((ReadableStream)),
    z.instanceof((ReadableStream)),
    z.instanceof((ReadableStream)),
]);
/** @internal */
exports.DownloadAssetResponse$outboundSchema = z.union([
    z.instanceof((ReadableStream)),
    z.instanceof((ReadableStream)),
    z.instanceof((ReadableStream)),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var DownloadAssetResponse$;
(function (DownloadAssetResponse$) {
    /** @deprecated use `DownloadAssetResponse$inboundSchema` instead. */
    DownloadAssetResponse$.inboundSchema = exports.DownloadAssetResponse$inboundSchema;
    /** @deprecated use `DownloadAssetResponse$outboundSchema` instead. */
    DownloadAssetResponse$.outboundSchema = exports.DownloadAssetResponse$outboundSchema;
})(DownloadAssetResponse$ || (exports.DownloadAssetResponse$ = DownloadAssetResponse$ = {}));
function downloadAssetResponseToJSON(downloadAssetResponse) {
    return JSON.stringify(exports.DownloadAssetResponse$outboundSchema.parse(downloadAssetResponse));
}
function downloadAssetResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.DownloadAssetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DownloadAssetResponse' from JSON`);
}
//# sourceMappingURL=downloadasset.js.map