Skip to content

Entity Types

albert.resources.entity_types

EntityCategory

Bases: str, Enum

The category an entity type is based on.

For task entity types this selects the kind of task (property, batch, or general); for inventory entity types it selects the inventory category the type applies to.

Attributes:

Name Type Description
PROPERTY str

Property (measurement) task category.

BATCH str

Batch (formulation) task category.

GENERAL str

General task category.

RAW_MATERIALS str

Raw materials inventory category.

CONSUMABLES str

Consumables inventory category.

EQUIPMENT str

Equipment inventory category.

FORMULAS str

Formulas inventory category.

PROPERTY

PROPERTY = 'Property'

BATCH

BATCH = 'Batch'

GENERAL

GENERAL = 'General'

RAW_MATERIALS

RAW_MATERIALS = 'RawMaterials'

CONSUMABLES

CONSUMABLES = 'Consumables'

EQUIPMENT

EQUIPMENT = 'Equipment'

FORMULAS

FORMULAS = 'Formulas'

EntityServiceType

Bases: str, Enum

The Albert service (entity family) an entity type applies to.

Attributes:

Name Type Description
TASKS str

Entity type applies to Tasks.

PARAMETER_GROUPS str

Entity type applies to Parameter Groups.

DATA_TEMPLATES str

Entity type applies to Data Templates.

PROJECTS str

Entity type applies to Projects.

LOTS str

Entity type applies to Lots.

INVENTORIES str

Entity type applies to Inventory Items.

TASKS

TASKS = 'tasks'

PARAMETER_GROUPS

PARAMETER_GROUPS = 'parametergroups'

DATA_TEMPLATES

DATA_TEMPLATES = 'datatemplates'

PROJECTS

PROJECTS = 'projects'

LOTS

LOTS = 'lots'

INVENTORIES

INVENTORIES = 'inventories'

EntityTypeType

Bases: str, Enum

Whether an entity type is organization-defined or built in.

Attributes:

Name Type Description
CUSTOM str

Defined by the organization to model its own categories of work.

SYSTEM str

Ships with the Albert platform and is not user-created.

CUSTOM

CUSTOM = 'custom'

SYSTEM

SYSTEM = 'system'

FieldSection

Bases: str, Enum

Where a field is displayed within an entity's form.

Only fields placed in the top section can be referenced by an entity type's search query strings (see EntityTypeSearchQueryStrings).

Attributes:

Name Type Description
TOP str

Top section of the form.

BOTTOM str

Bottom section of the form.

TOP

TOP = 'top'

BOTTOM

BOTTOM = 'bottom'

EntityCustomField

Bases: BaseAlbertModel

A custom field attached to an entity type.

Links a defined CustomField to an entity type and describes how it appears on that entity's form (where it sits, whether it is hidden, its default value, and whether it is required).

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "FieldSection": {
      "description": "Where a field is displayed within an entity's form.\n\nOnly fields placed in the top section can be referenced by an entity type's\nsearch query strings (see [`EntityTypeSearchQueryStrings`][albert.resources.entity_types.EntityTypeSearchQueryStrings]).\n\nAttributes\n----------\nTOP : str\n    Top section of the form.\nBOTTOM : str\n    Bottom section of the form.",
      "enum": [
        "top",
        "bottom"
      ],
      "title": "FieldSection",
      "type": "string"
    }
  },
  "description": "A custom field attached to an entity type.\n\nLinks a defined [`CustomField`][albert.resources.custom_fields.CustomField] to an\nentity type and describes how it appears on that entity's form (where it\nsits, whether it is hidden, its default value, and whether it is required).",
  "properties": {
    "id": {
      "description": "The ID of the linked custom field (format ``CTF...``).",
      "title": "Id",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Read-only name of the custom field.",
      "title": "Name"
    },
    "section": {
      "$ref": "#/$defs/FieldSection",
      "description": "Where the field is displayed on the form (top or bottom)."
    },
    "hidden": {
      "description": "Whether the field is hidden from the form.",
      "title": "Hidden",
      "type": "boolean"
    },
    "default": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "$ref": "#/$defs/EntityLink"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The default value applied to the field, if any.",
      "title": "Default"
    },
    "required": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether a value for the field is required.",
      "title": "Required"
    }
  },
  "required": [
    "id",
    "section",
    "hidden"
  ],
  "title": "EntityCustomField",
  "type": "object"
}

Fields:

id

The ID of the linked custom field (format CTF...).

name

name: str | None = None

Read-only name of the custom field.

section

section: FieldSection

Where the field is displayed on the form (top or bottom).

hidden

hidden: bool

Whether the field is hidden from the form.

default

default: str | float | EntityLink | None = None

The default value applied to the field, if any.

required

required: bool | None = None

Whether a value for the field is required.

EntityTypeStandardFieldVisibility

Bases: BaseAlbertModel

Visibility settings for the built-in standard fields of an entity type.

Controls whether the platform's standard Notes, Tags, and Due Date fields are shown on the entity's form.

Show JSON schema:
{
  "description": "Visibility settings for the built-in standard fields of an entity type.\n\nControls whether the platform's standard Notes, Tags, and Due Date fields are\nshown on the entity's form.",
  "properties": {
    "Notes": {
      "description": "Whether the Notes field is visible.",
      "title": "Notes",
      "type": "boolean"
    },
    "Tags": {
      "description": "Whether the Tags field is visible.",
      "title": "Tags",
      "type": "boolean"
    },
    "DueDate": {
      "description": "Whether the Due Date field is visible.",
      "title": "Duedate",
      "type": "boolean"
    }
  },
  "required": [
    "Notes",
    "Tags",
    "DueDate"
  ],
  "title": "EntityTypeStandardFieldVisibility",
  "type": "object"
}

Fields:

notes

notes: bool

Whether the Notes field is visible.

tags

tags: bool

Whether the Tags field is visible.

due_date

due_date: bool

Whether the Due Date field is visible.

EntityTypeStandardFieldRequired

Bases: BaseAlbertModel

Required settings for the built-in standard fields of an entity type.

Controls whether the platform's standard Notes, Tags, and Due Date fields must be filled in on the entity's form.

Show JSON schema:
{
  "description": "Required settings for the built-in standard fields of an entity type.\n\nControls whether the platform's standard Notes, Tags, and Due Date fields\nmust be filled in on the entity's form.",
  "properties": {
    "Notes": {
      "description": "Whether the Notes field is required.",
      "title": "Notes",
      "type": "boolean"
    },
    "Tags": {
      "description": "Whether the Tags field is required.",
      "title": "Tags",
      "type": "boolean"
    },
    "DueDate": {
      "description": "Whether the Due Date field is required.",
      "title": "Duedate",
      "type": "boolean"
    }
  },
  "required": [
    "Notes",
    "Tags",
    "DueDate"
  ],
  "title": "EntityTypeStandardFieldRequired",
  "type": "object"
}

Fields:

notes

notes: bool

Whether the Notes field is required.

tags

tags: bool

Whether the Tags field is required.

due_date

due_date: bool

Whether the Due Date field is required.

EntityTypeSearchQueryStrings

Bases: BaseAlbertModel

Search query strings used to find related entities within an entity type.

These strings define how the platform builds a search query when selecting related Data Templates or Parameter Groups for the entity. They can include {customField} placeholders that are substituted with the actual values of the entity's custom fields.

Example

from albert.resources.entity_types import EntityTypeSearchQueryStrings
# Here the custom field names match on the Task and on the
# Data Templates + Parameter Groups.
search_strings = EntityTypeSearchQueryStrings(
    DAT="customField1={customField1}&customField2={customField2}",
    PRG="customField1={customField1}&customField2={customField2}",
)
Show JSON schema:
{
  "description": "Search query strings used to find related entities within an entity type.\n\nThese strings define how the platform builds a search query when selecting\nrelated Data Templates or Parameter Groups for the entity. They can include\n``{customField}`` placeholders that are substituted with the actual values of\nthe entity's custom fields.\n\n!!! example\n    ```python\n    from albert.resources.entity_types import EntityTypeSearchQueryStrings\n    # Here the custom field names match on the Task and on the\n    # Data Templates + Parameter Groups.\n    search_strings = EntityTypeSearchQueryStrings(\n        DAT=\"customField1={customField1}&customField2={customField2}\",\n        PRG=\"customField1={customField1}&customField2={customField2}\",\n    )\n    ```",
  "properties": {
    "DAT": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Search string for Data Templates.",
      "title": "Dat"
    },
    "PRG": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Search string for Parameter Groups.",
      "title": "Prg"
    }
  },
  "title": "EntityTypeSearchQueryStrings",
  "type": "object"
}

Fields:

DAT

DAT: str | None = None

Search string for Data Templates.

PRG

PRG: str | None = None

Search string for Parameter Groups.

EntityType

Bases: BaseResource

A configurable entity type in the Albert platform.

An entity type defines the structure and behavior of a particular kind of entity (a Task, Inventory Item, Project, Data Template, Parameter Group, or Lot): the custom category it falls under, which custom fields appear on it, how the standard Notes/Tags/Due Date fields behave, and how related-entity searches are built. Entity types can be built-in (system) or organization-defined (custom), and may carry conditional field rules (see EntityTypeRule).

Example

from albert.resources.entity_types import (
    EntityCategory,
    EntityServiceType,
    EntityType,
)
entity_type = EntityType(
    label="Stability Task",
    service=EntityServiceType.TASKS,
    category=EntityCategory.PROPERTY,
)
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"
    },
    "EntityCategory": {
      "description": "The category an entity type is based on.\n\nFor task entity types this selects the kind of task (property, batch, or\ngeneral); for inventory entity types it selects the inventory category the\ntype applies to.\n\nAttributes\n----------\nPROPERTY : str\n    Property (measurement) task category.\nBATCH : str\n    Batch (formulation) task category.\nGENERAL : str\n    General task category.\nRAW_MATERIALS : str\n    Raw materials inventory category.\nCONSUMABLES : str\n    Consumables inventory category.\nEQUIPMENT : str\n    Equipment inventory category.\nFORMULAS : str\n    Formulas inventory category.",
      "enum": [
        "Property",
        "Batch",
        "General",
        "RawMaterials",
        "Consumables",
        "Equipment",
        "Formulas"
      ],
      "title": "EntityCategory",
      "type": "string"
    },
    "EntityCustomField": {
      "description": "A custom field attached to an entity type.\n\nLinks a defined [`CustomField`][albert.resources.custom_fields.CustomField] to an\nentity type and describes how it appears on that entity's form (where it\nsits, whether it is hidden, its default value, and whether it is required).",
      "properties": {
        "id": {
          "description": "The ID of the linked custom field (format ``CTF...``).",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Read-only name of the custom field.",
          "title": "Name"
        },
        "section": {
          "$ref": "#/$defs/FieldSection",
          "description": "Where the field is displayed on the form (top or bottom)."
        },
        "hidden": {
          "description": "Whether the field is hidden from the form.",
          "title": "Hidden",
          "type": "boolean"
        },
        "default": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/EntityLink"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value applied to the field, if any.",
          "title": "Default"
        },
        "required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether a value for the field is required.",
          "title": "Required"
        }
      },
      "required": [
        "id",
        "section",
        "hidden"
      ],
      "title": "EntityCustomField",
      "type": "object"
    },
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityServiceType": {
      "description": "The Albert service (entity family) an entity type applies to.\n\nAttributes\n----------\nTASKS : str\n    Entity type applies to Tasks.\nPARAMETER_GROUPS : str\n    Entity type applies to Parameter Groups.\nDATA_TEMPLATES : str\n    Entity type applies to Data Templates.\nPROJECTS : str\n    Entity type applies to Projects.\nLOTS : str\n    Entity type applies to Lots.\nINVENTORIES : str\n    Entity type applies to Inventory Items.",
      "enum": [
        "tasks",
        "parametergroups",
        "datatemplates",
        "projects",
        "lots",
        "inventories"
      ],
      "title": "EntityServiceType",
      "type": "string"
    },
    "EntityTypeSearchQueryStrings": {
      "description": "Search query strings used to find related entities within an entity type.\n\nThese strings define how the platform builds a search query when selecting\nrelated Data Templates or Parameter Groups for the entity. They can include\n``{customField}`` placeholders that are substituted with the actual values of\nthe entity's custom fields.\n\n!!! example\n    ```python\n    from albert.resources.entity_types import EntityTypeSearchQueryStrings\n    # Here the custom field names match on the Task and on the\n    # Data Templates + Parameter Groups.\n    search_strings = EntityTypeSearchQueryStrings(\n        DAT=\"customField1={customField1}&customField2={customField2}\",\n        PRG=\"customField1={customField1}&customField2={customField2}\",\n    )\n    ```",
      "properties": {
        "DAT": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Search string for Data Templates.",
          "title": "Dat"
        },
        "PRG": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Search string for Parameter Groups.",
          "title": "Prg"
        }
      },
      "title": "EntityTypeSearchQueryStrings",
      "type": "object"
    },
    "EntityTypeStandardFieldRequired": {
      "description": "Required settings for the built-in standard fields of an entity type.\n\nControls whether the platform's standard Notes, Tags, and Due Date fields\nmust be filled in on the entity's form.",
      "properties": {
        "Notes": {
          "description": "Whether the Notes field is required.",
          "title": "Notes",
          "type": "boolean"
        },
        "Tags": {
          "description": "Whether the Tags field is required.",
          "title": "Tags",
          "type": "boolean"
        },
        "DueDate": {
          "description": "Whether the Due Date field is required.",
          "title": "Duedate",
          "type": "boolean"
        }
      },
      "required": [
        "Notes",
        "Tags",
        "DueDate"
      ],
      "title": "EntityTypeStandardFieldRequired",
      "type": "object"
    },
    "EntityTypeStandardFieldVisibility": {
      "description": "Visibility settings for the built-in standard fields of an entity type.\n\nControls whether the platform's standard Notes, Tags, and Due Date fields are\nshown on the entity's form.",
      "properties": {
        "Notes": {
          "description": "Whether the Notes field is visible.",
          "title": "Notes",
          "type": "boolean"
        },
        "Tags": {
          "description": "Whether the Tags field is visible.",
          "title": "Tags",
          "type": "boolean"
        },
        "DueDate": {
          "description": "Whether the Due Date field is visible.",
          "title": "Duedate",
          "type": "boolean"
        }
      },
      "required": [
        "Notes",
        "Tags",
        "DueDate"
      ],
      "title": "EntityTypeStandardFieldVisibility",
      "type": "object"
    },
    "EntityTypeType": {
      "description": "Whether an entity type is organization-defined or built in.\n\nAttributes\n----------\nCUSTOM : str\n    Defined by the organization to model its own categories of work.\nSYSTEM : str\n    Ships with the Albert platform and is not user-created.",
      "enum": [
        "custom",
        "system"
      ],
      "title": "EntityTypeType",
      "type": "string"
    },
    "FieldSection": {
      "description": "Where a field is displayed within an entity's form.\n\nOnly fields placed in the top section can be referenced by an entity type's\nsearch query strings (see [`EntityTypeSearchQueryStrings`][albert.resources.entity_types.EntityTypeSearchQueryStrings]).\n\nAttributes\n----------\nTOP : str\n    Top section of the form.\nBOTTOM : str\n    Bottom section of the form.",
      "enum": [
        "top",
        "bottom"
      ],
      "title": "FieldSection",
      "type": "string"
    },
    "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 configurable entity type in the Albert platform.\n\nAn entity type defines the structure and behavior of a particular kind of\nentity (a Task, Inventory Item, Project, Data Template, Parameter Group, or\nLot): the custom category it falls under, which custom fields appear on it,\nhow the standard Notes/Tags/Due Date fields behave, and how related-entity\nsearches are built. Entity types can be built-in (``system``) or\norganization-defined (``custom``), and may carry conditional field rules (see\n[`EntityTypeRule`][albert.resources.entity_types.EntityTypeRule]).\n\n!!! example\n    ```python\n    from albert.resources.entity_types import (\n        EntityCategory,\n        EntityServiceType,\n        EntityType,\n    )\n    entity_type = EntityType(\n        label=\"Stability Task\",\n        service=EntityServiceType.TASKS,\n        category=EntityCategory.PROPERTY,\n    )\n    ```",
  "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 unique identifier for the entity type (format ``ETT...``). Assigned by Albert when the entity type is created.",
      "title": "Albertid"
    },
    "category": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntityCategory"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The category the entity type belongs to. Required for ``tasks`` and ``inventories`` services."
    },
    "customCategory": {
      "anyOf": [
        {
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A custom category name for the entity type.",
      "title": "Customcategory"
    },
    "label": {
      "description": "The display label shown for the entity type.",
      "title": "Label",
      "type": "string"
    },
    "service": {
      "$ref": "#/$defs/EntityServiceType",
      "description": "The Albert service (entity family) this entity type applies to."
    },
    "type": {
      "$ref": "#/$defs/EntityTypeType",
      "default": "custom",
      "description": "Whether the entity type is ``custom`` or ``system``. Defaults to ``custom``."
    },
    "prefix": {
      "anyOf": [
        {
          "maxLength": 3,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The short prefix used for the IDs of entities of this type.",
      "title": "Prefix"
    },
    "customFields": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/EntityCustomField"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The custom fields configured on this entity type.",
      "title": "Customfields"
    },
    "standardFieldVisibility": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntityTypeStandardFieldVisibility"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Which standard fields (Notes, Tags, Due Date) are visible."
    },
    "standardFieldRequired": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntityTypeStandardFieldRequired"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Which standard fields (Notes, Tags, Due Date) are required."
    },
    "templateBased": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether this entity type is template-based. If True, users can only instantiate it from a template.",
      "title": "Templatebased"
    },
    "lockedTemplate": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the template is locked. If True, users cannot edit the template.",
      "title": "Lockedtemplate"
    },
    "searchQueryString": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntityTypeSearchQueryStrings"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Query strings used to find related Data Templates and Parameter Groups."
    }
  },
  "required": [
    "label",
    "service"
  ],
  "title": "EntityType",
  "type": "object"
}

Fields:

Validators:

id

id: EntityTypeId | None = None

The unique identifier for the entity type (format ETT...). Assigned by Albert when the entity type is created.

category

category: EntityCategory | None = None

The category the entity type belongs to. Required for tasks and inventories services.

custom_category

custom_category: str | None = None

A custom category name for the entity type.

label

label: str

The display label shown for the entity type.

service

The Albert service (entity family) this entity type applies to.

type

Whether the entity type is custom or system. Defaults to custom.

prefix

prefix: str | None = None

The short prefix used for the IDs of entities of this type.

custom_fields

custom_fields: list[EntityCustomField] | None = None

The custom fields configured on this entity type.

standard_field_visibility

standard_field_visibility: (
    EntityTypeStandardFieldVisibility | None
) = None

Which standard fields (Notes, Tags, Due Date) are visible.

standard_field_required

standard_field_required: (
    EntityTypeStandardFieldRequired | None
) = None

Which standard fields (Notes, Tags, Due Date) are required.

template_based

template_based: bool | None = None

Whether this entity type is template-based. If True, users can only instantiate it from a template.

locked_template

locked_template: bool | None = None

Whether the template is locked. If True, users cannot edit the template.

search_query_string

search_query_string: EntityTypeSearchQueryStrings | None = (
    None
)

Query strings used to find related Data Templates and Parameter Groups.

validate_category

validate_category() -> EntityType
Source code in src/albert/resources/entity_types.py
@model_validator(mode="after")
def validate_category(self) -> EntityType:
    if (
        self.service in {EntityServiceType.TASKS, EntityServiceType.INVENTORIES}
        and self.category is None
    ):
        raise ValueError("category is required for tasks and inventories entity types.")
    return self

EntityTypeOptionType

Bases: str, Enum

The kind of value a rule-driven field option holds.

Attributes:

Name Type Description
STRING str

A free-text string value.

LIST str

A value chosen from a predefined list.

LIST_CUSTOM str

A custom list value, as returned by the rules endpoints.

STRING

STRING = 'string'

LIST

LIST = 'list'

LIST_CUSTOM

LIST_CUSTOM = 'list-custom'

EntityLinkOption

Bases: EntityLink

An entity link used as a selectable field option.

Field options serialize their linked entities differently from a base EntityLink; this class handles that alternate (de)serialization.

Show JSON schema:
{
  "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
  "properties": {
    "albertId": {
      "description": "The linked entity's ID.",
      "title": "Albertid",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The linked entity's display name.",
      "title": "Name"
    },
    "category": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Category"
    }
  },
  "required": [
    "albertId"
  ],
  "title": "EntityLinkOption",
  "type": "object"
}

Fields:

id

id: str

The linked entity's ID.

name

name: str | None = None

The linked entity's display name.

EntityTypeFieldOptions

EntityTypeFieldOptions(**data: Any)

Bases: BaseAlbertModel

The selectable options a rule can apply to a field.

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityLinkOption": {
      "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
      "properties": {
        "albertId": {
          "description": "The linked entity's ID.",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The linked entity's display name.",
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "EntityLinkOption",
      "type": "object"
    },
    "EntityTypeOptionType": {
      "description": "The kind of value a rule-driven field option holds.\n\nAttributes\n----------\nSTRING : str\n    A free-text string value.\nLIST : str\n    A value chosen from a predefined list.\nLIST_CUSTOM : str\n    A custom list value, as returned by the rules endpoints.",
      "enum": [
        "string",
        "list",
        "list-custom"
      ],
      "title": "EntityTypeOptionType",
      "type": "string"
    }
  },
  "description": "The selectable options a rule can apply to a field.",
  "properties": {
    "type": {
      "$ref": "#/$defs/EntityTypeOptionType",
      "description": "The kind of option (string, list, or custom list)."
    },
    "values": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/EntityLinkOption"
              },
              {
                "$ref": "#/$defs/EntityLink"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The possible values for the option.",
      "title": "Values"
    }
  },
  "required": [
    "type"
  ],
  "title": "EntityTypeFieldOptions",
  "type": "object"
}

Fields:

Source code in src/albert/resources/entity_types.py
def __init__(self, **data: Any):
    if "values" in data and isinstance(data["values"], list):
        data["values"] = [
            EntityLinkOption(id=v.id, name=v.name) if isinstance(v, EntityLink) else v
            for v in data["values"]
        ]
    super().__init__(**data)

option_type

option_type: EntityTypeOptionType

The kind of option (string, list, or custom list).

values

values: list[str | EntityLinkOption | EntityLink] | None = (
    None
)

The possible values for the option.

EntityTypeRuleAction

EntityTypeRuleAction(**data: Any)

Bases: BaseAlbertModel

A change applied to a target field when a rule case is triggered.

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityLinkOption": {
      "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
      "properties": {
        "albertId": {
          "description": "The linked entity's ID.",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The linked entity's display name.",
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "EntityLinkOption",
      "type": "object"
    },
    "EntityTypeFieldOptions": {
      "description": "The selectable options a rule can apply to a field.",
      "properties": {
        "type": {
          "$ref": "#/$defs/EntityTypeOptionType",
          "description": "The kind of option (string, list, or custom list)."
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "$ref": "#/$defs/EntityLinkOption"
                  },
                  {
                    "$ref": "#/$defs/EntityLink"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The possible values for the option.",
          "title": "Values"
        }
      },
      "required": [
        "type"
      ],
      "title": "EntityTypeFieldOptions",
      "type": "object"
    },
    "EntityTypeOptionType": {
      "description": "The kind of value a rule-driven field option holds.\n\nAttributes\n----------\nSTRING : str\n    A free-text string value.\nLIST : str\n    A value chosen from a predefined list.\nLIST_CUSTOM : str\n    A custom list value, as returned by the rules endpoints.",
      "enum": [
        "string",
        "list",
        "list-custom"
      ],
      "title": "EntityTypeOptionType",
      "type": "string"
    }
  },
  "description": "A change applied to a target field when a rule case is triggered.",
  "properties": {
    "target_field": {
      "description": "The name of the field this action affects.",
      "title": "Target Field",
      "type": "string"
    },
    "target_field_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the target custom field (format ``CTF...``), if known.",
      "title": "Target Field Id"
    },
    "hidden": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the target field is hidden.",
      "title": "Hidden"
    },
    "required": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the target field is required.",
      "title": "Required"
    },
    "default": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "$ref": "#/$defs/EntityLinkOption"
        },
        {
          "$ref": "#/$defs/EntityLink"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The default value applied to the target field.",
      "title": "Default"
    },
    "options": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntityTypeFieldOptions"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The selectable options applied to the target field."
    }
  },
  "required": [
    "target_field"
  ],
  "title": "EntityTypeRuleAction",
  "type": "object"
}

Fields:

Source code in src/albert/resources/entity_types.py
def __init__(self, **data: Any):
    if "default" in data and isinstance(data["default"], EntityLink):
        data["default"] = EntityLinkOption(id=data["default"].id, name=data["default"].name)
    super().__init__(**data)

target_field_name

target_field_name: str

The name of the field this action affects.

target_field_id

target_field_id: CustomFieldId | None = None

The ID of the target custom field (format CTF...), if known.

hidden

hidden: bool | None = None

Whether the target field is hidden.

required

required: bool | None = None

Whether the target field is required.

default

default: (
    str | float | EntityLinkOption | EntityLink | None
) = None

The default value applied to the target field.

options

options: EntityTypeFieldOptions | None = None

The selectable options applied to the target field.

EntityTypeRuleTriggerCase

Bases: BaseAlbertModel

One trigger value and the actions to apply when it matches.

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityLinkOption": {
      "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
      "properties": {
        "albertId": {
          "description": "The linked entity's ID.",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The linked entity's display name.",
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "EntityLinkOption",
      "type": "object"
    },
    "EntityTypeFieldOptions": {
      "description": "The selectable options a rule can apply to a field.",
      "properties": {
        "type": {
          "$ref": "#/$defs/EntityTypeOptionType",
          "description": "The kind of option (string, list, or custom list)."
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "$ref": "#/$defs/EntityLinkOption"
                  },
                  {
                    "$ref": "#/$defs/EntityLink"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The possible values for the option.",
          "title": "Values"
        }
      },
      "required": [
        "type"
      ],
      "title": "EntityTypeFieldOptions",
      "type": "object"
    },
    "EntityTypeOptionType": {
      "description": "The kind of value a rule-driven field option holds.\n\nAttributes\n----------\nSTRING : str\n    A free-text string value.\nLIST : str\n    A value chosen from a predefined list.\nLIST_CUSTOM : str\n    A custom list value, as returned by the rules endpoints.",
      "enum": [
        "string",
        "list",
        "list-custom"
      ],
      "title": "EntityTypeOptionType",
      "type": "string"
    },
    "EntityTypeRuleAction": {
      "description": "A change applied to a target field when a rule case is triggered.",
      "properties": {
        "target_field": {
          "description": "The name of the field this action affects.",
          "title": "Target Field",
          "type": "string"
        },
        "target_field_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the target custom field (format ``CTF...``), if known.",
          "title": "Target Field Id"
        },
        "hidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is hidden.",
          "title": "Hidden"
        },
        "required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is required.",
          "title": "Required"
        },
        "default": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/EntityLinkOption"
            },
            {
              "$ref": "#/$defs/EntityLink"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value applied to the target field.",
          "title": "Default"
        },
        "options": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityTypeFieldOptions"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The selectable options applied to the target field."
        }
      },
      "required": [
        "target_field"
      ],
      "title": "EntityTypeRuleAction",
      "type": "object"
    }
  },
  "description": "One trigger value and the actions to apply when it matches.",
  "properties": {
    "value": {
      "description": "The trigger field value that activates this case.",
      "title": "Value",
      "type": "string"
    },
    "actions": {
      "description": "The actions to apply to target fields when this case is activated.",
      "items": {
        "$ref": "#/$defs/EntityTypeRuleAction"
      },
      "title": "Actions",
      "type": "array"
    }
  },
  "required": [
    "value",
    "actions"
  ],
  "title": "EntityTypeRuleTriggerCase",
  "type": "object"
}

Fields:

value

value: str

The trigger field value that activates this case.

actions

The actions to apply to target fields when this case is activated.

EntityTypeRuleTrigger

Bases: BaseAlbertModel

The set of value cases evaluated for a rule.

Show JSON schema:
{
  "$defs": {
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityLinkOption": {
      "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
      "properties": {
        "albertId": {
          "description": "The linked entity's ID.",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The linked entity's display name.",
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "EntityLinkOption",
      "type": "object"
    },
    "EntityTypeFieldOptions": {
      "description": "The selectable options a rule can apply to a field.",
      "properties": {
        "type": {
          "$ref": "#/$defs/EntityTypeOptionType",
          "description": "The kind of option (string, list, or custom list)."
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "$ref": "#/$defs/EntityLinkOption"
                  },
                  {
                    "$ref": "#/$defs/EntityLink"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The possible values for the option.",
          "title": "Values"
        }
      },
      "required": [
        "type"
      ],
      "title": "EntityTypeFieldOptions",
      "type": "object"
    },
    "EntityTypeOptionType": {
      "description": "The kind of value a rule-driven field option holds.\n\nAttributes\n----------\nSTRING : str\n    A free-text string value.\nLIST : str\n    A value chosen from a predefined list.\nLIST_CUSTOM : str\n    A custom list value, as returned by the rules endpoints.",
      "enum": [
        "string",
        "list",
        "list-custom"
      ],
      "title": "EntityTypeOptionType",
      "type": "string"
    },
    "EntityTypeRuleAction": {
      "description": "A change applied to a target field when a rule case is triggered.",
      "properties": {
        "target_field": {
          "description": "The name of the field this action affects.",
          "title": "Target Field",
          "type": "string"
        },
        "target_field_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the target custom field (format ``CTF...``), if known.",
          "title": "Target Field Id"
        },
        "hidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is hidden.",
          "title": "Hidden"
        },
        "required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is required.",
          "title": "Required"
        },
        "default": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/EntityLinkOption"
            },
            {
              "$ref": "#/$defs/EntityLink"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value applied to the target field.",
          "title": "Default"
        },
        "options": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityTypeFieldOptions"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The selectable options applied to the target field."
        }
      },
      "required": [
        "target_field"
      ],
      "title": "EntityTypeRuleAction",
      "type": "object"
    },
    "EntityTypeRuleTriggerCase": {
      "description": "One trigger value and the actions to apply when it matches.",
      "properties": {
        "value": {
          "description": "The trigger field value that activates this case.",
          "title": "Value",
          "type": "string"
        },
        "actions": {
          "description": "The actions to apply to target fields when this case is activated.",
          "items": {
            "$ref": "#/$defs/EntityTypeRuleAction"
          },
          "title": "Actions",
          "type": "array"
        }
      },
      "required": [
        "value",
        "actions"
      ],
      "title": "EntityTypeRuleTriggerCase",
      "type": "object"
    }
  },
  "description": "The set of value cases evaluated for a rule.",
  "properties": {
    "cases": {
      "description": "The cases evaluated against the trigger field's value; the matching case's actions are applied.",
      "items": {
        "$ref": "#/$defs/EntityTypeRuleTriggerCase"
      },
      "title": "Cases",
      "type": "array"
    }
  },
  "required": [
    "cases"
  ],
  "title": "EntityTypeRuleTrigger",
  "type": "object"
}

Fields:

cases

The cases evaluated against the trigger field's value; the matching case's actions are applied.

EntityTypeRule

Bases: BaseResource

A rule that makes an entity type's field behavior conditional.

A rule watches one custom field (the trigger) and, depending on its value, applies actions to other fields, such as showing, hiding, requiring, or setting default options. Rules are read and set via get_rules and set_rules.

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"
    },
    "EntityLink": {
      "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": "EntityLink",
      "type": "object"
    },
    "EntityLinkOption": {
      "description": "An entity link used as a selectable field option.\n\nField options serialize their linked entities differently from a base\n[`EntityLink`][albert.core.shared.models.base.EntityLink]; this class handles that\nalternate (de)serialization.",
      "properties": {
        "albertId": {
          "description": "The linked entity's ID.",
          "title": "Albertid",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The linked entity's display name.",
          "title": "Name"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        }
      },
      "required": [
        "albertId"
      ],
      "title": "EntityLinkOption",
      "type": "object"
    },
    "EntityTypeFieldOptions": {
      "description": "The selectable options a rule can apply to a field.",
      "properties": {
        "type": {
          "$ref": "#/$defs/EntityTypeOptionType",
          "description": "The kind of option (string, list, or custom list)."
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "$ref": "#/$defs/EntityLinkOption"
                  },
                  {
                    "$ref": "#/$defs/EntityLink"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The possible values for the option.",
          "title": "Values"
        }
      },
      "required": [
        "type"
      ],
      "title": "EntityTypeFieldOptions",
      "type": "object"
    },
    "EntityTypeOptionType": {
      "description": "The kind of value a rule-driven field option holds.\n\nAttributes\n----------\nSTRING : str\n    A free-text string value.\nLIST : str\n    A value chosen from a predefined list.\nLIST_CUSTOM : str\n    A custom list value, as returned by the rules endpoints.",
      "enum": [
        "string",
        "list",
        "list-custom"
      ],
      "title": "EntityTypeOptionType",
      "type": "string"
    },
    "EntityTypeRuleAction": {
      "description": "A change applied to a target field when a rule case is triggered.",
      "properties": {
        "target_field": {
          "description": "The name of the field this action affects.",
          "title": "Target Field",
          "type": "string"
        },
        "target_field_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the target custom field (format ``CTF...``), if known.",
          "title": "Target Field Id"
        },
        "hidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is hidden.",
          "title": "Hidden"
        },
        "required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the target field is required.",
          "title": "Required"
        },
        "default": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/EntityLinkOption"
            },
            {
              "$ref": "#/$defs/EntityLink"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value applied to the target field.",
          "title": "Default"
        },
        "options": {
          "anyOf": [
            {
              "$ref": "#/$defs/EntityTypeFieldOptions"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The selectable options applied to the target field."
        }
      },
      "required": [
        "target_field"
      ],
      "title": "EntityTypeRuleAction",
      "type": "object"
    },
    "EntityTypeRuleTrigger": {
      "description": "The set of value cases evaluated for a rule.",
      "properties": {
        "cases": {
          "description": "The cases evaluated against the trigger field's value; the matching case's actions are applied.",
          "items": {
            "$ref": "#/$defs/EntityTypeRuleTriggerCase"
          },
          "title": "Cases",
          "type": "array"
        }
      },
      "required": [
        "cases"
      ],
      "title": "EntityTypeRuleTrigger",
      "type": "object"
    },
    "EntityTypeRuleTriggerCase": {
      "description": "One trigger value and the actions to apply when it matches.",
      "properties": {
        "value": {
          "description": "The trigger field value that activates this case.",
          "title": "Value",
          "type": "string"
        },
        "actions": {
          "description": "The actions to apply to target fields when this case is activated.",
          "items": {
            "$ref": "#/$defs/EntityTypeRuleAction"
          },
          "title": "Actions",
          "type": "array"
        }
      },
      "required": [
        "value",
        "actions"
      ],
      "title": "EntityTypeRuleTriggerCase",
      "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 rule that makes an entity type's field behavior conditional.\n\nA rule watches one custom field (the trigger) and, depending on its value,\napplies actions to other fields, such as showing, hiding, requiring, or\nsetting default options. Rules are read and set via\n[`get_rules`][albert.collections.entity_types.EntityTypeCollection.get_rules] and\n[`set_rules`][albert.collections.entity_types.EntityTypeCollection.set_rules].",
  "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."
    },
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique identifier for the rule (format ``RUL...``).",
      "title": "Id"
    },
    "customFieldId": {
      "description": "The ID of the trigger custom field the rule watches (format ``CTF...``).",
      "title": "Customfieldid",
      "type": "string"
    },
    "trigger": {
      "$ref": "#/$defs/EntityTypeRuleTrigger",
      "description": "The value cases that determine which actions are applied."
    }
  },
  "required": [
    "customFieldId",
    "trigger"
  ],
  "title": "EntityTypeRule",
  "type": "object"
}

Fields:

id

id: RuleId | None = None

The unique identifier for the rule (format RUL...).

custom_field_id

custom_field_id: CustomFieldId

The ID of the trigger custom field the rule watches (format CTF...).

trigger

The value cases that determine which actions are applied.