Skip to content

Attachments

albert.resources.attachments

AttachmentCategory

Bases: str, Enum

Attributes:

Name Type Description
OTHER
SDS
LABEL
SCRIPT

OTHER

OTHER = 'Other'

SDS

SDS = 'SDS'

LABEL

LABEL = 'Label'

SCRIPT

SCRIPT = 'Script'

AttachmentMetadata

Bases: BaseAlbertModel

Show JSON schema:
{
  "$defs": {
    "EntityLinkWithName": {
      "description": "EntityLink that includes the name field in serialization.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "id"
      ],
      "title": "EntityLinkWithName",
      "type": "object"
    }
  },
  "properties": {
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Description"
    },
    "extensions": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/EntityLinkWithName"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Extensions"
    }
  },
  "title": "AttachmentMetadata",
  "type": "object"
}

Fields:

description

description: str | None = None

extensions

extensions: list[EntityLinkWithName] | None = None

Attachment

Bases: BaseResource

Used for attching files to Notes on Tasks, Projects, Inventory, etc. Key should match File.name

Attributes:

Name Type Description
id AttachmentId | None
parent_id str
name str
key str
namespace str
category AttachmentCategory | None
revision_date date | None
file_size int | None
mime_type str | None
signed_url str | None
signed_url_v2 str | None
metadata AttachmentMetadata | dict[str, MetadataItem | list[dict[str, Any]]] | None

id

id: AttachmentId | None = Field(
    default=None, alias="albertId"
)

parent_id

parent_id: str = Field(..., alias='parentId')

name

name: str

key

key: str

namespace

namespace: str = Field(default='result', alias='nameSpace')

category

category: AttachmentCategory | None = None

revision_date

revision_date: date | None = Field(
    default=None, alias="revisionDate"
)

file_size

file_size: int | None = Field(
    default=None,
    alias="fileSize",
    exclude=True,
    frozen=True,
)

mime_type

mime_type: str | None = Field(
    default=None,
    alias="mimeType",
    exclude=True,
    frozen=True,
)

signed_url

signed_url: str | None = Field(
    default=None,
    alias="signedURL",
    exclude=True,
    frozen=True,
)

signed_url_v2

signed_url_v2: str | None = Field(
    default=None,
    alias="signedURLV2",
    exclude=True,
    frozen=True,
)

metadata

metadata: (
    AttachmentMetadata
    | dict[str, MetadataItem | list[dict[str, Any]]]
    | None
) = Field(default=None, alias="Metadata")