export type DeleteApiV1beta1ProjectsProjectRolesRoleArgs = {project: string, role: string}; export type DeleteApiV1beta1ProjectsProjectRolesRoleOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a project-level Kargo Role virtual resource * * DELETE /v1beta1/projects/{project}/roles/{role} */ export const deleteApiV1beta1ProjectsProjectRolesRole = async (args: DeleteApiV1beta1ProjectsProjectRolesRoleArgs, options: DeleteApiV1beta1ProjectsProjectRolesRoleOptions) => { 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))}/roles/${encodeURIComponent(String(args.role))}${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 };