.. This page is generated by scripts/generate_dataclass_docs.py. Do not edit manually. Models / Validation =================== .. automodule:: teksi_hooks.models.validation AttributeChange --------------- .. autoclass:: teksi_hooks.models.validation.AttributeChange :members: Fields ~~~~~~ ``attribute_name`` Type: ``str`` Name of the changed attribute. ``old_value`` Type: ``Any | None`` Previous value of the attribute. For inserts this is usually `None`. ``new_value`` Type: ``Any | None`` Submitted or resulting value of the attribute. For deletes this is usually `None`. AttributeValidation ------------------- .. autoclass:: teksi_hooks.models.validation.AttributeValidation :members: Fields ~~~~~~ ``id`` Type: ``str`` Identifier of the validation rule, for example `newer_than_existing`. ``level`` Type: ``Severity`` Severity emitted when this validation produces a finding. ``operations`` Type: ``list[ChangeOperation]`` List of ChangeOperations on which the AttributeValidation is executed. Defaults to insert, update and delete ``context_value`` Type: ``str`` Optional context value name that is needed for validation, for example `provider_oid` or `dataowner_oid`. ``parameters`` Type: ``Mapping[str, Any]`` Validation-specific configuration values interpreted by the selected validation implementation. Generic validation orchestration must not assign semantics to these entries. Change ------ .. autoclass:: teksi_hooks.models.validation.Change :members: Fields ~~~~~~ ``table_name`` Type: ``str`` Canonical table or class identifier affected by the change. ``object_id`` Type: ``str`` Object identifier of the changed row. ``operation`` Type: ``ChangeOperation`` Type of row-level operation: insert, update or delete. ``old_values`` Type: ``dict[str, Any]`` Attribute values before the change. For inserts this is usually empty. ``new_values`` Type: ``dict[str, Any]`` Attribute values after the change. For deletes this is usually empty. ChangeClassificationMetadata ---------------------------- .. autoclass:: teksi_hooks.models.validation.ChangeClassificationMetadata :members: Fields ~~~~~~ ``classification`` Type: ``ChangeClassification`` Review classification assigned to the change. ``permitted`` Type: ``bool`` Whether the change is permitted by rights evaluation. ``severity`` Type: ``Severity | None`` Highest severity associated with this classified change, if findings are attached. ``permission_findings`` Type: ``tuple[ValidationFinding, ...]`` Permission or rights findings associated with this change. ``validation_findings`` Type: ``tuple[ValidationFinding, ...]`` Validation findings associated with this change. ``classified_at`` Type: ``datetime`` UTC timestamp at which the change was classified. ClassValidationDefinition ------------------------- .. autoclass:: teksi_hooks.models.validation.ClassValidationDefinition :members: Fields ~~~~~~ ``class_id`` Type: ``str`` Canonical identifier of the configured class. ``mandatory_attributes`` Type: ``frozenset[str]`` Class-specific canonical attributes that require a value. These attributes extend the default mandatory attributes. ``attribute_validations`` Type: ``Mapping[str, tuple[AttributeValidation, ...]]`` Class-specific attribute validation rules keyed by canonical attribute identifier. ``object_validations`` Type: ``Mapping[str, tuple[ObjectValidation, ...]]`` Class-specific object validation groups keyed by configuration identifier. ClassifiedChange ---------------- .. autoclass:: teksi_hooks.models.validation.ClassifiedChange :members: Fields ~~~~~~ ``change`` Type: ``Change`` The row-level canonical change. ``metadata`` Type: ``ChangeClassificationMetadata`` Classification metadata for the change. ClassifiedChanges ----------------- .. autoclass:: teksi_hooks.models.validation.ClassifiedChanges :members: Fields ~~~~~~ ``created_objects`` Type: ``list[ClassifiedChange]`` Permitted insert changes. ``altered_objects`` Type: ``list[ClassifiedChange]`` Permitted update changes. ``deleted_objects`` Type: ``list[ClassifiedChange]`` Permitted delete changes. ``unpermitted_changes`` Type: ``list[ClassifiedChange]`` Changes rejected by rights evaluation or validation. ``metadata`` Type: ``dict[str, str]`` Workflow-level metadata for the classified change set. Examples: source model, import schema, provider oid, dataowner oid, job id, output folder. ObjectValidation ---------------- .. autoclass:: teksi_hooks.models.validation.ObjectValidation :members: Fields ~~~~~~ ``id`` Type: ``str`` Identifier of the object-level validation implementation, for example 'is_unique'. ``level`` Type: ``Severity`` Severity emitted when the validation produces a finding. ``operations`` Type: ``tuple[ChangeOperation, ...]`` Change operations for which this object validation is executed. Defaults to inserts and updates. ``parameters`` Type: ``Mapping[str, Any]`` Validation-specific configuration values interpreted by the selected validation implementation. Generic validation orchestration must not assign semantics to these entries. TransitionValidation -------------------- .. autoclass:: teksi_hooks.models.validation.TransitionValidation :members: Fields ~~~~~~ ``ruleset`` Type: ``frozenset[StateTransitionRule]`` Allowed state transition rules for the attribute. ``allow_transitive`` Type: ``bool`` Whether transitive transitions are allowed. If true, a transition may be accepted when a path exists through the transition graph, even if no direct edge exists. ValidationContext ----------------- .. autoclass:: teksi_hooks.models.validation.ValidationContext :members: Fields ~~~~~~ ``class_id`` Type: ``str`` Canonical class identifier being validated. ``identity`` Type: ``CanonicalObjectIdentity | None`` Canonical identity of the object being validated. This may be None for an inserted object whose complete canonical identity has not yet been derived. ``attribute_name`` Type: ``str | None`` Canonical attribute identifier being validated. ``old_value`` Type: ``Any`` Existing attribute value before the change. ``new_value`` Type: ``Any`` New attribute value after the change. ``context_values`` Type: ``Mapping[str, Any]`` Runtime context values available to validations, such as `provider_oid` and `dataowner_oid`. ValidationDefinition -------------------- .. autoclass:: teksi_hooks.models.validation.ValidationDefinition :members: Fields ~~~~~~ ``mandatory_attributes`` Type: ``frozenset[str]`` Canonical attributes considered mandatory by default. ``attribute_validations`` Type: ``Mapping[str, tuple[AttributeValidation, ...]]`` Default attribute validation rules keyed by canonical attribute identifier. ``object_validations`` Type: ``Mapping[str, tuple[ObjectValidation, ...]]`` Default object validation groups keyed by configuration identifier. ``classes`` Type: ``Mapping[str, ClassValidationDefinition]`` Class-specific validation definitions keyed by canonical class identifier. ValidationFinding ----------------- .. autoclass:: teksi_hooks.models.validation.ValidationFinding :members: Base class: ``Finding`` Fields ~~~~~~ ``severity`` Type: ``Severity`` Severity level assigned to the finding. ``message`` Type: ``str`` Human-readable description of the validation issue. ``code`` Type: ``str`` Stable machine-readable validation identifier. ``attribute_name`` Type: ``str | None`` Affected canonical attribute identifier if the finding applies to a specific attribute.