export type DeleteApiV1DocumentsCollectionsCollectionIdUploadUploadedFileIdOptions = {baseUrl?: string | undefined, ClientID?: string | undefined, AccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an uploaded file * * DELETE /v1/documents/collections/{collection_id}/upload/{uploaded_file_id}/ */ export const deleteApiV1DocumentsCollectionsCollectionIdUploadUploadedFileId = async (options?: DeleteApiV1DocumentsCollectionsCollectionIdUploadUploadedFileIdOptions) => { const {baseUrl = "https://prod.truv.com", fetch: fetchFn = fetch, ClientID, AccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ClientID !== undefined) headers.set("X-Access-Client-Id", ClientID) if (AccessKey !== undefined) headers.set("X-Access-Secret", AccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/documents/collections/${encodeURIComponent(String(args.collection_id))}/upload/${encodeURIComponent(String(args.uploaded_file_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 };