Documents
albert.resources.documents
DocumentState
DocumentClass
Access class of a document.
Attributes:
| Name | Type | Description |
|---|---|---|
PRIVATE |
|
|
PUBLIC |
|
|
SHARED |
|
|
CONFIDENTIAL |
|
|
RESTRICTED |
|
DocumentVersion
Bases: BaseAlbertModel
A single version entry in a document's version history.
Each entry represents one version of a document attached to a Data Template.
Obtain the document ID from
DataTemplate.documents
and pass it to
get_document_version_history.
Example
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"
},
"DocumentClass": {
"description": "Access class of a document.",
"enum": [
"private",
"public",
"shared",
"confidential",
"restricted"
],
"title": "DocumentClass",
"type": "string"
},
"DocumentState": {
"description": "Lifecycle state of a document version.",
"enum": [
"draft",
"published",
"archived"
],
"title": "DocumentState",
"type": "string"
}
},
"description": "A single version entry in a document's version history.\n\nEach entry represents one version of a document attached to a Data Template.\nObtain the document ID from\n[`DataTemplate.documents`][albert.resources.data_templates.DataTemplate.documents]\nand pass it to\n[`get_document_version_history`][albert.collections.data_templates.DataTemplateCollection.get_document_version_history].\n\n!!! example\n ```python\n from albert import Albert\n\n client = Albert()\n dt = client.data_templates.get_by_id(id=\"DAT8967\")\n for doc in dt.documents:\n for version in client.data_templates.get_document_version_history(\n document_id=doc.id\n ):\n print(version.doc_version, version.state)\n ```",
"properties": {
"albertId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The document ID (format ``DOC...``).",
"title": "Albertid"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The document name.",
"title": "Name"
},
"nameSpace": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The S3 bucket namespace.",
"title": "Namespace"
},
"key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The S3 storage path for this version.",
"title": "Key"
},
"versionId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The S3 version key for this version.",
"title": "Versionid"
},
"docVersion": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The sequential version number (increments with each new version).",
"title": "Docversion"
},
"class": {
"anyOf": [
{
"$ref": "#/$defs/DocumentClass"
},
{
"type": "null"
}
],
"default": null,
"description": "The access class of the document."
},
"state": {
"anyOf": [
{
"$ref": "#/$defs/DocumentState"
},
{
"type": "null"
}
],
"default": null,
"description": "The lifecycle state of this document version."
},
"signedUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A short-lived S3 download URL for this version's file.",
"title": "Signedurl"
},
"publishedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The timestamp when this version was published, if applicable.",
"title": "Publishedat"
},
"Created": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Who created this version and when."
},
"Updated": {
"anyOf": [
{
"$ref": "#/$defs/AuditFields"
},
{
"type": "null"
}
],
"default": null,
"description": "Who last updated this version and when."
}
},
"title": "DocumentVersion",
"type": "object"
}
Fields:
-
id(str | None) -
name(str | None) -
name_space(str | None) -
key(str | None) -
version_id(str | None) -
doc_version(int | None) -
document_class(DocumentClass | None) -
state(DocumentState | None) -
signed_url(str | None) -
published_at(str | None) -
created(AuditFields | None) -
updated(AuditFields | None)