export type DeleteApiOrgsNameRoleBindingsRoleNameUsernameArgs = {name: string, role_name: string, username: string}; export type DeleteApiOrgsNameRoleBindingsRoleNameUsernameOptions = {baseUrl: string, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove an organization role binding * * DELETE /orgs/{name}/role-bindings/{role_name}/{username} * * Also accepts auth: APIKeyAuth */ export const deleteApiOrgsNameRoleBindingsRoleNameUsername = async (args: DeleteApiOrgsNameRoleBindingsRoleNameUsernameArgs, options: DeleteApiOrgsNameRoleBindingsRoleNameUsernameOptions) => { const {baseUrl, fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/orgs/${encodeURIComponent(String(args.name))}/role-bindings/${encodeURIComponent(String(args.role_name))}/${encodeURIComponent(String(args.username))}${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 };