Entity Types
albert.resources.entity_types
EntityCategory
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. |
EntityServiceType
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. |
EntityTypeType
FieldSection
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. |
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(CustomFieldId) -
name(str | None) -
section(FieldSection) -
hidden(bool) -
default(str | float | EntityLink | None) -
required(bool | None)
default
default: str | float | EntityLink | None = None
The default value applied to the field, if any.
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:
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:
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:
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
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:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(EntityTypeId | None) -
category(EntityCategory | None) -
custom_category(str | None) -
label(str) -
service(EntityServiceType) -
type(EntityTypeType) -
prefix(str | None) -
custom_fields(list[EntityCustomField] | None) -
standard_field_visibility(EntityTypeStandardFieldVisibility | None) -
standard_field_required(EntityTypeStandardFieldRequired | None) -
template_based(bool | None) -
locked_template(bool | None) -
search_query_string(EntityTypeSearchQueryStrings | None)
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.
type
type: EntityTypeType = EntityTypeType.CUSTOM
Whether the entity type is custom or system. Defaults to custom.
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
EntityTypeOptionType
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:
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:
-
option_type(EntityTypeOptionType) -
values(list[str | EntityLinkOption | EntityLink] | None)
Source code in src/albert/resources/entity_types.py
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:
-
target_field_name(str) -
target_field_id(CustomFieldId | None) -
hidden(bool | None) -
required(bool | None) -
default(str | float | EntityLinkOption | EntityLink | None) -
options(EntityTypeFieldOptions | None)
Source code in src/albert/resources/entity_types.py
target_field_id
target_field_id: CustomFieldId | None = None
The ID of the target custom field (format CTF...), if known.
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:
actions
actions: list[EntityTypeRuleAction]
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
cases: list[EntityTypeRuleTriggerCase]
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:
-
status(Status | None) -
created(AuditFields | None) -
updated(AuditFields | None) -
id(RuleId | None) -
custom_field_id(CustomFieldId) -
trigger(EntityTypeRuleTrigger)
custom_field_id
custom_field_id: CustomFieldId
The ID of the trigger custom field the rule watches (format CTF...).