"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.GenerateArchiveResponse$ = exports.GenerateArchiveResponse$outboundSchema = exports.GenerateArchiveResponse$inboundSchema = exports.GenerateArchiveResponseBody$ = exports.GenerateArchiveResponseBody$outboundSchema = exports.GenerateArchiveResponseBody$inboundSchema = exports.GenerateArchiveRequest$ = exports.GenerateArchiveRequest$outboundSchema = exports.GenerateArchiveRequest$inboundSchema = exports.GenerateArchiveRequestBody$ = exports.GenerateArchiveRequestBody$outboundSchema = exports.GenerateArchiveRequestBody$inboundSchema = exports.TargetFormat$ = exports.TargetFormat$outboundSchema = exports.TargetFormat$inboundSchema = exports.Mode$ = exports.Mode$outboundSchema = exports.Mode$inboundSchema = exports.GenerateArchiveType$ = exports.GenerateArchiveType$outboundSchema = exports.GenerateArchiveType$inboundSchema = exports.GenerateArchiveResourceType$ = exports.GenerateArchiveResourceType$outboundSchema = exports.GenerateArchiveResourceType$inboundSchema = exports.GenerateArchiveGlobals$ = exports.GenerateArchiveGlobals$outboundSchema = exports.GenerateArchiveGlobals$inboundSchema = exports.TargetFormat = exports.Mode = exports.GenerateArchiveType = exports.GenerateArchiveResourceType = void 0;
exports.generateArchiveGlobalsToJSON = generateArchiveGlobalsToJSON;
exports.generateArchiveGlobalsFromJSON = generateArchiveGlobalsFromJSON;
exports.generateArchiveRequestBodyToJSON = generateArchiveRequestBodyToJSON;
exports.generateArchiveRequestBodyFromJSON = generateArchiveRequestBodyFromJSON;
exports.generateArchiveRequestToJSON = generateArchiveRequestToJSON;
exports.generateArchiveRequestFromJSON = generateArchiveRequestFromJSON;
exports.generateArchiveResponseBodyToJSON = generateArchiveResponseBodyToJSON;
exports.generateArchiveResponseBodyFromJSON = generateArchiveResponseBodyFromJSON;
exports.generateArchiveResponseToJSON = generateArchiveResponseToJSON;
exports.generateArchiveResponseFromJSON = generateArchiveResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The type of resources to include in the archive. "image" for images, "video" for videos, "raw" for non-media files, or "all" for mixed types.
 */
exports.GenerateArchiveResourceType = {
    Image: "image",
    Video: "video",
    Raw: "raw",
    All: "all",
};
/**
 * The specific file type of assets to include in the archive. Not applicable when "resource_type" is "all".
 */
exports.GenerateArchiveType = {
    Upload: "upload",
    Private: "private",
    Authenticated: "authenticated",
    Fetch: "fetch",
};
/**
 * The method for generating and delivering the archive. Options:
 *
 * @remarks
 * download - Generates and delivers the archive file without storing it
 * create - Creates and stores the archive as a raw asset, returning URLs in the response
 * create_and_download - Creates, stores, and delivers the archive file
 */
exports.Mode = {
    Download: "download",
    Create: "create",
    CreateAndDownload: "create_and_download",
};
/**
 * The format of the generated archive.
 */
exports.TargetFormat = {
    Zip: "zip",
    Tgz: "tgz",
};
/** @internal */
exports.GenerateArchiveGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
exports.GenerateArchiveGlobals$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 GenerateArchiveGlobals$;
(function (GenerateArchiveGlobals$) {
    /** @deprecated use `GenerateArchiveGlobals$inboundSchema` instead. */
    GenerateArchiveGlobals$.inboundSchema = exports.GenerateArchiveGlobals$inboundSchema;
    /** @deprecated use `GenerateArchiveGlobals$outboundSchema` instead. */
    GenerateArchiveGlobals$.outboundSchema = exports.GenerateArchiveGlobals$outboundSchema;
})(GenerateArchiveGlobals$ || (exports.GenerateArchiveGlobals$ = GenerateArchiveGlobals$ = {}));
function generateArchiveGlobalsToJSON(generateArchiveGlobals) {
    return JSON.stringify(exports.GenerateArchiveGlobals$outboundSchema.parse(generateArchiveGlobals));
}
function generateArchiveGlobalsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GenerateArchiveGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveGlobals' from JSON`);
}
/** @internal */
exports.GenerateArchiveResourceType$inboundSchema = z.nativeEnum(exports.GenerateArchiveResourceType);
/** @internal */
exports.GenerateArchiveResourceType$outboundSchema = exports.GenerateArchiveResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GenerateArchiveResourceType$;
(function (GenerateArchiveResourceType$) {
    /** @deprecated use `GenerateArchiveResourceType$inboundSchema` instead. */
    GenerateArchiveResourceType$.inboundSchema = exports.GenerateArchiveResourceType$inboundSchema;
    /** @deprecated use `GenerateArchiveResourceType$outboundSchema` instead. */
    GenerateArchiveResourceType$.outboundSchema = exports.GenerateArchiveResourceType$outboundSchema;
})(GenerateArchiveResourceType$ || (exports.GenerateArchiveResourceType$ = GenerateArchiveResourceType$ = {}));
/** @internal */
exports.GenerateArchiveType$inboundSchema = z.nativeEnum(exports.GenerateArchiveType);
/** @internal */
exports.GenerateArchiveType$outboundSchema = exports.GenerateArchiveType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GenerateArchiveType$;
(function (GenerateArchiveType$) {
    /** @deprecated use `GenerateArchiveType$inboundSchema` instead. */
    GenerateArchiveType$.inboundSchema = exports.GenerateArchiveType$inboundSchema;
    /** @deprecated use `GenerateArchiveType$outboundSchema` instead. */
    GenerateArchiveType$.outboundSchema = exports.GenerateArchiveType$outboundSchema;
})(GenerateArchiveType$ || (exports.GenerateArchiveType$ = GenerateArchiveType$ = {}));
/** @internal */
exports.Mode$inboundSchema = z.nativeEnum(exports.Mode);
/** @internal */
exports.Mode$outboundSchema = exports.Mode$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Mode$;
(function (Mode$) {
    /** @deprecated use `Mode$inboundSchema` instead. */
    Mode$.inboundSchema = exports.Mode$inboundSchema;
    /** @deprecated use `Mode$outboundSchema` instead. */
    Mode$.outboundSchema = exports.Mode$outboundSchema;
})(Mode$ || (exports.Mode$ = Mode$ = {}));
/** @internal */
exports.TargetFormat$inboundSchema = z.nativeEnum(exports.TargetFormat);
/** @internal */
exports.TargetFormat$outboundSchema = exports.TargetFormat$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TargetFormat$;
(function (TargetFormat$) {
    /** @deprecated use `TargetFormat$inboundSchema` instead. */
    TargetFormat$.inboundSchema = exports.TargetFormat$inboundSchema;
    /** @deprecated use `TargetFormat$outboundSchema` instead. */
    TargetFormat$.outboundSchema = exports.TargetFormat$outboundSchema;
})(TargetFormat$ || (exports.TargetFormat$ = TargetFormat$ = {}));
/** @internal */
exports.GenerateArchiveRequestBody$inboundSchema = z.object({
    signature: z.string().optional(),
    timestamp: z.number().int().optional(),
    api_key: z.string().optional(),
    public_ids: z.array(z.string()).optional(),
    tags: z.array(z.string()).optional(),
    prefixes: z.array(z.string()).optional(),
    type: exports.GenerateArchiveType$inboundSchema.optional(),
    transformations: z.string().optional(),
    mode: exports.Mode$inboundSchema.default("create"),
    target_format: exports.TargetFormat$inboundSchema.default("zip"),
    target_public_id: z.string().optional(),
    target_asset_folder: z.string().optional(),
    flatten_folders: z.boolean().default(false),
    flatten_transformations: z.boolean().default(false),
    skip_transformation_name: z.boolean().default(false),
    allow_missing: z.boolean().default(false),
    expires_at: z.number().int().optional(),
    use_original_filename: z.boolean().default(false),
    async: z.boolean().default(false),
    notification_url: z.string().optional(),
    target_tags: z.array(z.string()).optional(),
    keep_derived: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "api_key": "apiKey",
        "public_ids": "publicIds",
        "target_format": "targetFormat",
        "target_public_id": "targetPublicId",
        "target_asset_folder": "targetAssetFolder",
        "flatten_folders": "flattenFolders",
        "flatten_transformations": "flattenTransformations",
        "skip_transformation_name": "skipTransformationName",
        "allow_missing": "allowMissing",
        "expires_at": "expiresAt",
        "use_original_filename": "useOriginalFilename",
        "notification_url": "notificationUrl",
        "target_tags": "targetTags",
        "keep_derived": "keepDerived",
    });
});
/** @internal */
exports.GenerateArchiveRequestBody$outboundSchema = z.object({
    signature: z.string().optional(),
    timestamp: z.number().int().optional(),
    apiKey: z.string().optional(),
    publicIds: z.array(z.string()).optional(),
    tags: z.array(z.string()).optional(),
    prefixes: z.array(z.string()).optional(),
    type: exports.GenerateArchiveType$outboundSchema.optional(),
    transformations: z.string().optional(),
    mode: exports.Mode$outboundSchema.default("create"),
    targetFormat: exports.TargetFormat$outboundSchema.default("zip"),
    targetPublicId: z.string().optional(),
    targetAssetFolder: z.string().optional(),
    flattenFolders: z.boolean().default(false),
    flattenTransformations: z.boolean().default(false),
    skipTransformationName: z.boolean().default(false),
    allowMissing: z.boolean().default(false),
    expiresAt: z.number().int().optional(),
    useOriginalFilename: z.boolean().default(false),
    async: z.boolean().default(false),
    notificationUrl: z.string().optional(),
    targetTags: z.array(z.string()).optional(),
    keepDerived: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        apiKey: "api_key",
        publicIds: "public_ids",
        targetFormat: "target_format",
        targetPublicId: "target_public_id",
        targetAssetFolder: "target_asset_folder",
        flattenFolders: "flatten_folders",
        flattenTransformations: "flatten_transformations",
        skipTransformationName: "skip_transformation_name",
        allowMissing: "allow_missing",
        expiresAt: "expires_at",
        useOriginalFilename: "use_original_filename",
        notificationUrl: "notification_url",
        targetTags: "target_tags",
        keepDerived: "keep_derived",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GenerateArchiveRequestBody$;
(function (GenerateArchiveRequestBody$) {
    /** @deprecated use `GenerateArchiveRequestBody$inboundSchema` instead. */
    GenerateArchiveRequestBody$.inboundSchema = exports.GenerateArchiveRequestBody$inboundSchema;
    /** @deprecated use `GenerateArchiveRequestBody$outboundSchema` instead. */
    GenerateArchiveRequestBody$.outboundSchema = exports.GenerateArchiveRequestBody$outboundSchema;
})(GenerateArchiveRequestBody$ || (exports.GenerateArchiveRequestBody$ = GenerateArchiveRequestBody$ = {}));
function generateArchiveRequestBodyToJSON(generateArchiveRequestBody) {
    return JSON.stringify(exports.GenerateArchiveRequestBody$outboundSchema.parse(generateArchiveRequestBody));
}
function generateArchiveRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GenerateArchiveRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveRequestBody' from JSON`);
}
/** @internal */
exports.GenerateArchiveRequest$inboundSchema = z.object({
    resource_type: exports.GenerateArchiveResourceType$inboundSchema,
    RequestBody: z.lazy(() => exports.GenerateArchiveRequestBody$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "resource_type": "resourceType",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.GenerateArchiveRequest$outboundSchema = z.object({
    resourceType: exports.GenerateArchiveResourceType$outboundSchema,
    requestBody: z.lazy(() => exports.GenerateArchiveRequestBody$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        resourceType: "resource_type",
        requestBody: "RequestBody",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GenerateArchiveRequest$;
(function (GenerateArchiveRequest$) {
    /** @deprecated use `GenerateArchiveRequest$inboundSchema` instead. */
    GenerateArchiveRequest$.inboundSchema = exports.GenerateArchiveRequest$inboundSchema;
    /** @deprecated use `GenerateArchiveRequest$outboundSchema` instead. */
    GenerateArchiveRequest$.outboundSchema = exports.GenerateArchiveRequest$outboundSchema;
})(GenerateArchiveRequest$ || (exports.GenerateArchiveRequest$ = GenerateArchiveRequest$ = {}));
function generateArchiveRequestToJSON(generateArchiveRequest) {
    return JSON.stringify(exports.GenerateArchiveRequest$outboundSchema.parse(generateArchiveRequest));
}
function generateArchiveRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GenerateArchiveRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveRequest' from JSON`);
}
/** @internal */
exports.GenerateArchiveResponseBody$inboundSchema = z.object({
    asset_id: z.string().optional(),
    public_id: z.string().optional(),
    version: z.number().int().optional(),
    version_id: z.string().optional(),
    resource_type: z.string().optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
        .optional(),
    tags: z.array(z.string()).optional(),
    bytes: z.number().int().optional(),
    type: z.string().optional(),
    url: z.string().optional(),
    secure_url: z.string().optional(),
    folder: z.string().optional(),
    resource_count: z.number().int().optional(),
    file_count: z.number().int().optional(),
    asset_folder: z.string().optional(),
    display_name: z.string().optional(),
    missing_public_ids: z.array(z.string()).optional(),
    empty_tags: z.array(z.string()).optional(),
    empty_prefixes: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "asset_id": "assetId",
        "public_id": "publicId",
        "version_id": "versionId",
        "resource_type": "resourceType",
        "created_at": "createdAt",
        "secure_url": "secureUrl",
        "resource_count": "resourceCount",
        "file_count": "fileCount",
        "asset_folder": "assetFolder",
        "display_name": "displayName",
        "missing_public_ids": "missingPublicIds",
        "empty_tags": "emptyTags",
        "empty_prefixes": "emptyPrefixes",
    });
});
/** @internal */
exports.GenerateArchiveResponseBody$outboundSchema = z.object({
    assetId: z.string().optional(),
    publicId: z.string().optional(),
    version: z.number().int().optional(),
    versionId: z.string().optional(),
    resourceType: z.string().optional(),
    createdAt: z.date().transform(v => v.toISOString()).optional(),
    tags: z.array(z.string()).optional(),
    bytes: z.number().int().optional(),
    type: z.string().optional(),
    url: z.string().optional(),
    secureUrl: z.string().optional(),
    folder: z.string().optional(),
    resourceCount: z.number().int().optional(),
    fileCount: z.number().int().optional(),
    assetFolder: z.string().optional(),
    displayName: z.string().optional(),
    missingPublicIds: z.array(z.string()).optional(),
    emptyTags: z.array(z.string()).optional(),
    emptyPrefixes: z.array(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        assetId: "asset_id",
        publicId: "public_id",
        versionId: "version_id",
        resourceType: "resource_type",
        createdAt: "created_at",
        secureUrl: "secure_url",
        resourceCount: "resource_count",
        fileCount: "file_count",
        assetFolder: "asset_folder",
        displayName: "display_name",
        missingPublicIds: "missing_public_ids",
        emptyTags: "empty_tags",
        emptyPrefixes: "empty_prefixes",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var GenerateArchiveResponseBody$;
(function (GenerateArchiveResponseBody$) {
    /** @deprecated use `GenerateArchiveResponseBody$inboundSchema` instead. */
    GenerateArchiveResponseBody$.inboundSchema = exports.GenerateArchiveResponseBody$inboundSchema;
    /** @deprecated use `GenerateArchiveResponseBody$outboundSchema` instead. */
    GenerateArchiveResponseBody$.outboundSchema = exports.GenerateArchiveResponseBody$outboundSchema;
})(GenerateArchiveResponseBody$ || (exports.GenerateArchiveResponseBody$ = GenerateArchiveResponseBody$ = {}));
function generateArchiveResponseBodyToJSON(generateArchiveResponseBody) {
    return JSON.stringify(exports.GenerateArchiveResponseBody$outboundSchema.parse(generateArchiveResponseBody));
}
function generateArchiveResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GenerateArchiveResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveResponseBody' from JSON`);
}
/** @internal */
exports.GenerateArchiveResponse$inboundSchema = z.union([
    z.lazy(() => exports.GenerateArchiveResponseBody$inboundSchema),
    z.instanceof((ReadableStream)),
]);
/** @internal */
exports.GenerateArchiveResponse$outboundSchema = z.union([
    z.lazy(() => exports.GenerateArchiveResponseBody$outboundSchema),
    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 GenerateArchiveResponse$;
(function (GenerateArchiveResponse$) {
    /** @deprecated use `GenerateArchiveResponse$inboundSchema` instead. */
    GenerateArchiveResponse$.inboundSchema = exports.GenerateArchiveResponse$inboundSchema;
    /** @deprecated use `GenerateArchiveResponse$outboundSchema` instead. */
    GenerateArchiveResponse$.outboundSchema = exports.GenerateArchiveResponse$outboundSchema;
})(GenerateArchiveResponse$ || (exports.GenerateArchiveResponse$ = GenerateArchiveResponse$ = {}));
function generateArchiveResponseToJSON(generateArchiveResponse) {
    return JSON.stringify(exports.GenerateArchiveResponse$outboundSchema.parse(generateArchiveResponse));
}
function generateArchiveResponseFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GenerateArchiveResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveResponse' from JSON`);
}
//# sourceMappingURL=generatearchive.js.map