AppwriteElixir.Services.Users (appwrite_elixir v0.1.4-rc)
The Users service allows you to manage your project users. Use this service to search, block, and view your users' info, current sessions, and latest activity logs. You can also use the Users service to edit your users' preferences and personal info.
Link to this section Summary
Functions
Create a new user.
Delete a user by its unique ID.
Delete a user sessions by its unique ID.
Delete all user's sessions by using the user's unique ID.
Get a list of all the project's users. You can use the query params to filter your results.
Get a user by its unique ID.
Get a user activity logs list by its unique ID.
Get the user preferences by its unique ID.
Get the user sessions list by its unique ID.
Update the user email by its unique ID.
Update the user email verification status by its unique ID.
Update the user name by its unique ID.
Update the user password by its unique ID.
Update the user preferences by its unique ID. You can pass only the specific settings you wish to update.
Update the user status by its unique ID.
Link to this section Types
log()
Specs
log() :: %{ event: String.t(), ip: String.t(), time: integer(), osCode: String.t(), osName: String.t(), osVersion: String.t(), clientType: String.t(), clientCode: String.t(), clientName: String.t(), clientVersion: String.t(), clientEngine: String.t(), clientEngineVersion: String.t(), deviceName: String.t(), deviceBrand: String.t(), deviceModel: String.t(), countryCode: String.t(), countryName: String.t(), current: boolean() }
event: Event name.
ip: IP session in use when the session was created.
time: Log creation time in Unix timestamp.
osCode: Operating system code name. View list of available options.
osName: Operating system name.
osVersion: Operating system version.
clientType: Client type.
clientCode: Client code name.
clientName: Client name.
clientVersion: Client version.
clientEngine: Client engine name.
clientEngineVersion: Client engine name.
deviceName: Device name.
deviceBrand: Device brand name.
deviceModel: Device model name.
countryCode: Country two-character ISO 3166-1 alpha code.
countryName: Country name.
session_list_object()
Specs
session_list_object() :: %{sum: integer(), sessions: List[session_object()]}
sum: total number of sessions
sessions: list of sessions
session_object()
Specs
session_object() :: %{ id: String.t(), userId: String.t(), expire: integer(), provider: String.t(), providerUid: String.t(), providerToken: String.t(), ip: String.t(), osCode: String.t(), osName: String.t(), osVersion: String.t(), clientType: String.t(), clientCode: String.t(), clientName: String.t(), clientVersion: String.t(), clientEngine: String.t(), clientEngineVersion: String.t(), deviceName: String.t(), deviceBrand: String.t(), deviceModel: String.t(), countryCode: String.t(), countryName: String.t(), current: boolean() }
$id: Session ID.
userId: User ID.
expire: Session expiration date in Unix timestamp.
provider: Session Provider.
providerUid: Session Provider User ID.
providerToken: Session Provider Token.
ip: IP session in use when the session was created.
osCode: Operating system code name. View list of available options.
osName: Operating system name.
osVersion: Operating system version.
clientType: Client type.
clientCode: Client code name.
clientName: Client name.
clientVersion: Client version.
clientEngine: Client engine name.
clientEngineVersion: Client engine name.
deviceName: Device name.
deviceBrand: Device brand name.
deviceModel: Device model name.
countryCode: Country two-character ISO 3166-1 alpha code.
countryName: Country name.
user_object()
Specs
user_object() :: %{ id: String.t(), name: String.t(), registration: integer(), status: integer(), passwordUpdate: integer(), email: String.t(), emailVerification: boolean(), prefs: %{} }
$id: User ID.
name: User name.
registration: User registration date in Unix timestamp.
status: User status. 0 for Unactivated, 1 for active and 2 is blocked.
passwordUpdate: Unix timestamp of the most recent password update
email: User email address.
emailVerification: Email verification status.
prefs: User preferences as a key-value object
Link to this section Functions
create_user(email, password, name \\ "")
Specs
create_user(String.t(), String.t(), String.t()) :: user_object() | {:error, term()}
Create a new user.
delete_user(user_id)
Specs
delete_user(String.t()) :: nil | :error
Delete a user by its unique ID.
delete_user_session(user_id, session_id)
Specs
Delete a user sessions by its unique ID.
delete_user_sessions(user_id)
Specs
Delete all user's sessions by using the user's unique ID.
get_all_users(search \\ "", limit \\ 25, offset \\ 0, orderType \\ "ASC")
Specs
get_all_users(String.t(), integer(), integer(), String.t()) :: List[user_object()] | {:error, term()}
Get a list of all the project's users. You can use the query params to filter your results.
get_one_user(user_id)
Specs
get_one_user(String.t()) :: user_object() | {:error, term()}
Get a user by its unique ID.
get_user_logs(user_id)
Specs
Get a user activity logs list by its unique ID.
get_user_prefs(user_id)
Specs
Get the user preferences by its unique ID.
get_user_sessions(user_id)
Specs
get_user_sessions(String.t()) :: session_list_object() | {:error, term()}
Get the user sessions list by its unique ID.
update_user_email(user_id, email)
Specs
update_user_email(String.t(), String.t()) :: user_object() | {:error, term()}
Update the user email by its unique ID.
update_user_email_verification(user_id, status)
Specs
update_user_email_verification(String.t(), boolean()) :: user_object() | {:error, term()}
Update the user email verification status by its unique ID.
update_user_name(user_id, name)
Specs
update_user_name(String.t(), String.t()) :: user_object() | {:error, term()}
Update the user name by its unique ID.
update_user_password(user_id, password)
Specs
update_user_password(String.t(), String.t()) :: user_object() | {:error, term()}
Update the user password by its unique ID.
update_user_prefs(user_id, prefs)
Specs
update_user_prefs(String.t(), %{}) :: user_object() | {:error, term()}
Update the user preferences by its unique ID. You can pass only the specific settings you wish to update.
update_user_status(user_id, status)
Specs
update_user_status(String.t(), boolean()) :: user_object() | {:error, term()}
Update the user status by its unique ID.