UpdatePassword()
Changes an existing user’s password.
pub async fn update_password(&self, request: UpdatePasswordRequest) -> Result<()>
When the request sets reset_connection, the client re-establishes its connection using the updated username/password credentials so subsequent requests authenticate with the new password. The password change is applied server-side before the connection is reset; if the reset fails, the returned error states that the password was changed but the connection could not be re-established.
Request Syntax
let request = UpdatePasswordRequest::builder()
.username("alice")
.old_password("old_password")
.new_password("new_password")
.build()?;
REQUEST FIELDS:
username: StringName of the user whose password is changed. Required.
old_password: StringCurrent password of the user. Required.
new_password: StringNew password of the user. Required.
description: Option<String>Optional description of the user.
reset_connection: boolWhether to re-establish the connection with the new credentials after the password update. Defaults to
false.
RETURNS:
Result<()>
Returns Ok(()) on success; returns an Error on failure.
Example
let request = UpdatePasswordRequest::builder()
.username("alice")
.old_password("old_password")
.new_password("new_password")
.reset_connection(true)
.build()?;
client.update_password(request).await?;