export type DeleteApiAdminServiceAccountsServiceAccountIdArgs = {'X-Pinecone-Api-Version': string, service_account_id: string}; export type DeleteApiAdminServiceAccountsServiceAccountIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a service account * * DELETE /admin/service-accounts/{service_account_id} */ export const deleteApiAdminServiceAccountsServiceAccountId = async (args: DeleteApiAdminServiceAccountsServiceAccountIdArgs, options?: DeleteApiAdminServiceAccountsServiceAccountIdOptions) => { 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/service-accounts/${encodeURIComponent(String(args.service_account_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 };