export type DeleteApiProjectsProjectIdFoundryCredentialsIdArgs = {project_id: string, id: string}; export type DeleteApiProjectsProjectIdFoundryCredentialsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a credential from the project. * * DELETE /projects/{project_id}/foundry/credentials/{id} */ export const deleteApiProjectsProjectIdFoundryCredentialsId = async (args: DeleteApiProjectsProjectIdFoundryCredentialsIdArgs, options?: DeleteApiProjectsProjectIdFoundryCredentialsIdOptions) => { const {baseUrl = "https://api.cloud.crusoe.ai/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_id))}/foundry/credentials/${encodeURIComponent(String(args.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 };