export type DeleteApiV1beta1ProjectsProjectConfigmapsConfigmapArgs = {project: string, configmap: string}; export type DeleteApiV1beta1ProjectsProjectConfigmapsConfigmapOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a project-level ConfigMap * * DELETE /v1beta1/projects/{project}/configmaps/{configmap} */ export const deleteApiV1beta1ProjectsProjectConfigmapsConfigmap = async (args: DeleteApiV1beta1ProjectsProjectConfigmapsConfigmapArgs, options: DeleteApiV1beta1ProjectsProjectConfigmapsConfigmapOptions) => { 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))}/configmaps/${encodeURIComponent(String(args.configmap))}${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 };