export type DeleteApiV1BucketsBucketIdentifierUploadsUploadIdArgs = {bucket_identifier: string, upload_id: string, delete_s3_object?: boolean | undefined}; export type DeleteApiV1BucketsBucketIdentifierUploadsUploadIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, NamespaceHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Upload * * DELETE /v1/buckets/{bucket_identifier}/uploads/{upload_id} */ export const deleteApiV1BucketsBucketIdentifierUploadsUploadId = async (args: DeleteApiV1BucketsBucketIdentifierUploadsUploadIdArgs, options?: DeleteApiV1BucketsBucketIdentifierUploadsUploadIdOptions) => { const {baseUrl = "https://api.mixpeek.com", fetch: fetchFn = fetch, BearerAuth, NamespaceHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.delete_s3_object != null) query.append("delete_s3_object", String(args.delete_s3_object)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) if (NamespaceHeader !== undefined) headers.set("X-Namespace", NamespaceHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/buckets/${encodeURIComponent(String(args.bucket_identifier))}/uploads/${encodeURIComponent(String(args.upload_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };