pub async fn update_password(&self, id: i64, new_password: &str) -> Result<()> {
        let path = format!("/users/{}/password", id);
        let body = json!({ "new_password": new_password });
        let resp = self.build_request(Method::PUT, path).json(&body).send().await.unwrap();
        if resp.status().eq(&StatusCode::OK) {
            Ok(())
        } else {
            Err(anyhow!("failed to update password: {}", resp.text().await?))
        }
    }
/// Change the password on a user that already exists.
Change the password on a user that already exists.
Change the password on a user that already exists .
pub async fn update_password(&self, id: i64, new_password: &str) -> Result<()> {
        let path = format!("/users/{}/password", id);
        let body = json!({ "new_password": new_password });
        let resp = self.build_request(Method::PUT, path).json(&body).send().await.unwrap();
        if resp.status().eq(&StatusCode::OK) {
            Ok(())
        } else {
            Err(anyhow!("failed to update password: {}", resp.text().await?))
        }
    }
pub async fn update_password ( & self , id : i64 , new_password : & str ) -> Result < ( ) > { let path = format ! ( " " id ) ; let body = json ! ( { " " new_password } ) ; let resp = self . build_request ( Method :: PUT , path ) . json ( & body ) . send ( ) . await . unwrap ( ) ; if resp . status ( ) . eq ( & StatusCode :: OK ) { Ok ( ( ) ) } else { Err ( anyhow ! ( " " resp text ( ) await ) ) } }
Change the password on a user that already exists.
Change the password on a user that already exists .
&self
id
i64
new_password
&str
&self
id
i64
new_password
&str