Skip to content

Instructions

albert.resources.instructions

Models for the batching instructions of formulas.

Batching instructions describe how one specific formula is made as a batch. They come in two layers, which this module's models reflect:

  • The procedure table (InstructionLayout and InstructionRow): the formula's ingredients, procedure stages (parameter groups), and readings (parameters), laid out as ordered rows with one value per relevant column. This is the table shown on the inventory details page in the Albert interface. Row content comes from the Worksheet and is edited there; the SDK reads the rows and can reorder the stages. The row order is an InstructionSequence.
  • The instruction texts (Instruction): authored notes such as "Take the pH of the batch", attached to the formula as a whole or pinned to one ingredient row. These are created, renamed, reordered, copied between formulas, and deleted through the SDK. Their order within each row (or at formula level) is an InstructionOrder.

The row order is held in an InstructionSequence and the instruction-text order in InstructionOrder buckets. Both are determined as follows:

  • Ingredient rows always follow the order set on the Sheet's Product Design; they cannot be reordered per formula.
  • Parameter group rows default to the Sheet's Process Design order, but each formula can override the order of its own groups, placing a group above or below any other row (ingredient or parameter group). A parameter group stays with the ingredient it follows, so reordering ingredients on the Sheet carries the formula's groups along; groups newly added to the Sheet are appended at the end.
  • Parameter rows (the readings and targets inside a group, such as temperature or mixing time) belong to their parent parameter group and move with it; they are not individually reorderable.
  • Instruction texts order independently of the rows: each ingredient row has its own order for the instructions pinned to it, plus one order for the formula-level instructions. New instructions are appended at the end of their order by default. When instructions are listed for a formula, the formula-level instructions come first, then each row's instructions.

Most models here are read-only views returned by the InventoryCollection instruction methods (client.inventory.get_instruction_layout, client.inventory.get_instructions_by_parent_ids, and siblings); only Instruction and InstructionDesignLink are constructed directly, to author instruction texts.

InstructionRowType

Bases: str, Enum

The kind of row in a formula's procedure table.

In the Albert interface, ingredient and total rows are what you see in the formula table on the inventory details page, while parameter groups and parameters come from the Worksheet's Process Design.

Attributes:

Name Type Description
INVENTORY str

An ingredient row: one component material of the formula, carrying its amount (and allowed range) per batch column.

PARAMETER_GROUP str

A stage of the procedure, such as "Premix" or "Heating". Groups the parameter rows below it and is the only kind of row whose order can be customized per formula.

PARAMETER str

A single reading or target inside a parameter group, such as temperature or mixing time. Moves with its parent group.

BLANK str

A blank separator row from the Sheet design, used to visually group rows. Carries no recipe content and never appears in the row order.

TOTAL str

The batch total row, which rolls up the ingredient amounts (for example the total batch size they sum to). The Albert interface uses it to display each ingredient as a percentage of the batch and does not list it among the instructions. Never appears in the row order.

INVENTORY

INVENTORY = 'INV'

PARAMETER_GROUP

PARAMETER_GROUP = 'PRG'

PARAMETER

PARAMETER = 'PRM'

BLANK

BLANK = 'BLK'

TOTAL

TOTAL = 'TOT'

InstructionDesignType

Bases: str, Enum

The Sheet design a sequenced row comes from.

Attributes:

Name Type Description
PRODUCTS str

The Product Design, which holds the formula's ingredient rows.

PROCESS str

The Process Design, which holds the procedure's parameter group and parameter rows.

PRODUCTS

PRODUCTS = 'products'

PROCESS

PROCESS = 'process'

SequencePosition

Bases: str, Enum

Where to place a moved row relative to the reference row.

Attributes:

Name Type Description
ABOVE str

Place the moved row directly above the reference row.

BELOW str

Place the moved row directly below the reference row.

ABOVE

ABOVE = 'above'

BELOW

BELOW = 'below'

InstructionValue

Bases: BaseAlbertModel

One cell of a procedure row: the row's content for a single column.

A row has one value per relevant column, for example the ingredient's amount in a given batch column, its manufacturer, or the row's batch instruction text. The type says which kind of content the value holds.

Read-only; values are edited on the Worksheet.

Show JSON schema:
{
  "description": "One cell of a procedure row: the row's content for a single column.\n\nA row has one value per relevant column, for example the ingredient's\namount in a given batch column, its manufacturer, or the row's batch\ninstruction text. The ``type`` says which kind of content the value holds.\n\nRead-only; values are edited on the Worksheet.",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the entity this value points at, when the value references one\n(for example the batch inventory ID on an amount cell).",
      "title": "Id"
    },
    "colId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the Worksheet column this value belongs to (format ``COL...``).",
      "title": "Colid"
    },
    "type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The kind of value: ``DEF`` for a defined column such as the row name,\n``INV`` for an ingredient amount, ``BTI`` for the row's batch instruction\ntext (the Batch Instruction column in the Albert interface), ``LKP`` for a\nlooked-up attribute, or ``FNC`` for a calculated value.",
      "title": "Type"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display name of the column this value belongs to.",
      "title": "Name"
    },
    "value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The cell content. Plain text for simple cells, or a structured object for\nrich values such as calculated amounts.",
      "title": "Value"
    },
    "calculation": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The calculation applied to this value, when one is defined.",
      "title": "Calculation"
    },
    "minValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The lower bound of the acceptable range for this value, when defined.",
      "title": "Minvalue"
    },
    "maxValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The upper bound of the acceptable range for this value, when defined.",
      "title": "Maxvalue"
    },
    "function": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The inventory function applied to this value, when one is assigned.",
      "title": "Function"
    },
    "attributes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Additional attributes carried by this value, when present.",
      "title": "Attributes"
    },
    "ValueObject": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The structured result of a calculated (``FNC``) value, when present.",
      "title": "Valueobject"
    }
  },
  "title": "InstructionValue",
  "type": "object"
}

Fields:

id

id: str | None = None

The ID of the entity this value points at, when the value references one (for example the batch inventory ID on an amount cell).

col_id

col_id: str | None = None

The ID of the Worksheet column this value belongs to (format COL...).

type

type: str | None = None

The kind of value: DEF for a defined column such as the row name, INV for an ingredient amount, BTI for the row's batch instruction text (the Batch Instruction column in the Albert interface), LKP for a looked-up attribute, or FNC for a calculated value.

name

name: str | None = None

The display name of the column this value belongs to.

value

value: str | dict[str, Any] | list[Any] | None = None

The cell content. Plain text for simple cells, or a structured object for rich values such as calculated amounts.

calculation

calculation: str | None = None

The calculation applied to this value, when one is defined.

min_value

min_value: str | None = None

The lower bound of the acceptable range for this value, when defined.

max_value

max_value: str | None = None

The upper bound of the acceptable range for this value, when defined.

function

function: str | None = None

The inventory function applied to this value, when one is assigned.

attributes

attributes: str | dict[str, Any] | list[Any] | None = None

Additional attributes carried by this value, when present.

value_object

value_object: dict[str, Any] | None = None

The structured result of a calculated (FNC) value, when present.

InstructionRow

Bases: BaseAlbertModel

One row of a formula's procedure table.

A row is one line of the procedure: an ingredient, a procedure stage (parameter group), a single reading (parameter), or a structural row (blank separator, batch total). type says which, and values carries the row's content per column.

Read-only view returned by get_instruction_layout. Row content is edited on the Worksheet; only the order of parameter group rows can be changed through the SDK, via update_instruction_sequence.

Show JSON schema:
{
  "$defs": {
    "InstructionRowType": {
      "description": "The kind of row in a formula's procedure table.\n\nIn the Albert interface, ingredient and total rows are what you see in the\nformula table on the inventory details page, while parameter groups and\nparameters come from the Worksheet's Process Design.\n\nAttributes\n----------\nINVENTORY : str\n    An ingredient row: one component material of the formula, carrying its\n    amount (and allowed range) per batch column.\nPARAMETER_GROUP : str\n    A stage of the procedure, such as \"Premix\" or \"Heating\". Groups the\n    parameter rows below it and is the only kind of row whose order can be\n    customized per formula.\nPARAMETER : str\n    A single reading or target inside a parameter group, such as\n    temperature or mixing time. Moves with its parent group.\nBLANK : str\n    A blank separator row from the Sheet design, used to visually group\n    rows. Carries no recipe content and never appears in the row order.\nTOTAL : str\n    The batch total row, which rolls up the ingredient amounts (for\n    example the total batch size they sum to). The Albert interface uses\n    it to display each ingredient as a percentage of the batch and does\n    not list it among the instructions. Never appears in the row order.",
      "enum": [
        "INV",
        "PRG",
        "PRM",
        "BLK",
        "TOT"
      ],
      "title": "InstructionRowType",
      "type": "string"
    },
    "InstructionValue": {
      "description": "One cell of a procedure row: the row's content for a single column.\n\nA row has one value per relevant column, for example the ingredient's\namount in a given batch column, its manufacturer, or the row's batch\ninstruction text. The ``type`` says which kind of content the value holds.\n\nRead-only; values are edited on the Worksheet.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the entity this value points at, when the value references one\n(for example the batch inventory ID on an amount cell).",
          "title": "Id"
        },
        "colId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the Worksheet column this value belongs to (format ``COL...``).",
          "title": "Colid"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The kind of value: ``DEF`` for a defined column such as the row name,\n``INV`` for an ingredient amount, ``BTI`` for the row's batch instruction\ntext (the Batch Instruction column in the Albert interface), ``LKP`` for a\nlooked-up attribute, or ``FNC`` for a calculated value.",
          "title": "Type"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display name of the column this value belongs to.",
          "title": "Name"
        },
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The cell content. Plain text for simple cells, or a structured object for\nrich values such as calculated amounts.",
          "title": "Value"
        },
        "calculation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The calculation applied to this value, when one is defined.",
          "title": "Calculation"
        },
        "minValue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The lower bound of the acceptable range for this value, when defined.",
          "title": "Minvalue"
        },
        "maxValue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The upper bound of the acceptable range for this value, when defined.",
          "title": "Maxvalue"
        },
        "function": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The inventory function applied to this value, when one is assigned.",
          "title": "Function"
        },
        "attributes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Additional attributes carried by this value, when present.",
          "title": "Attributes"
        },
        "ValueObject": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The structured result of a calculated (``FNC``) value, when present.",
          "title": "Valueobject"
        }
      },
      "title": "InstructionValue",
      "type": "object"
    }
  },
  "description": "One row of a formula's procedure table.\n\nA row is one line of the procedure: an ingredient, a procedure stage\n(parameter group), a single reading (parameter), or a structural row\n(blank separator, batch total). ``type`` says which, and ``values`` carries\nthe row's content per column.\n\nRead-only view returned by\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout].\nRow content is edited on the Worksheet; only the order of parameter group\nrows can be changed through the SDK, via\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence].",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the entity behind the row: the ingredient's inventory ID\n(format ``INVA...``) for ingredient rows, the parameter group ID (format\n``PRG...``) for parameter group rows, or the parameter ID for parameter\nrows. Useful for matching a row to an entity you already know.",
      "title": "Id"
    },
    "rowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The short ID of the row within its design (format ``ROW...``).",
      "title": "Rowid"
    },
    "rowUniqueId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The globally unique row ID, combining the design ID and row ID\n(format ``DES...#ROW...``). This is the value to pass when reordering rows\nwith\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence];\nmatch rows by ``name`` or ``id`` to find it.",
      "title": "Rowuniqueid"
    },
    "type": {
      "anyOf": [
        {
          "$ref": "#/$defs/InstructionRowType"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The kind of row."
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display name of the row (for example the ingredient or stage name).",
      "title": "Name"
    },
    "originalName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The row's original name before any renaming, when different.",
      "title": "Originalname"
    },
    "rowHierarchy": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The path of parent rows above this row, for nested rows.",
      "title": "Rowhierarchy"
    },
    "unitId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the measurement unit for parameter rows (format ``UNI...``).",
      "title": "Unitid"
    },
    "unitName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display name of the measurement unit for parameter rows.",
      "title": "Unitname"
    },
    "labelName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display label for parameter rows, when defined.",
      "title": "Labelname"
    },
    "category": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The category ID of the parameter for parameter rows.",
      "title": "Category"
    },
    "categoryName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display name of the parameter or parameter group category.",
      "title": "Categoryname"
    },
    "validation": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Validation rules configured on a parameter row, when present.",
      "title": "Validation"
    },
    "values": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/InstructionValue"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The row's cell values, one per relevant Worksheet column.",
      "title": "Values"
    }
  },
  "title": "InstructionRow",
  "type": "object"
}

Fields:

id

id: str | None = None

The ID of the entity behind the row: the ingredient's inventory ID (format INVA...) for ingredient rows, the parameter group ID (format PRG...) for parameter group rows, or the parameter ID for parameter rows. Useful for matching a row to an entity you already know.

row_id

row_id: str | None = None

The short ID of the row within its design (format ROW...).

row_unique_id

row_unique_id: str | None = None

The globally unique row ID, combining the design ID and row ID (format DES...#ROW...). This is the value to pass when reordering rows with update_instruction_sequence; match rows by name or id to find it.

type

type: InstructionRowType | None = None

The kind of row.

name

name: str | None = None

The display name of the row (for example the ingredient or stage name).

original_name

original_name: str | None = None

The row's original name before any renaming, when different.

row_hierarchy

row_hierarchy: list[str] | None = None

The path of parent rows above this row, for nested rows.

unit_id

unit_id: str | None = None

The ID of the measurement unit for parameter rows (format UNI...).

unit_name

unit_name: str | None = None

The display name of the measurement unit for parameter rows.

label_name

label_name: str | None = None

The display label for parameter rows, when defined.

category

category: str | None = None

The category ID of the parameter for parameter rows.

category_name

category_name: str | None = None

The display name of the parameter or parameter group category.

validation

validation: dict[str, Any] | None = None

Validation rules configured on a parameter row, when present.

values

values: list[InstructionValue] | None = None

The row's cell values, one per relevant Worksheet column.

InstructionLayout

Bases: BaseAlbertModel

The procedure table of a single formula: its rows with their values.

Covers everything the formula's procedure involves, in display order: ingredients with their amounts, procedure stages and their readings, and any batch instruction text entered per row.

Read-only view returned by get_instruction_layout. The row order alone (without values) is available from get_instruction_sequence.

Show JSON schema:
{
  "$defs": {
    "InstructionRow": {
      "description": "One row of a formula's procedure table.\n\nA row is one line of the procedure: an ingredient, a procedure stage\n(parameter group), a single reading (parameter), or a structural row\n(blank separator, batch total). ``type`` says which, and ``values`` carries\nthe row's content per column.\n\nRead-only view returned by\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout].\nRow content is edited on the Worksheet; only the order of parameter group\nrows can be changed through the SDK, via\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence].",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the entity behind the row: the ingredient's inventory ID\n(format ``INVA...``) for ingredient rows, the parameter group ID (format\n``PRG...``) for parameter group rows, or the parameter ID for parameter\nrows. Useful for matching a row to an entity you already know.",
          "title": "Id"
        },
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The short ID of the row within its design (format ``ROW...``).",
          "title": "Rowid"
        },
        "rowUniqueId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The globally unique row ID, combining the design ID and row ID\n(format ``DES...#ROW...``). This is the value to pass when reordering rows\nwith\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence];\nmatch rows by ``name`` or ``id`` to find it.",
          "title": "Rowuniqueid"
        },
        "type": {
          "anyOf": [
            {
              "$ref": "#/$defs/InstructionRowType"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The kind of row."
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display name of the row (for example the ingredient or stage name).",
          "title": "Name"
        },
        "originalName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The row's original name before any renaming, when different.",
          "title": "Originalname"
        },
        "rowHierarchy": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The path of parent rows above this row, for nested rows.",
          "title": "Rowhierarchy"
        },
        "unitId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the measurement unit for parameter rows (format ``UNI...``).",
          "title": "Unitid"
        },
        "unitName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display name of the measurement unit for parameter rows.",
          "title": "Unitname"
        },
        "labelName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display label for parameter rows, when defined.",
          "title": "Labelname"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The category ID of the parameter for parameter rows.",
          "title": "Category"
        },
        "categoryName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display name of the parameter or parameter group category.",
          "title": "Categoryname"
        },
        "validation": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Validation rules configured on a parameter row, when present.",
          "title": "Validation"
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/InstructionValue"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The row's cell values, one per relevant Worksheet column.",
          "title": "Values"
        }
      },
      "title": "InstructionRow",
      "type": "object"
    },
    "InstructionRowType": {
      "description": "The kind of row in a formula's procedure table.\n\nIn the Albert interface, ingredient and total rows are what you see in the\nformula table on the inventory details page, while parameter groups and\nparameters come from the Worksheet's Process Design.\n\nAttributes\n----------\nINVENTORY : str\n    An ingredient row: one component material of the formula, carrying its\n    amount (and allowed range) per batch column.\nPARAMETER_GROUP : str\n    A stage of the procedure, such as \"Premix\" or \"Heating\". Groups the\n    parameter rows below it and is the only kind of row whose order can be\n    customized per formula.\nPARAMETER : str\n    A single reading or target inside a parameter group, such as\n    temperature or mixing time. Moves with its parent group.\nBLANK : str\n    A blank separator row from the Sheet design, used to visually group\n    rows. Carries no recipe content and never appears in the row order.\nTOTAL : str\n    The batch total row, which rolls up the ingredient amounts (for\n    example the total batch size they sum to). The Albert interface uses\n    it to display each ingredient as a percentage of the batch and does\n    not list it among the instructions. Never appears in the row order.",
      "enum": [
        "INV",
        "PRG",
        "PRM",
        "BLK",
        "TOT"
      ],
      "title": "InstructionRowType",
      "type": "string"
    },
    "InstructionValue": {
      "description": "One cell of a procedure row: the row's content for a single column.\n\nA row has one value per relevant column, for example the ingredient's\namount in a given batch column, its manufacturer, or the row's batch\ninstruction text. The ``type`` says which kind of content the value holds.\n\nRead-only; values are edited on the Worksheet.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the entity this value points at, when the value references one\n(for example the batch inventory ID on an amount cell).",
          "title": "Id"
        },
        "colId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the Worksheet column this value belongs to (format ``COL...``).",
          "title": "Colid"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The kind of value: ``DEF`` for a defined column such as the row name,\n``INV`` for an ingredient amount, ``BTI`` for the row's batch instruction\ntext (the Batch Instruction column in the Albert interface), ``LKP`` for a\nlooked-up attribute, or ``FNC`` for a calculated value.",
          "title": "Type"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The display name of the column this value belongs to.",
          "title": "Name"
        },
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The cell content. Plain text for simple cells, or a structured object for\nrich values such as calculated amounts.",
          "title": "Value"
        },
        "calculation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The calculation applied to this value, when one is defined.",
          "title": "Calculation"
        },
        "minValue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The lower bound of the acceptable range for this value, when defined.",
          "title": "Minvalue"
        },
        "maxValue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The upper bound of the acceptable range for this value, when defined.",
          "title": "Maxvalue"
        },
        "function": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The inventory function applied to this value, when one is assigned.",
          "title": "Function"
        },
        "attributes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Additional attributes carried by this value, when present.",
          "title": "Attributes"
        },
        "ValueObject": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The structured result of a calculated (``FNC``) value, when present.",
          "title": "Valueobject"
        }
      },
      "title": "InstructionValue",
      "type": "object"
    }
  },
  "description": "The procedure table of a single formula: its rows with their values.\n\nCovers everything the formula's procedure involves, in display order:\ningredients with their amounts, procedure stages and their readings, and\nany batch instruction text entered per row.\n\nRead-only view returned by\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout].\nThe row order alone (without values) is available from\n[`get_instruction_sequence`][albert.collections.inventory.InventoryCollection.get_instruction_sequence].",
  "properties": {
    "total": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The number of rows in ``rows``.",
      "title": "Total"
    },
    "inventoryId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the rows belong to (format ``INV...``).",
      "title": "Inventoryid"
    },
    "version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The current version of the row order. Pass this value when reordering\nrows so simultaneous edits are detected.",
      "title": "Version"
    },
    "items": {
      "description": "The formula's rows in display order.",
      "items": {
        "$ref": "#/$defs/InstructionRow"
      },
      "title": "Items",
      "type": "array"
    }
  },
  "title": "InstructionLayout",
  "type": "object"
}

Fields:

total

total: int | None = None

The number of rows in rows.

inventory_id

inventory_id: str | None = None

The ID of the formula the rows belong to (format INV...).

version

version: int | None = None

The current version of the row order. Pass this value when reordering rows so simultaneous edits are detected.

rows

The formula's rows in display order.

InstructionSequenceRow

Bases: BaseAlbertModel

One row's place in the row order of a formula's batching instructions.

Read-only view returned as part of InstructionSequence.

Show JSON schema:
{
  "$defs": {
    "InstructionDesignType": {
      "description": "The Sheet design a sequenced row comes from.\n\nAttributes\n----------\nPRODUCTS : str\n    The Product Design, which holds the formula's ingredient rows.\nPROCESS : str\n    The Process Design, which holds the procedure's parameter group and\n    parameter rows.",
      "enum": [
        "products",
        "process"
      ],
      "title": "InstructionDesignType",
      "type": "string"
    }
  },
  "description": "One row's place in the row order of a formula's batching instructions.\n\nRead-only view returned as part of\n[`InstructionSequence`][albert.resources.instructions.InstructionSequence].",
  "properties": {
    "rowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The globally unique row ID (format ``DES...#ROW...``). To find the ID for\na row you know by name, match it in\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout]\nresults and read its ``row_unique_id``.",
      "title": "Rowid"
    },
    "designType": {
      "anyOf": [
        {
          "$ref": "#/$defs/InstructionDesignType"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Sheet design the row comes from: ``products`` for ingredient rows,\n``process`` for parameter group and parameter rows."
    },
    "isHidden": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the row is currently hidden on the Worksheet.",
      "title": "Ishidden"
    }
  },
  "title": "InstructionSequenceRow",
  "type": "object"
}

Fields:

row_id

row_id: str | None = None

The globally unique row ID (format DES...#ROW...). To find the ID for a row you know by name, match it in get_instruction_layout results and read its row_unique_id.

design_type

design_type: InstructionDesignType | None = None

The Sheet design the row comes from: products for ingredient rows, process for parameter group and parameter rows.

is_hidden

is_hidden: bool | None = None

Whether the row is currently hidden on the Worksheet.

InstructionSequence

Bases: BaseAlbertModel

The row order of a single formula's batching instructions.

Lists every row of the formula's procedure in display order, along with the version used to detect conflicting edits. Ingredient rows always follow the order set on the Sheet's Product Design, while parameter group rows can be reordered per formula via update_instruction_sequence. See the albert.resources.instructions module for the full picture of how the order is determined.

Read-only view returned by get_instruction_sequence and update_instruction_sequence.

Show JSON schema:
{
  "$defs": {
    "InstructionDesignType": {
      "description": "The Sheet design a sequenced row comes from.\n\nAttributes\n----------\nPRODUCTS : str\n    The Product Design, which holds the formula's ingredient rows.\nPROCESS : str\n    The Process Design, which holds the procedure's parameter group and\n    parameter rows.",
      "enum": [
        "products",
        "process"
      ],
      "title": "InstructionDesignType",
      "type": "string"
    },
    "InstructionSequenceRow": {
      "description": "One row's place in the row order of a formula's batching instructions.\n\nRead-only view returned as part of\n[`InstructionSequence`][albert.resources.instructions.InstructionSequence].",
      "properties": {
        "rowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The globally unique row ID (format ``DES...#ROW...``). To find the ID for\na row you know by name, match it in\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout]\nresults and read its ``row_unique_id``.",
          "title": "Rowid"
        },
        "designType": {
          "anyOf": [
            {
              "$ref": "#/$defs/InstructionDesignType"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The Sheet design the row comes from: ``products`` for ingredient rows,\n``process`` for parameter group and parameter rows."
        },
        "isHidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether the row is currently hidden on the Worksheet.",
          "title": "Ishidden"
        }
      },
      "title": "InstructionSequenceRow",
      "type": "object"
    }
  },
  "description": "The row order of a single formula's batching instructions.\n\nLists every row of the formula's procedure in display order, along with the\n``version`` used to detect conflicting edits. Ingredient rows always follow\nthe order set on the Sheet's Product Design, while parameter group rows\ncan be reordered per formula via\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence].\nSee the [`albert.resources.instructions`][albert.resources.instructions]\nmodule for the full picture of how the order is determined.\n\nRead-only view returned by\n[`get_instruction_sequence`][albert.collections.inventory.InventoryCollection.get_instruction_sequence]\nand\n[`update_instruction_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_sequence].",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the sequence belongs to (format ``INV...``).",
      "title": "Id"
    },
    "version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The current version of the row order. Pass this value when reordering so\nsimultaneous edits are detected.",
      "title": "Version"
    },
    "isOverridden": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the order has been customized away from the Worksheet default.",
      "title": "Isoverridden"
    },
    "sequence": {
      "description": "The rows in their current display order.",
      "items": {
        "$ref": "#/$defs/InstructionSequenceRow"
      },
      "title": "Sequence",
      "type": "array"
    }
  },
  "title": "InstructionSequence",
  "type": "object"
}

Fields:

id

id: str | None = None

The ID of the formula the sequence belongs to (format INV...).

version

version: int | None = None

The current version of the row order. Pass this value when reordering so simultaneous edits are detected.

is_overridden

is_overridden: bool | None = None

Whether the order has been customized away from the Worksheet default.

rows

The rows in their current display order.

Bases: BaseAlbertModel

Where an instruction text is pinned within a formula.

Every instruction belongs to a formula (its parent). An instruction can additionally be pinned to one ingredient row of that formula; without a row link it is a formula-level instruction.

Show JSON schema:
{
  "description": "Where an instruction text is pinned within a formula.\n\nEvery instruction belongs to a formula (its parent). An instruction can\nadditionally be pinned to one ingredient row of that formula; without a\nrow link it is a formula-level instruction.",
  "properties": {
    "productId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the instruction belongs to (format ``INV...``).",
      "title": "Productid"
    },
    "designRowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the ingredient row the instruction is pinned to\n(format ``DES...#ROW...``). When None, the instruction applies to the\nformula as a whole. Match rows by name in\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout]\nresults and read their ``row_unique_id`` to find this value.",
      "title": "Designrowid"
    },
    "designInvId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Read-only. The inventory ID of the ingredient behind the linked row\n(format ``INVA...``), when the instruction is pinned to a row.",
      "title": "Designinvid"
    }
  },
  "title": "InstructionDesignLink",
  "type": "object"
}

Fields:

product_id

product_id: str | None = None

The ID of the formula the instruction belongs to (format INV...).

design_row_id

design_row_id: str | None = None

The unique ID of the ingredient row the instruction is pinned to (format DES...#ROW...). When None, the instruction applies to the formula as a whole. Match rows by name in get_instruction_layout results and read their row_unique_id to find this value.

design_inv_id

design_inv_id: str | None = None

Read-only. The inventory ID of the ingredient behind the linked row (format INVA...), when the instruction is pinned to a row.

Instruction

Bases: BaseResource

An authored instruction text on a formula.

A free-text procedure note, such as "Take the pH of the batch", shown with the formula's batching instructions in the Albert interface. Every instruction belongs to exactly one formula (its parent_id) and can optionally be pinned to one of the formula's ingredient rows via design.

Construct this model to author an instruction through create_instruction. id, status, created, and updated are assigned by Albert and read-only. After creation, only name can be changed, via update_instruction.

Example

from albert.resources.instructions import Instruction
instruction = Instruction(name="Take the pH of the batch", parent_id="INV123")
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"
    },
    "InstructionDesignLink": {
      "description": "Where an instruction text is pinned within a formula.\n\nEvery instruction belongs to a formula (its parent). An instruction can\nadditionally be pinned to one ingredient row of that formula; without a\nrow link it is a formula-level instruction.",
      "properties": {
        "productId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the formula the instruction belongs to (format ``INV...``).",
          "title": "Productid"
        },
        "designRowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the ingredient row the instruction is pinned to\n(format ``DES...#ROW...``). When None, the instruction applies to the\nformula as a whole. Match rows by name in\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout]\nresults and read their ``row_unique_id`` to find this value.",
          "title": "Designrowid"
        },
        "designInvId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Read-only. The inventory ID of the ingredient behind the linked row\n(format ``INVA...``), when the instruction is pinned to a row.",
          "title": "Designinvid"
        }
      },
      "title": "InstructionDesignLink",
      "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": "An authored instruction text on a formula.\n\nA free-text procedure note, such as \"Take the pH of the batch\", shown with\nthe formula's batching instructions in the Albert interface. Every\ninstruction belongs to exactly one formula (its ``parent_id``) and can\noptionally be pinned to one of the formula's ingredient rows via ``design``.\n\nConstruct this model to author an instruction through\n[`create_instruction`][albert.collections.inventory.InventoryCollection.create_instruction].\n``id``, ``status``, ``created``, and ``updated`` are assigned by Albert and\nread-only. After creation, only ``name`` can be changed, via\n[`update_instruction`][albert.collections.inventory.InventoryCollection.update_instruction].\n\n!!! example\n    ```python\n    from albert.resources.instructions import Instruction\n    instruction = Instruction(name=\"Take the pH of the batch\", parent_id=\"INV123\")\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."
    },
    "name": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The instruction text (for example \"Take the pH of the batch\"). The only\nfield that can be changed after creation.",
      "title": "Name"
    },
    "parentId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the instruction belongs to (format ``INV...``).\nRequired at creation and fixed afterwards.",
      "title": "Parentid"
    },
    "Design": {
      "anyOf": [
        {
          "$ref": "#/$defs/InstructionDesignLink"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Where the instruction is pinned. Omit ``design_row_id`` for a\nformula-level instruction. Fixed at creation."
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Read-only. The Albert ID of the instruction (format ``ABI...``), assigned\nat creation.",
      "title": "Albertid"
    }
  },
  "title": "Instruction",
  "type": "object"
}

Fields:

name

name: str | None = None

The instruction text (for example "Take the pH of the batch"). The only field that can be changed after creation.

parent_id

parent_id: str | None = None

The ID of the formula the instruction belongs to (format INV...). Required at creation and fixed afterwards.

design

design: InstructionDesignLink | None = None

Where the instruction is pinned. Omit design_row_id for a formula-level instruction. Fixed at creation.

id

id: str | None = None

Read-only. The Albert ID of the instruction (format ABI...), assigned at creation.

InstructionOrder

Bases: BaseAlbertModel

The display order of the instruction texts pinned to one row.

Instruction texts are ordered independently within each pin: one order per ingredient row, plus one order for the formula-level instructions (the bucket with no design_row_id).

Read-only view returned as part of InstructionSet. Change the order with update_instruction_row_sequence.

Show JSON schema:
{
  "description": "The display order of the instruction texts pinned to one row.\n\nInstruction texts are ordered independently within each pin: one order per\ningredient row, plus one order for the formula-level instructions (the\nbucket with no ``design_row_id``).\n\nRead-only view returned as part of\n[`InstructionSet`][albert.resources.instructions.InstructionSet]. Change the\norder with\n[`update_instruction_row_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_row_sequence].",
  "properties": {
    "designRowId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The unique ID of the ingredient row this order belongs to (format\n``DES...#ROW...``). None marks the formula-level instructions.",
      "title": "Designrowid"
    },
    "rowSequence": {
      "description": "The IDs of the pinned instructions in display order (format ``ABI...``).",
      "items": {
        "type": "string"
      },
      "title": "Rowsequence",
      "type": "array"
    }
  },
  "title": "InstructionOrder",
  "type": "object"
}

Fields:

design_row_id

design_row_id: str | None = None

The unique ID of the ingredient row this order belongs to (format DES...#ROW...). None marks the formula-level instructions.

instruction_ids

instruction_ids: list[str]

The IDs of the pinned instructions in display order (format ABI...).

InstructionSet

Bases: BaseAlbertModel

The instruction texts authored on a single formula, with their order.

Read-only view returned by get_instructions_by_parent_ids and update_instruction_row_sequence.

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"
    },
    "Instruction": {
      "description": "An authored instruction text on a formula.\n\nA free-text procedure note, such as \"Take the pH of the batch\", shown with\nthe formula's batching instructions in the Albert interface. Every\ninstruction belongs to exactly one formula (its ``parent_id``) and can\noptionally be pinned to one of the formula's ingredient rows via ``design``.\n\nConstruct this model to author an instruction through\n[`create_instruction`][albert.collections.inventory.InventoryCollection.create_instruction].\n``id``, ``status``, ``created``, and ``updated`` are assigned by Albert and\nread-only. After creation, only ``name`` can be changed, via\n[`update_instruction`][albert.collections.inventory.InventoryCollection.update_instruction].\n\n!!! example\n    ```python\n    from albert.resources.instructions import Instruction\n    instruction = Instruction(name=\"Take the pH of the batch\", parent_id=\"INV123\")\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."
        },
        "name": {
          "anyOf": [
            {
              "maxLength": 1000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The instruction text (for example \"Take the pH of the batch\"). The only\nfield that can be changed after creation.",
          "title": "Name"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the formula the instruction belongs to (format ``INV...``).\nRequired at creation and fixed afterwards.",
          "title": "Parentid"
        },
        "Design": {
          "anyOf": [
            {
              "$ref": "#/$defs/InstructionDesignLink"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Where the instruction is pinned. Omit ``design_row_id`` for a\nformula-level instruction. Fixed at creation."
        },
        "albertId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Read-only. The Albert ID of the instruction (format ``ABI...``), assigned\nat creation.",
          "title": "Albertid"
        }
      },
      "title": "Instruction",
      "type": "object"
    },
    "InstructionDesignLink": {
      "description": "Where an instruction text is pinned within a formula.\n\nEvery instruction belongs to a formula (its parent). An instruction can\nadditionally be pinned to one ingredient row of that formula; without a\nrow link it is a formula-level instruction.",
      "properties": {
        "productId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The ID of the formula the instruction belongs to (format ``INV...``).",
          "title": "Productid"
        },
        "designRowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the ingredient row the instruction is pinned to\n(format ``DES...#ROW...``). When None, the instruction applies to the\nformula as a whole. Match rows by name in\n[`get_instruction_layout`][albert.collections.inventory.InventoryCollection.get_instruction_layout]\nresults and read their ``row_unique_id`` to find this value.",
          "title": "Designrowid"
        },
        "designInvId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Read-only. The inventory ID of the ingredient behind the linked row\n(format ``INVA...``), when the instruction is pinned to a row.",
          "title": "Designinvid"
        }
      },
      "title": "InstructionDesignLink",
      "type": "object"
    },
    "InstructionOrder": {
      "description": "The display order of the instruction texts pinned to one row.\n\nInstruction texts are ordered independently within each pin: one order per\ningredient row, plus one order for the formula-level instructions (the\nbucket with no ``design_row_id``).\n\nRead-only view returned as part of\n[`InstructionSet`][albert.resources.instructions.InstructionSet]. Change the\norder with\n[`update_instruction_row_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_row_sequence].",
      "properties": {
        "designRowId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The unique ID of the ingredient row this order belongs to (format\n``DES...#ROW...``). None marks the formula-level instructions.",
          "title": "Designrowid"
        },
        "rowSequence": {
          "description": "The IDs of the pinned instructions in display order (format ``ABI...``).",
          "items": {
            "type": "string"
          },
          "title": "Rowsequence",
          "type": "array"
        }
      },
      "title": "InstructionOrder",
      "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": "The instruction texts authored on a single formula, with their order.\n\nRead-only view returned by\n[`get_instructions_by_parent_ids`][albert.collections.inventory.InventoryCollection.get_instructions_by_parent_ids]\nand\n[`update_instruction_row_sequence`][albert.collections.inventory.InventoryCollection.update_instruction_row_sequence].",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the instructions belong to (format ``INV...``).",
      "title": "Id"
    },
    "parentId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the formula the instructions belong to (same as ``id``).",
      "title": "Parentid"
    },
    "data": {
      "description": "The formula's instruction texts, in display order.",
      "items": {
        "$ref": "#/$defs/Instruction"
      },
      "title": "Data",
      "type": "array"
    },
    "sequence": {
      "description": "The per-row ordering of the formula's instruction texts.",
      "items": {
        "$ref": "#/$defs/InstructionOrder"
      },
      "title": "Sequence",
      "type": "array"
    }
  },
  "title": "InstructionSet",
  "type": "object"
}

Fields:

id

id: str | None = None

The ID of the formula the instructions belong to (format INV...).

parent_id

parent_id: str | None = None

The ID of the formula the instructions belong to (same as id).

instructions

instructions: list[Instruction]

The formula's instruction texts, in display order.

sequence

The per-row ordering of the formula's instruction texts.

InstructionCopyResult

Bases: BaseAlbertModel

The outcome of copying instruction texts from one formula to others.

Read-only view returned by copy_instructions.

Show JSON schema:
{
  "description": "The outcome of copying instruction texts from one formula to others.\n\nRead-only view returned by\n[`copy_instructions`][albert.collections.inventory.InventoryCollection.copy_instructions].",
  "properties": {
    "copied": {
      "default": 0,
      "description": "The number of target formulas that received the instructions.",
      "title": "Copied",
      "type": "integer"
    },
    "skipped": {
      "default": 0,
      "description": "The number of target formulas skipped, for example because they already\nhad instructions of their own.",
      "title": "Skipped",
      "type": "integer"
    }
  },
  "title": "InstructionCopyResult",
  "type": "object"
}

Fields:

copied

copied: int = 0

The number of target formulas that received the instructions.

skipped

skipped: int = 0

The number of target formulas skipped, for example because they already had instructions of their own.