pub async fn update_sysadmin(&self, id: i64, has_admin_role: bool) -> Result<()> {
        let path = format!("/users/{}/sysadmin", id);
        let body = json!({ "has_admin_role": has_admin_role });
        let resp = self.build_request(Method::PUT, path).json(&body).send().await?;
        if resp.status().eq(&StatusCode::OK) {
            Ok(())
        } else {
            Err(anyhow!("failed to update sysadmin: {}", resp.text().await?))
        }
    }
/// Update a registered user to change to be an administrator of Harbor.
Update a registered user to change to be an administrator of Harbor.
Update a registered user to change to be an administrator of Harbor .
pub async fn update_sysadmin(&self, id: i64, has_admin_role: bool) -> Result<()> {
        let path = format!("/users/{}/sysadmin", id);
        let body = json!({ "has_admin_role": has_admin_role });
        let resp = self.build_request(Method::PUT, path).json(&body).send().await?;
        if resp.status().eq(&StatusCode::OK) {
            Ok(())
        } else {
            Err(anyhow!("failed to update sysadmin: {}", resp.text().await?))
        }
    }
pub async fn update_sysadmin ( & self , id : i64 , has_admin_role : bool ) -> Result < ( ) > { let path = format ! ( " " id ) ; let body = json ! ( { " " has_admin_role } ) ; let resp = self . build_request ( Method :: PUT , path ) . json ( & body ) . send ( ) . await ? ; if resp . status ( ) . eq ( & StatusCode :: OK ) { Ok ( ( ) ) } else { Err ( anyhow ! ( " " resp text ( ) await ) ) } }
Update a registered user to change to be an administrator of Harbor.
Update a registered user to change to be an administrator of Harbor .
&self
id
i64
has_admin_role
bool
&self
id
i64
has_admin_role
bool