/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: dee26fb4539d */ import * as z from "zod"; import * as b64$ from "../lib/base64.js"; import { ApiError, ApiError$zodSchema } from "./apierror.js"; import { ManagedDeliveryType, ManagedDeliveryType$zodSchema, } from "./manageddeliverytype.js"; import { ResourceType, ResourceType$zodSchema } from "./resourcetype.js"; export type DownloadAssetGlobals = { cloud_name?: string | undefined }; export const DownloadAssetGlobals$zodSchema: z.ZodType = z .object({ cloud_name: z.string().describe( "The cloud name of your product environment.", ).optional(), }); export type DownloadAssetRequest = { resource_type: ResourceType; public_id: string; format?: string | undefined; type?: ManagedDeliveryType | undefined; expires_at?: number | undefined; attachment?: boolean | undefined; target_filename?: string | undefined; transformation?: string | undefined; }; export const DownloadAssetRequest$zodSchema: z.ZodType = z .object({ attachment: z.boolean().default(false).describe( "Whether to force download as an attachment.", ), expires_at: z.int().describe( "Unix timestamp indicating when the download URL should expire.", ).optional(), format: z.string().describe( "The format to convert the asset to before downloading.", ).optional(), public_id: z.string().describe("The public ID of the asset."), resource_type: ResourceType$zodSchema.describe( "The type of resource (image, video, or raw).", ), target_filename: z.string().describe( "The desired filename for the downloaded file.", ).optional(), transformation: z.string().describe( "A transformation to apply to the asset before downloading.", ).optional(), type: ManagedDeliveryType$zodSchema.optional().describe( "The delivery type of the asset. Default is \"upload\".", ), }); export type DownloadAssetResponse = | ApiError | Uint8Array | string | Uint8Array | string | Uint8Array | string; export const DownloadAssetResponse$zodSchema: z.ZodType = z.union([ ApiError$zodSchema, z.string().describe("Base64-encoded binary content").transform( b64$.bytesFromBase64, ), z.string().describe("Base64-encoded binary content").transform( b64$.bytesFromBase64, ), z.string().describe("Base64-encoded binary content").transform( b64$.bytesFromBase64, ), ]);