Activities
albert.resources.activities
ActivityOperationId
A specific logged operation used to scope activity recency queries.
Attributes:
| Name | Type | Description |
|---|---|---|
POST_SDS |
str
|
The most recent Safety Data Sheet (SDS) publish operation. |
POST_LABEL |
str
|
The most recent label publish operation. |
ActivityAction
ActivityType
The scope a get_all
query is anchored to.
Attributes:
| Name | Type | Description |
|---|---|---|
ENTITY_ID |
str
|
Activities for a single entity, identified by its Albert ID. |
USER_ID |
str
|
Activities performed by a single user. |
PARENT_ID |
str
|
Activities for entities belonging to a given parent entity. |
UUID |
str
|
Activities for a single activity UUID. |
DATE |
str
|
Activities on a single date. |
DATE_RANGE |
str
|
Activities across a date range ( |
ActivitySearchItemUser
Bases: BaseAlbertModel
The user associated with an ActivitySearchItem.
Show JSON schema:
{
"description": "The user associated with an [`ActivitySearchItem`][albert.resources.activities.ActivitySearchItem].",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's display name.",
"title": "Name"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's Albert ID.",
"title": "Id"
},
"role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's role at the time of the activity.",
"title": "Role"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's class value.",
"title": "Class"
}
},
"title": "ActivitySearchItemUser",
"type": "object"
}
Fields:
ActivitySearchItem
Bases: BaseAlbertModel
A lightweight activity record returned by
search.
Show JSON schema:
{
"$defs": {
"ActivitySearchItemUser": {
"description": "The user associated with an [`ActivitySearchItem`][albert.resources.activities.ActivitySearchItem].",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's display name.",
"title": "Name"
},
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's Albert ID.",
"title": "Id"
},
"role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's role at the time of the activity.",
"title": "Role"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The user's class value.",
"title": "Class"
}
},
"title": "ActivitySearchItemUser",
"type": "object"
}
},
"description": "A lightweight activity record returned by\n[`search`][albert.collections.activities.ActivityCollection.search].",
"properties": {
"action": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The operation recorded (e.g. ``\"read\"`` or ``\"write\"``).",
"title": "Action"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display name of the entity the activity acted on.",
"title": "Name"
},
"PK": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The internal partition key for the record.",
"title": "Pk"
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The class of the entity the activity acted on.",
"title": "Class"
},
"loggedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Timestamp when the activity was logged.",
"title": "Loggedat"
},
"operationId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The logged operation identifier.",
"title": "Operationid"
},
"objectId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the entity the activity acted on.",
"title": "Objectid"
},
"objectType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The type of the entity the activity acted on.",
"title": "Objecttype"
},
"activityId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unique ID of the activity record.",
"title": "Activityid"
},
"user": {
"anyOf": [
{
"$ref": "#/$defs/ActivitySearchItemUser"
},
{
"type": "null"
}
],
"default": null,
"description": "The user who performed the activity."
}
},
"title": "ActivitySearchItem",
"type": "object"
}
Fields:
-
action(str | None) -
name(str | None) -
pk(str | None) -
object_class(str | None) -
logged_at(str | None) -
operation_id(str | None) -
object_id(str | None) -
object_type(str | None) -
activity_id(str | None) -
user(ActivitySearchItemUser | None)
Activity
Bases: BaseResource
A single event in the Albert activity feed (audit trail).
Returned by get_all.
Each record captures an action performed on an entity, together with metadata
about where in the platform it occurred. Activities are produced by the
platform and are read-only.
Show JSON schema:
{
"$defs": {
"AuditFields": {
"description": "The audit fields for a resource",
"properties": {
"by": {
"default": null,
"title": "By",
"type": "string"
},
"byName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Byname"
},
"at": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "At"
}
},
"title": "AuditFields",
"type": "object"
},
"Status": {
"description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n The resource is fully operational and visible in normal operations.\nINACTIVE : str\n The resource is hidden from normal operations and disabled from use.",
"enum": [
"active",
"inactive"
],
"title": "Status",
"type": "string"
}
},
"description": "A single event in the Albert activity feed (audit trail).\n\nReturned by [`get_all`][albert.collections.activities.ActivityCollection.get_all].\nEach record captures an action performed on an entity, together with metadata\nabout where in the platform it occurred. Activities are produced by the\nplatform and are read-only.",
"properties": {
"status": {
"anyOf": [
{
"$ref": "#/$defs/Status"
},
{
"type": "null"
}
],
"default": null,
"description": "The status of the resource, optional."
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the creation of the resource, optional."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Audit fields for the update of the resource, optional."
},
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Albert ID of the activity record.",
"title": "Albertid"
},
"activityId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The unique activity identifier.",
"title": "Activityid"
},
"action": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The operation recorded (e.g. ``\"read\"`` or ``\"write\"``).",
"title": "Action"
},
"operationId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The logged operation identifier.",
"title": "Operationid"
},
"data": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Free-form payload describing the change, when available.",
"title": "Data"
},
"env": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The environment in which the activity was logged.",
"title": "Env"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Display name of the entity the activity acted on.",
"title": "Name"
},
"module": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The platform module the activity belongs to.",
"title": "Module"
},
"subModule": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The platform sub-module the activity belongs to.",
"title": "Submodule"
},
"uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The resource URI associated with the activity.",
"title": "Uri"
},
"uuid": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The activity UUID.",
"title": "Uuid"
},
"expiresAt": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Expiry timestamp for the record, when applicable.",
"title": "Expiresat"
},
"region": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The region in which the activity was logged.",
"title": "Region"
}
},
"title": "Activity",
"type": "object"
}
Fields:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(str | None) -
activity_id(str | None) -
action(str | None) -
operation_id(str | None) -
data(dict | None) -
env(str | None) -
name(str | None) -
module(str | None) -
sub_module(str | None) -
uri(str | None) -
uuid(str | None) -
expires_at(float | None) -
region(str | None)