Users
albert.resources.users
UserClass
User
Bases: BaseResource
Represents a User on the Albert Platform
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the user. |
id |
str | None
|
The Albert ID of the user. Set when the user is retrieved from Albert. |
location |
Location | None
|
The location of the user. |
email |
EmailStr | None
|
The email of the user. |
roles |
list[Role]
|
The roles of the user. |
user_class |
UserClass
|
The ACL class level of the user. |
metadata |
dict[str, str | list[EntityLink] | EntityLink] | None
|
|
Methods:
| Name | Description |
|---|---|
to_note_mention |
Convert the user to a note mention string. |
UserSearchRoleItem
Bases: BaseAlbertModel
Show JSON schema:
Fields:
UserSearchItem
Bases: BaseAlbertModel, HydrationMixin[User]
Partial user entity as returned by the search.
Show JSON schema:
{
"$defs": {
"UserClass": {
"description": "The ACL class level of the user",
"enum": [
"guest",
"standard",
"trusted",
"privileged",
"admin"
],
"title": "UserClass",
"type": "string"
},
"UserSearchRoleItem": {
"properties": {
"roleId": {
"title": "Roleid",
"type": "string"
},
"roleName": {
"title": "Rolename",
"type": "string"
}
},
"required": [
"roleId",
"roleName"
],
"title": "UserSearchRoleItem",
"type": "object"
}
},
"description": "Partial user entity as returned by the search.",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Albertid"
},
"email": {
"anyOf": [
{
"format": "email",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Email"
},
"userClass": {
"$ref": "#/$defs/UserClass",
"default": "standard"
},
"lastLoginTime": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Lastlogintime"
},
"location": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Location"
},
"locationId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Locationid"
},
"role": {
"items": {
"$ref": "#/$defs/UserSearchRoleItem"
},
"maxItems": 1,
"title": "Role",
"type": "array"
},
"subscription": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Subscription"
}
},
"required": [
"name"
],
"title": "UserSearchItem",
"type": "object"
}
Fields:
-
_collection(BaseCollection | None) -
name(str) -
id(UserId | None) -
email(EmailStr | None) -
user_class(UserClass) -
last_login_time(datetime | None) -
location(str | None) -
location_id(str | None) -
roles(list[UserSearchRoleItem]) -
subscription(str | None)