/*
 * 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 type of resources to include in the archive. "image" for images, "video" for videos, "raw" for non-media files, or "all" for mixed types.
 */
export const 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".
 */
export const 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
 */
export const Mode = {
    Download: "download",
    Create: "create",
    CreateAndDownload: "create_and_download",
};
/**
 * The format of the generated archive.
 */
export const TargetFormat = {
    Zip: "zip",
    Tgz: "tgz",
};
/** @internal */
export const GenerateArchiveGlobals$inboundSchema = z.object({
    cloud_name: z.string().optional(),
}).transform((v) => {
    return remap$(v, {
        "cloud_name": "cloudName",
    });
});
/** @internal */
export const GenerateArchiveGlobals$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 GenerateArchiveGlobals$;
(function (GenerateArchiveGlobals$) {
    /** @deprecated use `GenerateArchiveGlobals$inboundSchema` instead. */
    GenerateArchiveGlobals$.inboundSchema = GenerateArchiveGlobals$inboundSchema;
    /** @deprecated use `GenerateArchiveGlobals$outboundSchema` instead. */
    GenerateArchiveGlobals$.outboundSchema = GenerateArchiveGlobals$outboundSchema;
})(GenerateArchiveGlobals$ || (GenerateArchiveGlobals$ = {}));
export function generateArchiveGlobalsToJSON(generateArchiveGlobals) {
    return JSON.stringify(GenerateArchiveGlobals$outboundSchema.parse(generateArchiveGlobals));
}
export function generateArchiveGlobalsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GenerateArchiveGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveGlobals' from JSON`);
}
/** @internal */
export const GenerateArchiveResourceType$inboundSchema = z.nativeEnum(GenerateArchiveResourceType);
/** @internal */
export const GenerateArchiveResourceType$outboundSchema = GenerateArchiveResourceType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GenerateArchiveResourceType$;
(function (GenerateArchiveResourceType$) {
    /** @deprecated use `GenerateArchiveResourceType$inboundSchema` instead. */
    GenerateArchiveResourceType$.inboundSchema = GenerateArchiveResourceType$inboundSchema;
    /** @deprecated use `GenerateArchiveResourceType$outboundSchema` instead. */
    GenerateArchiveResourceType$.outboundSchema = GenerateArchiveResourceType$outboundSchema;
})(GenerateArchiveResourceType$ || (GenerateArchiveResourceType$ = {}));
/** @internal */
export const GenerateArchiveType$inboundSchema = z.nativeEnum(GenerateArchiveType);
/** @internal */
export const GenerateArchiveType$outboundSchema = GenerateArchiveType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var GenerateArchiveType$;
(function (GenerateArchiveType$) {
    /** @deprecated use `GenerateArchiveType$inboundSchema` instead. */
    GenerateArchiveType$.inboundSchema = GenerateArchiveType$inboundSchema;
    /** @deprecated use `GenerateArchiveType$outboundSchema` instead. */
    GenerateArchiveType$.outboundSchema = GenerateArchiveType$outboundSchema;
})(GenerateArchiveType$ || (GenerateArchiveType$ = {}));
/** @internal */
export const Mode$inboundSchema = z.nativeEnum(Mode);
/** @internal */
export const Mode$outboundSchema = Mode$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Mode$;
(function (Mode$) {
    /** @deprecated use `Mode$inboundSchema` instead. */
    Mode$.inboundSchema = Mode$inboundSchema;
    /** @deprecated use `Mode$outboundSchema` instead. */
    Mode$.outboundSchema = Mode$outboundSchema;
})(Mode$ || (Mode$ = {}));
/** @internal */
export const TargetFormat$inboundSchema = z.nativeEnum(TargetFormat);
/** @internal */
export const TargetFormat$outboundSchema = TargetFormat$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var TargetFormat$;
(function (TargetFormat$) {
    /** @deprecated use `TargetFormat$inboundSchema` instead. */
    TargetFormat$.inboundSchema = TargetFormat$inboundSchema;
    /** @deprecated use `TargetFormat$outboundSchema` instead. */
    TargetFormat$.outboundSchema = TargetFormat$outboundSchema;
})(TargetFormat$ || (TargetFormat$ = {}));
/** @internal */
export const 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: GenerateArchiveType$inboundSchema.optional(),
    transformations: z.string().optional(),
    mode: Mode$inboundSchema.default("create"),
    target_format: 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 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 */
export const 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: GenerateArchiveType$outboundSchema.optional(),
    transformations: z.string().optional(),
    mode: Mode$outboundSchema.default("create"),
    targetFormat: 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 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.
 */
export var GenerateArchiveRequestBody$;
(function (GenerateArchiveRequestBody$) {
    /** @deprecated use `GenerateArchiveRequestBody$inboundSchema` instead. */
    GenerateArchiveRequestBody$.inboundSchema = GenerateArchiveRequestBody$inboundSchema;
    /** @deprecated use `GenerateArchiveRequestBody$outboundSchema` instead. */
    GenerateArchiveRequestBody$.outboundSchema = GenerateArchiveRequestBody$outboundSchema;
})(GenerateArchiveRequestBody$ || (GenerateArchiveRequestBody$ = {}));
export function generateArchiveRequestBodyToJSON(generateArchiveRequestBody) {
    return JSON.stringify(GenerateArchiveRequestBody$outboundSchema.parse(generateArchiveRequestBody));
}
export function generateArchiveRequestBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GenerateArchiveRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveRequestBody' from JSON`);
}
/** @internal */
export const GenerateArchiveRequest$inboundSchema = z.object({
    resource_type: GenerateArchiveResourceType$inboundSchema,
    RequestBody: z.lazy(() => GenerateArchiveRequestBody$inboundSchema),
}).transform((v) => {
    return remap$(v, {
        "resource_type": "resourceType",
        "RequestBody": "requestBody",
    });
});
/** @internal */
export const GenerateArchiveRequest$outboundSchema = z.object({
    resourceType: GenerateArchiveResourceType$outboundSchema,
    requestBody: z.lazy(() => GenerateArchiveRequestBody$outboundSchema),
}).transform((v) => {
    return 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.
 */
export var GenerateArchiveRequest$;
(function (GenerateArchiveRequest$) {
    /** @deprecated use `GenerateArchiveRequest$inboundSchema` instead. */
    GenerateArchiveRequest$.inboundSchema = GenerateArchiveRequest$inboundSchema;
    /** @deprecated use `GenerateArchiveRequest$outboundSchema` instead. */
    GenerateArchiveRequest$.outboundSchema = GenerateArchiveRequest$outboundSchema;
})(GenerateArchiveRequest$ || (GenerateArchiveRequest$ = {}));
export function generateArchiveRequestToJSON(generateArchiveRequest) {
    return JSON.stringify(GenerateArchiveRequest$outboundSchema.parse(generateArchiveRequest));
}
export function generateArchiveRequestFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GenerateArchiveRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveRequest' from JSON`);
}
/** @internal */
export const 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 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 */
export const 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 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.
 */
export var GenerateArchiveResponseBody$;
(function (GenerateArchiveResponseBody$) {
    /** @deprecated use `GenerateArchiveResponseBody$inboundSchema` instead. */
    GenerateArchiveResponseBody$.inboundSchema = GenerateArchiveResponseBody$inboundSchema;
    /** @deprecated use `GenerateArchiveResponseBody$outboundSchema` instead. */
    GenerateArchiveResponseBody$.outboundSchema = GenerateArchiveResponseBody$outboundSchema;
})(GenerateArchiveResponseBody$ || (GenerateArchiveResponseBody$ = {}));
export function generateArchiveResponseBodyToJSON(generateArchiveResponseBody) {
    return JSON.stringify(GenerateArchiveResponseBody$outboundSchema.parse(generateArchiveResponseBody));
}
export function generateArchiveResponseBodyFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GenerateArchiveResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveResponseBody' from JSON`);
}
/** @internal */
export const GenerateArchiveResponse$inboundSchema = z.union([
    z.lazy(() => GenerateArchiveResponseBody$inboundSchema),
    z.instanceof((ReadableStream)),
]);
/** @internal */
export const GenerateArchiveResponse$outboundSchema = z.union([
    z.lazy(() => 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.
 */
export var GenerateArchiveResponse$;
(function (GenerateArchiveResponse$) {
    /** @deprecated use `GenerateArchiveResponse$inboundSchema` instead. */
    GenerateArchiveResponse$.inboundSchema = GenerateArchiveResponse$inboundSchema;
    /** @deprecated use `GenerateArchiveResponse$outboundSchema` instead. */
    GenerateArchiveResponse$.outboundSchema = GenerateArchiveResponse$outboundSchema;
})(GenerateArchiveResponse$ || (GenerateArchiveResponse$ = {}));
export function generateArchiveResponseToJSON(generateArchiveResponse) {
    return JSON.stringify(GenerateArchiveResponse$outboundSchema.parse(generateArchiveResponse));
}
export function generateArchiveResponseFromJSON(jsonString) {
    return safeParse(jsonString, (x) => GenerateArchiveResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GenerateArchiveResponse' from JSON`);
}
//# sourceMappingURL=generatearchive.js.map