pub struct Users { /* private fields */ }Implementations§
Source§impl Users
impl Users
pub fn new(client: &Client) -> Self
Sourcepub fn list(
&self,
search: Option<&str>,
limit: Option<i64>,
offset: Option<i64>,
cursor: Option<&str>,
cursor_direction: Option<&str>,
order_type: Option<&str>,
) -> Result<UserList, AppwriteException>
pub fn list( &self, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<UserList, AppwriteException>
Get a list of all the project’s users. You can use the query params to filter your results.
Sourcepub fn create(
&self,
user_id: &str,
email: &str,
password: &str,
name: Option<&str>,
) -> Result<User, AppwriteException>
pub fn create( &self, user_id: &str, email: &str, password: &str, name: Option<&str>, ) -> Result<User, AppwriteException>
Create a new user.
pub fn get_usage( &self, range: Option<&str>, provider: Option<&str>, ) -> Result<UsageUsers, AppwriteException>
Sourcepub fn get(&self, user_id: &str) -> Result<User, AppwriteException>
pub fn get(&self, user_id: &str) -> Result<User, AppwriteException>
Get a user by its unique ID.
Sourcepub fn delete(&self, user_id: &str) -> Result<Value, AppwriteException>
pub fn delete(&self, user_id: &str) -> Result<Value, AppwriteException>
Delete a user by its unique ID.
Sourcepub fn update_email(
&self,
user_id: &str,
email: &str,
) -> Result<User, AppwriteException>
pub fn update_email( &self, user_id: &str, email: &str, ) -> Result<User, AppwriteException>
Update the user email by its unique ID.
Sourcepub fn get_logs(
&self,
user_id: &str,
limit: Option<i64>,
offset: Option<i64>,
) -> Result<LogList, AppwriteException>
pub fn get_logs( &self, user_id: &str, limit: Option<i64>, offset: Option<i64>, ) -> Result<LogList, AppwriteException>
Get the user activity logs list by its unique ID.
Sourcepub fn update_name(
&self,
user_id: &str,
name: &str,
) -> Result<User, AppwriteException>
pub fn update_name( &self, user_id: &str, name: &str, ) -> Result<User, AppwriteException>
Update the user name by its unique ID.
Sourcepub fn update_password(
&self,
user_id: &str,
password: &str,
) -> Result<User, AppwriteException>
pub fn update_password( &self, user_id: &str, password: &str, ) -> Result<User, AppwriteException>
Update the user password by its unique ID.
Sourcepub fn get_prefs(&self, user_id: &str) -> Result<Preferences, AppwriteException>
pub fn get_prefs(&self, user_id: &str) -> Result<Preferences, AppwriteException>
Get the user preferences by its unique ID.
Sourcepub fn update_prefs(
&self,
user_id: &str,
prefs: Option<HashMap<String, ParamType>>,
) -> Result<Preferences, AppwriteException>
pub fn update_prefs( &self, user_id: &str, prefs: Option<HashMap<String, ParamType>>, ) -> Result<Preferences, AppwriteException>
Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
Sourcepub fn get_sessions(
&self,
user_id: &str,
) -> Result<SessionList, AppwriteException>
pub fn get_sessions( &self, user_id: &str, ) -> Result<SessionList, AppwriteException>
Get the user sessions list by its unique ID.
Sourcepub fn delete_sessions(&self, user_id: &str) -> Result<Value, AppwriteException>
pub fn delete_sessions(&self, user_id: &str) -> Result<Value, AppwriteException>
Delete all user’s sessions by using the user’s unique ID.
Sourcepub fn delete_session(
&self,
user_id: &str,
session_id: &str,
) -> Result<Value, AppwriteException>
pub fn delete_session( &self, user_id: &str, session_id: &str, ) -> Result<Value, AppwriteException>
Delete a user sessions by its unique ID.
Sourcepub fn update_status(
&self,
user_id: &str,
status: bool,
) -> Result<User, AppwriteException>
pub fn update_status( &self, user_id: &str, status: bool, ) -> Result<User, AppwriteException>
Update the user status by its unique ID.
Sourcepub fn update_verification(
&self,
user_id: &str,
email_verification: bool,
) -> Result<User, AppwriteException>
pub fn update_verification( &self, user_id: &str, email_verification: bool, ) -> Result<User, AppwriteException>
Update the user email verification status by its unique ID.