export type DeleteApiV1beta1ProjectsProjectArgs = {project: string}; export type DeleteApiV1beta1ProjectsProjectOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Project * * DELETE /v1beta1/projects/{project} */ export const deleteApiV1beta1ProjectsProject = async (args: DeleteApiV1beta1ProjectsProjectArgs, options: DeleteApiV1beta1ProjectsProjectOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1beta1/projects/${encodeURIComponent(String(args.project))}${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 };