export type DeleteApiAdminProjectsProjectIdArgs = {'X-Pinecone-Api-Version': string, project_id: string}; export type DeleteApiAdminProjectsProjectIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a project * * DELETE /admin/projects/{project_id} */ export const deleteApiAdminProjectsProjectId = async (args: DeleteApiAdminProjectsProjectIdArgs, options?: DeleteApiAdminProjectsProjectIdOptions) => { const {baseUrl = "https://api.pinecone.io", fetch: fetchFn = fetch, BearerAuth} = 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 (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/admin/projects/${encodeURIComponent(String(args.project_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 };