Skip to content

Catalogue

blackline.models.catalogue

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/models.py

The code has only been mildly modified to fit the needs of the Blackline project.

Contains all Pydantic models.

BlacklineModel

Bases: BaseModel

The base model for all Resources.

Parameters:

Name Type Description Default
key Key A unique key used to identify this resource. required
tags Optional[list[str]] A list of tags for this resource. None
name Optional[str] None
description Optional[str] None
children Optional[dict[str, Type[BlacklineModel]]] The children resources. None
stem str The stem of the resource. required
children_stem Optional[str] required
children_cls Optional[type[BlacklineModel]] required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class BlacklineModel(BaseModel):
    """The base model for all Resources."""

    key: Key = Field(description="A unique key used to identify this resource.")
    tags: Optional[list[str]] = Field(description="A list of tags for this resource.")
    name: Optional[str] = name_field
    description: Optional[str] = description_field
    children: Optional[dict[str, Type[BlacklineModel]]] = Field(
        None, description="The children resources."
    )
    stem: ClassVar[str] = Field(description="The stem of the resource.")
    children_stem: ClassVar[Optional[str]] = None
    children_cls: ClassVar[Optional[type[BlacklineModel]]] = None

    class Config:
        "Config for the BlacklineModel"
        extra = "forbid"
        orm_mode = True

    def __getitem__(self, key: str) -> Type[BlacklineModel]:
        parts = key.split(".")
        key = ".".join([self.key, parts[0]])
        if self.children is None:
            raise KeyError(f"No children for {self.key}")
        model = self.children[key]

        for part in parts[1:]:
            model = model[part]  # type: ignore[index]
        return model

    @classmethod
    def parse_dir(cls, path: Path, key_prefix: Optional[str] = None):
        """
        Parse a directory of YAML files into a dictionary of Dataset objects.

        Args:
            path: The path to the directory of YAML files.
            path: Path

        Returns:
            A dictionary of Dataset objects.
        """
        key = ".".join([key_prefix, path.name]) if key_prefix is not None else path.name
        children = cls.parse_children(path=path, key_prefix=key)
        filepath = cls.find_definition_file(path=path)
        return cls.parse_yaml(path=filepath, key=key, children=children)

    @classmethod
    def parse_children(
        cls, path: Path, key_prefix: Optional[str] = None
    ) -> dict[str, Type[BlacklineModel]]:
        """
        Parse a directory of YAML files into a dictionary of Dataset objects.

        Args:
            path: The path to the directory of YAML files.
            path: Path

        Returns:
            A dictionary of Dataset objects.
        """
        children: dict[str, Type[BlacklineModel]] = {}
        if cls.children_cls is None:
            return children
        for child_path in path.iterdir():
            if child_path.is_dir():
                child = cls.children_cls.parse_dir(
                    path=child_path, key_prefix=key_prefix
                )
                children[child.key] = child
        return children

    @classmethod
    def find_definition_file(cls, path: Path) -> Path:
        file = list(path.glob(f"{cls.stem}.yml")) + list(path.glob(f"{cls.stem}.yaml"))
        file_len = len(list(file))
        if file_len == 0:
            raise FileNotFoundError(
                f"No {cls.stem} file found in directory: {path.absolute()}"
            )
        if file_len > 1:
            raise ValueError(
                f"Multiple {cls.stem} files found in directory: {path.absolute()}, only include one of resource.yaml or resource.yml"
            )
        return file[0]

    @classmethod
    def parse_yaml(
        cls,
        path: Path,
        key: str,
        children: Optional[dict[str, Type[BlacklineModel]]] = {},
    ):
        """
        Parse a yaml file into a the children_cls object.

        Args:
            path: Path location of the yaml file.
            key: Key to identify the dataset.

        Returns:
            Dataset object.
        """
        with open(path, "r") as f:
            info = yaml.safe_load(f)[cls.stem][0]
            info["key"] = key
            if cls.stem == "dataset":
                return cls.parse_obj(info)
            info[cls.children_stem] = children
            return cls.parse_obj(info)

Config

Config for the BlacklineModel

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class Config:
    "Config for the BlacklineModel"
    extra = "forbid"
    orm_mode = True

parse_children(path, key_prefix=None) classmethod

Parse a directory of YAML files into a dictionary of Dataset objects.

Parameters:

Name Type Description Default
path Path

The path to the directory of YAML files.

required
path Path

Path

required

Returns:

Type Description
dict[str, Type[BlacklineModel]]

A dictionary of Dataset objects.

Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
@classmethod
def parse_children(
    cls, path: Path, key_prefix: Optional[str] = None
) -> dict[str, Type[BlacklineModel]]:
    """
    Parse a directory of YAML files into a dictionary of Dataset objects.

    Args:
        path: The path to the directory of YAML files.
        path: Path

    Returns:
        A dictionary of Dataset objects.
    """
    children: dict[str, Type[BlacklineModel]] = {}
    if cls.children_cls is None:
        return children
    for child_path in path.iterdir():
        if child_path.is_dir():
            child = cls.children_cls.parse_dir(
                path=child_path, key_prefix=key_prefix
            )
            children[child.key] = child
    return children

parse_dir(path, key_prefix=None) classmethod

Parse a directory of YAML files into a dictionary of Dataset objects.

Parameters:

Name Type Description Default
path Path

The path to the directory of YAML files.

required
path Path

Path

required

Returns:

Type Description

A dictionary of Dataset objects.

Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
@classmethod
def parse_dir(cls, path: Path, key_prefix: Optional[str] = None):
    """
    Parse a directory of YAML files into a dictionary of Dataset objects.

    Args:
        path: The path to the directory of YAML files.
        path: Path

    Returns:
        A dictionary of Dataset objects.
    """
    key = ".".join([key_prefix, path.name]) if key_prefix is not None else path.name
    children = cls.parse_children(path=path, key_prefix=key)
    filepath = cls.find_definition_file(path=path)
    return cls.parse_yaml(path=filepath, key=key, children=children)

parse_yaml(path, key, children={}) classmethod

Parse a yaml file into a the children_cls object.

Parameters:

Name Type Description Default
path Path

Path location of the yaml file.

required
key str

Key to identify the dataset.

required

Returns:

Type Description

Dataset object.

Source code in /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
@classmethod
def parse_yaml(
    cls,
    path: Path,
    key: str,
    children: Optional[dict[str, Type[BlacklineModel]]] = {},
):
    """
    Parse a yaml file into a the children_cls object.

    Args:
        path: Path location of the yaml file.
        key: Key to identify the dataset.

    Returns:
        Dataset object.
    """
    with open(path, "r") as f:
        info = yaml.safe_load(f)[cls.stem][0]
        info["key"] = key
        if cls.stem == "dataset":
            return cls.parse_obj(info)
        info[cls.children_stem] = children
        return cls.parse_obj(info)

ContactDetails

Bases: BaseModel

The contact details information model.

Used to capture contact information for controllers, used as part of exporting a data map / ROPA.

This model is nested under an Organization and potentially under a system/dataset.

Parameters:

Name Type Description Default
name Optional[str] An individual name used as part of publishing contact information. None
address Optional[str] An individual address used as part of publishing contact information. None
email Optional[str] An individual email used as part of publishing contact information. None
phone Optional[str] An individual phone number used as part of publishing contact information. None
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class ContactDetails(BaseModel):
    """
    The contact details information model.

    Used to capture contact information for controllers, used
    as part of exporting a data map / ROPA.

    This model is nested under an Organization and
    potentially under a system/dataset.
    """

    name: Optional[str] = Field(
        description="An individual name used as part of publishing contact information.",
    )
    address: Optional[str] = Field(
        description="An individual address used as part of publishing contact information.",
    )
    email: Optional[str] = Field(
        description="An individual email used as part of publishing contact information.",
    )
    phone: Optional[str] = Field(
        description="An individual phone number used as part of publishing contact information.",
    )

DataProtectionImpactAssessment

Bases: BaseModel

The DataProtectionImpactAssessment (DPIA) resource model.

Contains information in regard to the data protection impact assessment exported on a data map or Record of Processing Activities (RoPA).

A legal requirement under GDPR for any project that introduces a high risk to personal information.

Parameters:

Name Type Description Default
is_required bool A boolean value determining if a data protection impact assessment is required. Defaults to False. False
status Optional[ImpactAssessmentStatusEnum] The optional status of a Data Protection Impact Assessment. Returned on an exported data map or RoPA. None
link Optional[AnyUrl] The optional link to the Data Protection Impact Assessment. Returned on an exported data map or RoPA. None
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DataProtectionImpactAssessment(BaseModel):
    """
    The DataProtectionImpactAssessment (DPIA) resource model.

    Contains information in regard to the data protection
    impact assessment exported on a data map or Record of
    Processing Activities (RoPA).

    A legal requirement under GDPR for any project that
    introduces a high risk to personal information.
    """

    is_required: bool = Field(
        default=False,
        description="A boolean value determining if a data protection impact assessment is required. Defaults to False.",
    )
    status: Optional[ImpactAssessmentStatusEnum] = Field(
        default=None,
        description="The optional status of a Data Protection Impact Assessment. Returned on an exported data map or RoPA.",
    )
    link: Optional[AnyUrl] = Field(
        default=None,
        description="The optional link to the Data Protection Impact Assessment. Returned on an exported data map or RoPA.",
    )

DataResponsibilityTitle

Bases: str, Enum

The model defining the responsibility or role over the system that processes personal data.

Used to identify whether the organization is a Controller, Processor, or Sub-Processor of the data

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DataResponsibilityTitle(str, Enum):
    """
    The model defining the responsibility or role over
    the system that processes personal data.

    Used to identify whether the organization is a
    Controller, Processor, or Sub-Processor of the data
    """

    CONTROLLER = "Controller"
    PROCESSOR = "Processor"
    SUB_PROCESSOR = "Sub-Processor"

DataSubjectRightsEnum

Bases: str, Enum

The model for data subject rights over personal data.

Based upon chapter 3 of the GDPR

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DataSubjectRightsEnum(str, Enum):
    """
    The model for data subject rights over
    personal data.

    Based upon chapter 3 of the GDPR
    """

    INFORMED = "Informed"
    ACCESS = "Access"
    RECTIFICATION = "Rectification"
    ERASURE = "Erasure"
    PORTABILITY = "Portability"
    RESTRICT_PROCESSING = "Restrict Processing"
    WITHDRAW_CONSENT = "Withdraw Consent"
    OBJECT = "Object"
    OBJECT_TO_AUTOMATED_PROCESSING = "Object to Automated Processing"

Dataset

Bases: BlacklineModel

The Dataset resource model.

Todo: This breaks the Liskov substitution principle because it restrics the BlacklineModel, not expand it. This model has no children.

Parameters:

Name Type Description Default
meta Optional[dict[str, str]] None
data_categories Optional[list[Key]] Array of Data Category resources identified by `key`, that apply to all collections in the Dataset. None
data_qualifier Key required
joint_controller Optional[ContactDetails] None
third_country_transfers Optional[list[str]] An optional array to identify any third countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). None
_check_valid_country_code classmethod required
_alias required
children Optional[dict[str, DatasetCollection]] None
stem required
children_stem required
children_cls required
collections Optional[dict[str, DatasetCollection]] required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class Dataset(BlacklineModel):
    """The Dataset resource model.

    Todo: This breaks the Liskov substitution principle because it restrics the BlacklineModel,
    not expand it. This model has no children.
    """

    meta: Optional[dict[str, str]] = Field(
        description=Key(
            "An optional object that provides additional information about the Dataset. You can structure the object however you like. It can be a simple set of `key: value` properties or a deeply nested hierarchy of objects."
        ),
    )
    data_categories: Optional[list[Key]] = Field(
        description="Array of Data Category resources identified by `key`, that apply to all collections in the Dataset.",
    )
    data_qualifier: Key = Field(
        default=Key(
            "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
        ),
        description="Array of Data Qualifier resources identified by `key`, that apply to all collections in the Dataset.",
    )
    joint_controller: Optional[ContactDetails] = Field(
        description=ContactDetails.__doc__,
    )
    third_country_transfers: Optional[list[str]] = Field(
        description="An optional array to identify any third countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3).",
    )
    _check_valid_country_code: classmethod = country_code_validator
    _alias = "collections"
    children: Optional[dict[str, DatasetCollection]] = Field(description=f"Collection dict. Alaised to {_alias}", alias=_alias)  # type: ignore[assignment]
    stem = "dataset"
    children_stem = "collections"
    children_cls = DatasetCollection

    @root_validator(pre=True)
    def add_key_to_collection(cls, values):
        for key, collection in (
            values["collections"].items() if values.get("collections") else []
        ):
            collection["key"] = values["key"] + "." + key
        return values

    @property
    def collections(self) -> Optional[dict[str, DatasetCollection]]:
        return self.children

DatasetCollection

Bases: BlacklineModel

The DatasetCollection resource model.

This resource is nested witin a Dataset.

Parameters:

Name Type Description Default
name str The name of the collection. required
datetime_field Optional[DatetimeField] The datetime field to use for the retention limit calculations. None
where Optional[str] An addional where clause to append to the exeisting: 'WHERE {{ datetime_column }} < %(cutoff)s'. None
fields Optional[list[DatasetField]] An array of objects that describe the collection's fields. None
data_categories Optional[list[Key]] Array of Data Category resources identified by `key`, that apply to all fields in the collection. None
data_qualifier Key required
_sort_fields classmethod required
dependencies Optional[list[str]] The collection dependencies. None
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DatasetCollection(BlacklineModel):
    """
    The DatasetCollection resource model.

    This resource is nested witin a Dataset.
    """

    name: str = Field(..., description="The name of the collection.")

    datetime_field: Optional[DatetimeField] = Field(
        description="The datetime field to use for the retention limit calculations."
    )
    where: Optional[str] = Field(
        None,
        description="An addional where clause to append to the exeisting: 'WHERE {{ datetime_column }} < %(cutoff)s'.",  # noqa: E501
    )
    fields: Optional[list[DatasetField]] = Field(
        description="An array of objects that describe the collection's fields.",
    )

    data_categories: Optional[list[Key]] = Field(
        description="Array of Data Category resources identified by `key`, that apply to all fields in the collection.",
    )
    data_qualifier: Key = Field(
        default=Key(
            "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
        ),
        description="Array of Data Qualifier resources identified by `key`, that apply to all fields in the collection.",
    )

    _sort_fields: classmethod = validator("fields", allow_reuse=True)(
        sort_list_objects_by_name
    )
    dependencies: Optional[list[str]] = Field(
        None, description="The collection dependencies."
    )

DatasetField

Bases: DatasetFieldBase

The DatasetField resource model.

This resource is nested within a DatasetCollection.

Parameters:

Name Type Description Default
fields Optional[list[DatasetField]] An optional array of objects that describe hierarchical/nested fields (typically found in NoSQL databases). None
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DatasetField(DatasetFieldBase):
    """
    The DatasetField resource model.

    This resource is nested within a DatasetCollection.
    """

    fields: Optional[list[DatasetField]] = Field(
        description="An optional array of objects that describe hierarchical/nested fields (typically found in NoSQL databases).",
    )

DatasetFieldBase

Bases: BaseModel

Base DatasetField Resource model.

This model is available for cases where the DatasetField information needs to be customized. In general this will not be the case and you will instead want to use the DatasetField model.

When this model is used you will need to implement your own recursive field in to adding any new needed fields.

Example:

from typing import list, Optional
from . import DatasetFieldBase

class MyDatasetField(DatasetFieldBase):
    custom: str
    fields: Optional[list[MyDatasetField]] = []

Parameters:

Name Type Description Default
name str required
description Optional[str] None
data_categories Optional[list[Key]] Arrays of Data Categories, identified by `key`, that applies to this field. None
data_qualifier Key required
deidentifier Optional[Union[Redact, Mask, Replace]] The deidentifier to apply to this field. None
period timedelta The period of time to retain data. required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class DatasetFieldBase(BaseModel):
    """Base DatasetField Resource model.

    This model is available for cases where the DatasetField information needs to be
    customized. In general this will not be the case and you will instead want to use
    the DatasetField model.

    When this model is used you will need to implement your own recursive field in
    to adding any new needed fields.

    Example:

    ```py
    from typing import list, Optional
    from . import DatasetFieldBase

    class MyDatasetField(DatasetFieldBase):
        custom: str
        fields: Optional[list[MyDatasetField]] = []
    ```
    """

    name: str = name_field
    description: Optional[str] = description_field
    data_categories: Optional[list[Key]] = Field(
        description="Arrays of Data Categories, identified by `key`, that applies to this field.",
    )
    data_qualifier: Key = Field(
        default=Key(
            "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
        ),
        description="A Data Qualifier that applies to this field. Note that this field holds a single value, therefore, the property name is singular.",
    )
    deidentifier: Optional[Union[Redact, Mask, Replace]] = Field(
        ...,
        discriminator="type",
        description="The deidentifier to apply to this field.",
    )
    period: timedelta = Field(description="The period of time to retain data.")

ImpactAssessmentStatusEnum

Bases: str, Enum

The model for impact assessment statuses.

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class ImpactAssessmentStatusEnum(str, Enum):
    """The model for impact assessment statuses."""

    NOT_STARTED = "Not Started"
    IN_PROGRESS = "In Progress"
    WAITING_FOR_APPROVAL = "Waiting for Approval"
    COMPLETE = "Complete"

IncludeExcludeEnum

Bases: str, Enum

Determine whether or not defined rights are being included or excluded.

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class IncludeExcludeEnum(str, Enum):
    """
    Determine whether or not defined rights are
    being included or excluded.
    """

    ALL = "ALL"
    EXCLUDE = "EXCLUDE"
    INCLUDE = "INCLUDE"
    NONE = "NONE"

LegalBasisEnum

Bases: str, Enum

The model for allowable legal basis categories

Based upon article 6 of the GDPR

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class LegalBasisEnum(str, Enum):
    """
    The model for allowable legal basis categories

    Based upon article 6 of the GDPR
    """

    CONSENT = "Consent"
    CONTRACT = "Contract"
    LEGAL_OBLIGATION = "Legal Obligation"
    VITAL_INTEREST = "Vital Interest"
    PUBLIC_INTEREST = "Public Interest"
    LEGITIMATE_INTEREST = "Legitimate Interests"

Organization

Bases: BlacklineModel

The Organization resource model.

This resource is used as a way to organize all other resources.

Parameters:

Name Type Description Default
controller Optional[ContactDetails] None
data_protection_officer Optional[ContactDetails] None
representative Optional[ContactDetails] None
security_policy Optional[HttpUrl] Am optional URL to the organization security policy. None
children Optional[dict[str, System]] System dict None
stem required
children_stem required
children_cls required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class Organization(BlacklineModel):
    """
    The Organization resource model.

    This resource is used as a way to organize all other resources.
    """

    controller: Optional[ContactDetails] = Field(
        description=ContactDetails.__doc__,
    )
    data_protection_officer: Optional[ContactDetails] = Field(
        description=ContactDetails.__doc__,
    )
    representative: Optional[ContactDetails] = Field(
        description=ContactDetails.__doc__,
    )
    security_policy: Optional[HttpUrl] = Field(
        description="Am optional URL to the organization security policy."
    )
    children: Optional[dict[str, System]] = Field(description="System dict", alias="systems")  # type: ignore[assignment]

    stem = "organization"
    children_stem = "systems"
    children_cls = System

PrivacyDeclaration

Bases: BaseModel

The PrivacyDeclaration resource model.

States a function of a system, and describes how it relates to the privacy data types.

Parameters:

Name Type Description Default
name str The name of the privacy declaration on the system. required
data_categories list[Key] An array of data categories describing a system in a privacy declaration. required
data_use Key The Data Use describing a system in a privacy declaration. required
data_qualifier Optional[Key] None
data_subjects list[Key] An array of data subjects describing a system in a privacy declaration. required
dataset_references Optional[list[Key]] Referenced Dataset keys used by the system. None
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class PrivacyDeclaration(BaseModel):
    """
    The PrivacyDeclaration resource model.

    States a function of a system, and describes how it relates
    to the privacy data types.
    """

    name: str = Field(
        description="The name of the privacy declaration on the system.",
    )
    data_categories: list[Key] = Field(
        description="An array of data categories describing a system in a privacy declaration.",
    )
    data_use: Key = Field(
        description="The Data Use describing a system in a privacy declaration.",
    )
    data_qualifier: Optional[Key] = Field(
        default=Key(
            "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified"
        ),
        description="The key of the data qualifier describing a system in a privacy declaration.",
    )
    data_subjects: list[Key] = Field(
        description="An array of data subjects describing a system in a privacy declaration.",
    )
    dataset_references: Optional[list[Key]] = Field(
        description="Referenced Dataset keys used by the system.",
    )

Resource

Bases: BlacklineModel

The System resource model.

Describes an application and includes a list of PrivacyDeclaration resources.

Parameters:

Name Type Description Default
resource_type Optional[ResourceTypeEnum] A required value to describe the type of system being modeled None
data_responsibility_title Optional[DataResponsibilityTitle] None
privacy_declarations Optional[list[PrivacyDeclaration]] None
dependencies Optional[list[Key]] A list of keys to model dependencies. None
joint_controller Optional[ContactDetails] None
third_country_transfers Optional[list[str]] An optional array to identify any countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in ISO 3166-1. None
administrating_department Optional[str] The department or group that owns the resource None
data_protection_impact_assessment Optional[DataProtectionImpactAssessment] None
children Optional[dict[str, Dataset]] Dataset dict None
stem required
children_stem required
children_cls required
_sort_privacy_declarations classmethod required
_no_self_reference classmethod required
_check_valid_country_code classmethod required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class Resource(BlacklineModel):
    """
    The System resource model.

    Describes an application and includes a list of PrivacyDeclaration resources.
    """

    resource_type: Optional[ResourceTypeEnum] = Field(
        description="A required value to describe the type of system being modeled",
    )
    data_responsibility_title: Optional[DataResponsibilityTitle] = Field(
        default=DataResponsibilityTitle.CONTROLLER,
        description=DataResponsibilityTitle.__doc__,
    )
    privacy_declarations: Optional[list[PrivacyDeclaration]] = Field(
        description=PrivacyDeclaration.__doc__,
    )
    dependencies: Optional[list[Key]] = Field(
        description="A list of keys to model dependencies."
    )
    joint_controller: Optional[ContactDetails] = Field(
        description=ContactDetails.__doc__,
    )
    third_country_transfers: Optional[list[str]] = Field(
        description="An optional array to identify any countries where data is transited to. For consistency purposes, these fields are required to follow the Alpha-3 code set in ISO 3166-1.",
    )
    administrating_department: Optional[str] = Field(
        description="The department or group that owns the resource",
    )
    data_protection_impact_assessment: Optional[DataProtectionImpactAssessment] = Field(
        default=DataProtectionImpactAssessment(),
        description=DataProtectionImpactAssessment.__doc__,
    )

    children: Optional[dict[str, Dataset]] = Field(description="Dataset dict", alias="datasets")  # type: ignore[assignment]

    stem = "resource"
    children_stem = "datasets"
    children_cls = Dataset

    _sort_privacy_declarations: classmethod = validator(
        "privacy_declarations", allow_reuse=True
    )(sort_list_objects_by_name)

    _no_self_reference: classmethod = validator(
        "dependencies", allow_reuse=True, each_item=True
    )(no_self_reference)

    _check_valid_country_code: classmethod = country_code_validator

    class Config:
        "Class for the System config"
        use_enum_values = True

Config

Class for the System config

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class Config:
    "Class for the System config"
    use_enum_values = True

ResourceTypeEnum

Bases: str, Enum

The model for resource types.

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class ResourceTypeEnum(str, Enum):
    """The model for resource types."""

    APPLICATION = "Application"
    SERVICE = "Service"
    DATABASE = "Database"
    DATALAKE = "Datalake"
    DATA_WAREHOUSE = "Data Warehouse"

SpecialCategoriesEnum

Bases: str, Enum

The model for processing special categories of personal data.

Based upon article 9 of the GDPR

Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class SpecialCategoriesEnum(str, Enum):
    """
    The model for processing special categories
    of personal data.

    Based upon article 9 of the GDPR
    """

    CONSENT = "Consent"
    EMPLOYMENT = "Employment"
    VITAL_INTEREST = "Vital Interests"
    NON_PROFIT_BODIES = "Non-profit Bodies"
    PUBLIC_BY_DATA_SUBJECT = "Public by Data Subject"
    LEGAL_CLAIMS = "Legal Claims"
    PUBLIC_INTEREST = "Substantial Public Interest"
    MEDICAL = "Medical"
    PUBLIC_HEALTH_INTEREST = "Public Health Interest"

System

Bases: BlacklineModel

The System resource model.

Systems can be assigned to this resource, but it doesn't inherently point to any other resources.

Parameters:

Name Type Description Default
children Optional[dict[str, Resource]] None
stem required
children_stem required
children_cls required
Source code in BAR /opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/blackline/models/catalogue.py
class System(BlacklineModel):
    """
    The System resource model.

    Systems can be assigned to this resource, but it doesn't inherently
    point to any other resources.
    """

    children: Optional[dict[str, Resource]] = Field(alias="resources")  # type: ignore[assignment]

    stem = "system"
    children_stem = "resources"
    children_cls = Resource