/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7e409cc80108 */ import * as z from "zod"; import { ApiError, ApiError$zodSchema } from "./apierror.js"; import { AsyncUploadResponse, AsyncUploadResponse$zodSchema, } from "./asyncuploadresponse.js"; import { NonFinalChunkUploadResponse, NonFinalChunkUploadResponse$zodSchema, } from "./nonfinalchunkuploadresponse.js"; import { UploadRequest, UploadRequest$zodSchema } from "./uploadrequest.js"; import { UploadResourceType, UploadResourceType$zodSchema, } from "./uploadresourcetype.js"; import { UploadResponse, UploadResponse$zodSchema } from "./uploadresponse.js"; export type UploadChunkGlobals = { cloud_name?: string | undefined }; export const UploadChunkGlobals$zodSchema: z.ZodType = z .object({ cloud_name: z.string().describe( "The cloud name of your product environment.", ).optional(), }); export type UploadChunkRequest = { resource_type?: UploadResourceType | undefined; contentRange: string; xUniqueUploadId: string; upload_request: UploadRequest; }; export const UploadChunkRequest$zodSchema: z.ZodType = z .object({ contentRange: z.string().describe( "The range of bytes being uploaded in the current chunk, in the format \"bytes start-end/total\". For example, \"bytes 0-999999/3000000\" indicates the first 1MB chunk of a 3MB file.", ), resource_type: UploadResourceType$zodSchema.default("auto").describe( "The type of resource (image, video, raw, or auto).", ), upload_request: UploadRequest$zodSchema.describe( "The file to upload and associated parameters.", ), xUniqueUploadId: z.string().describe( "A unique identifier for the upload. Must be the same for all chunks of the same file.", ), }); /** * Chunk upload successful. For all but the final chunk, this returns upload status. For the final chunk, it returns the complete upload response. */ export type UploadChunkResponseBody = | AsyncUploadResponse | NonFinalChunkUploadResponse | UploadResponse; export const UploadChunkResponseBody$zodSchema: z.ZodType< UploadChunkResponseBody > = z.union([ AsyncUploadResponse$zodSchema, NonFinalChunkUploadResponse$zodSchema, UploadResponse$zodSchema, ]).describe( "Chunk upload successful. For all but the final chunk, this returns upload status. For the final chunk, it returns the complete upload response.", ); export type UploadChunkResponse = | ApiError | AsyncUploadResponse | NonFinalChunkUploadResponse | UploadResponse | string; export const UploadChunkResponse$zodSchema: z.ZodType = z .union([ ApiError$zodSchema, z.union([ AsyncUploadResponse$zodSchema, NonFinalChunkUploadResponse$zodSchema, UploadResponse$zodSchema, ]), z.string().describe( "Redirect to callback URL (when 'callback' parameter is provided and request is not XHR).", ), ]);