export type DeleteApiBackupsBackupIdArgs = {'X-Pinecone-Api-Version': string, backup_id: string}; export type DeleteApiBackupsBackupIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a backup * * DELETE /backups/{backup_id} */ export const deleteApiBackupsBackupId = async (args: DeleteApiBackupsBackupIdArgs, options?: DeleteApiBackupsBackupIdOptions) => { const {baseUrl = "https://api.pinecone.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Pinecone-Api-Version'] != null) headers.set("X-Pinecone-Api-Version", String(args['X-Pinecone-Api-Version'])) if (ApiKeyAuth !== undefined) headers.set("Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/backups/${encodeURIComponent(String(args.backup_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 };