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