Skip to content

Projects

albert.resources.projects

ProjectClass

Bases: str, Enum

The ACL Class of a project

Attributes:

Name Type Description
SHARED
CONFIDENTIAL
PRIVATE

SHARED

SHARED = 'shared'

CONFIDENTIAL

CONFIDENTIAL = 'confidential'

PRIVATE

PRIVATE = 'private'

State

Bases: str, Enum

The current state of a project

Attributes:

Name Type Description
NOT_STARTED
ACTIVE
CLOSED_SUCCESS
CLOSED_ARCHIVED

NOT_STARTED

NOT_STARTED = 'Not Started'

ACTIVE

ACTIVE = 'Active'

CLOSED_SUCCESS

CLOSED_SUCCESS = 'Closed - Success'

CLOSED_ARCHIVED

CLOSED_ARCHIVED = 'Closed - Archived'

TaskConfig

Bases: BaseAlbertModel

The task configuration for a project

Show JSON schema:
{
  "description": "The task configuration for a project",
  "properties": {
    "datatemplateId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Datatemplateid"
    },
    "workflowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Workflowid"
    },
    "defaultTaskName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Defaulttaskname"
    },
    "target": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Target"
    },
    "hidden": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "title": "Hidden"
    }
  },
  "title": "TaskConfig",
  "type": "object"
}

Fields:

datatemplateId

datatemplateId: str | None = None

workflowId

workflowId: str | None = None

defaultTaskName

defaultTaskName: str | None = None

target

target: str | None = None

hidden

hidden: bool | None = False

GridDefault

Bases: str, Enum

The default grid for a project

Attributes:

Name Type Description
PD
WKS

PD

PD = 'PD'

WKS

WKS = 'WKS'

Project

Bases: BaseResource

A project in Albert.

Attributes:

Name Type Description
description str

The description of the project. Used as the name of the project as well.

id str | None

The Albert ID of the project. Set when the project is retrieved from Albert.

locations list[Location] | None

The locations associated with the project. Optional.

project_class ProjectClass

The class of the project. Defaults to PRIVATE.

metadata dict[str, str | list[EntityLink] | EntityLink] | None

The metadata of the project. Optional. Metadata allowed values can be found using the Custom Fields API.

prefix str | None

The prefix of the project. Optional.

acl list[ACL] | None

The ACL of the project. Optional.

task_config list[TaskConfig] | None

The task configuration of the project. Optional.

grid GridDefault | None

The default grid of the project. Optional.

state State | None

The state/status of the project. Allowed states are customizeable using the entitystatus API. Optional.

application_engineering_inventory_ids list[str] | None

Inventory Ids to be added as application engineering. Optional.

Methods:

Name Description
validate_status

Somehow, some statuses are capitalized in the API response. This ensures they are always lowercase.

description

description: str = Field(min_length=1, max_length=2000)

locations

locations: list[SerializeAsEntityLink[Location]] | None = (
    Field(
        default=None,
        min_length=1,
        max_length=20,
        alias="Locations",
    )
)

project_class

project_class: ProjectClass | None = Field(
    default=PRIVATE, alias="class"
)

prefix

prefix: str | None = Field(default=None)

application_engineering_inventory_ids

application_engineering_inventory_ids: list[str] | None = (
    Field(
        default=None,
        alias="appEngg",
        description="Inventory Ids to be added as application engineering",
    )
)

id

id: ProjectId | None = Field(None, alias='albertId')

acl

acl: list[ACL] | None = Field(
    default_factory=list, alias="ACL"
)

old_api_params

old_api_params: dict | None = None

task_config

task_config: list[TaskConfig] | None = Field(
    default_factory=list
)

grid

grid: GridDefault | None = None

metadata

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

status

status: str | None = Field(
    default=None, exclude=True, frozen=True
)

state

state: State | None = Field(default=None, exclude=True)

validate_status

validate_status(value)

Somehow, some statuses are capitalized in the API response. This ensures they are always lowercase.

Source code in src/albert/resources/projects.py
@field_validator("status", mode="before")
def validate_status(cls, value):
    """Somehow, some statuses are capitalized in the API response. This ensures they are always lowercase."""
    if isinstance(value, str):
        return value.lower()
    return value

ProjectSearchItem

Bases: BaseAlbertModel, HydrationMixin[Project]

Show JSON schema:
{
  "properties": {
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Albertid"
    },
    "description": {
      "maxLength": 2000,
      "minLength": 1,
      "title": "Description",
      "type": "string"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Status"
    }
  },
  "required": [
    "description"
  ],
  "title": "ProjectSearchItem",
  "type": "object"
}

Fields:

id

id: ProjectId | None = None

description

description: str

status

status: str | None = None