Skip to content

Activities

albert.resources.activities

ActivityOperationId

Bases: str, Enum

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.

POST_SDS

POST_SDS = 'post.sds'

POST_LABEL

POST_LABEL = 'post.label'

ActivityAction

Bases: str, Enum

The kind of operation recorded by an activity.

Attributes:

Name Type Description
READ str

A read operation (an entity was viewed or fetched).

WRITE str

A write operation (an entity was created or modified).

READ

READ = 'read'

WRITE

WRITE = 'write'

ActivityType

Bases: str, Enum

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 (id is not supported for this type).

ENTITY_ID

ENTITY_ID = 'entityId'

USER_ID

USER_ID = 'userId'

PARENT_ID

PARENT_ID = 'parentId'

UUID

UUID = 'uuid'

DATE

DATE = 'date'

DATE_RANGE

DATE_RANGE = 'dateRange'

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:

name

name: str | None = None

The user's display name.

id

id: str | None = None

The user's Albert ID.

role

role: str | None = None

The user's role at the time of the activity.

user_class

user_class: str | None = None

The user's class value.

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

action: str | None = None

The operation recorded (e.g. "read" or "write").

name

name: str | None = None

Display name of the entity the activity acted on.

pk

pk: str | None = None

The internal partition key for the record.

object_class

object_class: str | None = None

The class of the entity the activity acted on.

logged_at

logged_at: str | None = None

Timestamp when the activity was logged.

operation_id

operation_id: str | None = None

The logged operation identifier.

object_id

object_id: str | None = None

The Albert ID of the entity the activity acted on.

object_type

object_type: str | None = None

The type of the entity the activity acted on.

activity_id

activity_id: str | None = None

The unique ID of the activity record.

user

user: ActivitySearchItemUser | None = None

The user who performed the activity.

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:

id

id: str | None = None

The Albert ID of the activity record.

activity_id

activity_id: str | None = None

The unique activity identifier.

action

action: str | None = None

The operation recorded (e.g. "read" or "write").

operation_id

operation_id: str | None = None

The logged operation identifier.

data

data: dict | None = None

Free-form payload describing the change, when available.

env

env: str | None = None

The environment in which the activity was logged.

name

name: str | None = None

Display name of the entity the activity acted on.

module

module: str | None = None

The platform module the activity belongs to.

sub_module

sub_module: str | None = None

The platform sub-module the activity belongs to.

uri

uri: str | None = None

The resource URI associated with the activity.

uuid

uuid: str | None = None

The activity UUID.

expires_at

expires_at: float | None = None

Expiry timestamp for the record, when applicable.

region

region: str | None = None

The region in which the activity was logged.