Validation
blackline.models.validation
In an effort to meet the requirements for the Creative Commons Attribution 4.0 International License, please be aware that the following code is based on the following work: - https://github.com/ethyca/fideslang/blob/main/src/fideslang/validation.py
The code has only been mildly modified to fit the needs of the Blackline project.
Contains all of the additional validation for the resource models.
Key
Bases: ConstrainedStr
A Key type that creates a custom constrained string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
regex |
Pattern[str]
|
required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/validation.py
ValidationBase
Bases: BaseModel
Base class for validation models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
required |
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/validation.py
check_valid_country_code(country_code_list)
Validate all listed countries (if present) are valid country codes.
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/validation.py
no_self_reference(value, values)
Check to make sure that the _key doesn't match other _key references within an object.
i.e. DataCategory.parent_key != DataCategory.key
Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/validation.py
sort_list_objects_by_name(values)
Sort objects in a list by their name. This makes resource comparisons deterministic.