.. This page is generated by scripts/generate_dataclass_docs.py. Do not edit manually. Models / Persistence ==================== .. automodule:: teksi_hooks.models.persistence AttributePersistenceDecision ---------------------------- .. autoclass:: teksi_hooks.models.persistence.AttributePersistenceDecision :members: Fields ~~~~~~ ``class_id`` Type: ``str`` Canonical identifier of the changed attribute's class to which this persistence decision applies. ``attribute_id`` Type: ``str`` Canonical identifier of the changed attribute to which this persistence decision applies. ``permitted`` Type: ``bool`` Whether the provider is permitted to persist the changed canonical attribute. ``metadata`` Type: ``dict[str, Any]`` Optional model-specific metadata required to implement the persistence decision. This may include source-model provenance, source relation and attribute identifiers, mandatory-value information, mapping references or diagnostic context. Generic persistence logic must not assign semantics to these values. ChangePersistenceDecision ------------------------- .. autoclass:: teksi_hooks.models.persistence.ChangePersistenceDecision :members: Fields ~~~~~~ ``change`` Type: ``Change`` Object-level canonical change being considered for persistence. The change contains the canonical identity, operation, old values and new values. ``permitted`` Type: ``bool`` Object-level persistence decision. For inserted and deleted objects, this indicates whether the object operation is permitted. For updated objects, attribute-level decisions provide the detailed authorization result for changed attributes. ``attribute_decisions`` Type: ``tuple[AttributePersistenceDecision, ...]`` Persistence decisions for changed canonical attributes. These decisions are primarily used for updates and should refer only to attributes in Change.changed_attributes. ``metadata`` Type: ``dict[str, Any]`` Optional model-specific metadata associated with the object-level persistence decision. This may contain source object identities, inheritance information, mapping provenance, cascade information or other data required by a concrete persistence adapter. ChangePersistenceDocument ------------------------- .. autoclass:: teksi_hooks.models.persistence.ChangePersistenceDocument :members: Fields ~~~~~~ ``job_id`` Type: ``str`` Stable identifier of the review job to which this persistence document belongs. ``snapshot_id`` Type: ``UUID`` Stable identifier of the immutable reviewed change snapshot to which these persistence decisions apply. ``version`` Type: ``int`` Version of the persistence-decision document contract. Consumers must reject unsupported versions rather than silently interpreting them using different semantics. ``decisions`` Type: ``tuple[ChangePersistenceDecision, ...]`` Ordered persistence decisions corresponding to the classified canonical changes. ``metadata`` Type: ``dict[str, Any]`` Optional document-level metadata. Generic persistence consumers must not rely on model-specific entries. ChangePersistenceResult ----------------------- .. autoclass:: teksi_hooks.models.persistence.ChangePersistenceResult :members: Fields ~~~~~~ ``change_index`` Type: ``int`` Zero-based index of the corresponding decision in ChangePersistenceDocument.decisions. ``identity`` Type: ``CanonicalObjectIdentity`` Canonical identity of the object whose persistence decision was applied. ``affected_rows`` Type: ``int`` Number of physical database rows affected while persisting the canonical change. The value may be zero when a model-specific decision intentionally results in no live mutation. ``metadata`` Type: ``dict[str, Any]`` Optional model-specific result metadata. This may contain affected physical relations, generated identifiers, ignored operations, cascade results or diagnostic information. DeletionConfirmation -------------------- .. autoclass:: teksi_hooks.models.persistence.DeletionConfirmation :members: Fields ~~~~~~ ``plan_id`` Type: ``str`` Identifier of the confirmed deletion plan. ``confirmed_at`` Type: ``datetime`` Timestamp when the reviewer confirmed the plan. ``reviewer_id`` Type: ``str | None`` Optional identifier of the reviewer who confirmed the deletion plan. ``comment`` Type: ``str | None`` Optional reviewer comment associated with the confirmation. DeletionPlan ------------ .. autoclass:: teksi_hooks.models.persistence.DeletionPlan :members: Fields ~~~~~~ ``plan_id`` Type: ``str`` Stable identifier of this deletion plan. ``job_id`` Type: ``str`` Logical review-job identifier owning the deletion plan. ``snapshot_id`` Type: ``str`` Identifier of the immutable diff snapshot from which the deletion decisions were derived. ``created_at`` Type: ``datetime`` Timestamp when the deletion plan was created. ``targets`` Type: ``tuple[DeletionTarget, ...]`` Ordered canonical objects proposed for deletion. ``metadata`` Type: ``dict[str, Any]`` Optional plan-level metadata, such as the persistence strategy or results of a transactional dry run. DeletionTarget -------------- .. autoclass:: teksi_hooks.models.persistence.DeletionTarget :members: Fields ~~~~~~ ``change_index`` Type: ``int`` Zero-based index of the ChangePersistenceDecision from which this deletion target was derived. ``identity`` Type: ``CanonicalObjectIdentity`` Canonical identity of the object proposed for deletion. ``last_modification`` Type: ``datetime | None`` Last-modification value observed when the deletion plan was created. This value is used for stale-state detection before the deletion is executed. ``metadata`` Type: ``dict[str, Any]`` Optional model-specific deletion metadata. This may include physical relation identifiers, mapped source objects, dependent-object information or cascade diagnostics. PersistenceResult ----------------- .. autoclass:: teksi_hooks.models.persistence.PersistenceResult :members: Fields ~~~~~~ ``snapshot_id`` Type: ``UUID`` Stable identifier of the immutable reviewed change snapshot to which these persistence decisions apply. ``change_results`` Type: ``tuple[ChangePersistenceResult, ...]`` Results for persistence decisions successfully processed by the model-specific persistence adapter. ``metadata`` Type: ``dict[str, Any]`` Optional transaction-level result metadata. This may include the persistence strategy, application schema, transaction identifier, duration or cleanup information.