/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 189398e65a00 */ import * as z from "zod"; import { ApiError, ApiError$zodSchema } from "./apierror.js"; import { ResourceType, ResourceType$zodSchema } from "./resourcetype.js"; import { UploadDeliveryType, UploadDeliveryType$zodSchema, } from "./uploaddeliverytype.js"; import { UploadResponse, UploadResponse$zodSchema } from "./uploadresponse.js"; export type RenameAssetGlobals = { cloud_name?: string | undefined }; export const RenameAssetGlobals$zodSchema: z.ZodType = z .object({ cloud_name: z.string().describe( "The cloud name of your product environment.", ).optional(), }); /** * The rename request parameters. */ export type RenameAssetRequestBody = { from_public_id: string; to_public_id: string; type?: UploadDeliveryType | undefined; to_type?: UploadDeliveryType | undefined; overwrite?: boolean | undefined; invalidate?: boolean | undefined; context?: boolean | undefined; metadata?: boolean | undefined; notification_url?: string | undefined; }; export const RenameAssetRequestBody$zodSchema: z.ZodType< RenameAssetRequestBody > = z.object({ context: z.boolean().default(false).describe( "Whether to include contextual metadata in the response. Default is false.", ), from_public_id: z.string().describe("The public ID of the asset to rename."), invalidate: z.boolean().default(false).describe( "Whether to invalidate CDN cache copies of the renamed asset. Default is false.", ), metadata: z.boolean().default(false).describe( "Whether to include structured metadata in the response. Default is false.", ), notification_url: z.string().optional().describe( "URL to notify when the operation is complete.", ), overwrite: z.boolean().default(false).describe( "Whether to overwrite the target asset if it already exists. Default is false.", ), to_public_id: z.string().describe("The new public ID for the asset."), to_type: UploadDeliveryType$zodSchema.optional().describe( "The target delivery type for the renamed asset. If omitted, the delivery type remains unchanged.", ), type: UploadDeliveryType$zodSchema.optional().describe( "The current delivery type of the asset.", ), }).describe("The rename request parameters."); export type RenameAssetRequest = { resource_type: ResourceType; RequestBody: RenameAssetRequestBody; }; export const RenameAssetRequest$zodSchema: z.ZodType = z .object({ RequestBody: z.lazy(() => RenameAssetRequestBody$zodSchema).describe( "The rename request parameters.", ), resource_type: ResourceType$zodSchema.describe( "The type of resource (image, video, or raw).", ), }); export type RenameAssetResponse = ApiError | UploadResponse; export const RenameAssetResponse$zodSchema: z.ZodType = z .union([ ApiError$zodSchema, UploadResponse$zodSchema, ]);