Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,224 changes: 94 additions & 1,130 deletions pyatlan_v9/model/assets/__init__.py

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions pyatlan_v9/model/assets/_init_business_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"""

from .business_policy import BusinessPolicy
from .business_policy_exception import BusinessPolicyException
from .business_policy_incident import BusinessPolicyIncident
from .business_policy_log import BusinessPolicyLog
from .business_policy_related import (
RelatedBusinessPolicy,
RelatedBusinessPolicyException,
Expand All @@ -21,9 +18,6 @@

__all__ = [
"BusinessPolicy",
"BusinessPolicyException",
"BusinessPolicyIncident",
"BusinessPolicyLog",
"RelatedBusinessPolicy",
"RelatedBusinessPolicyException",
"RelatedBusinessPolicyIncident",
Expand Down
8 changes: 8 additions & 0 deletions pyatlan_v9/model/assets/_init_sigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
from .sigma import Sigma
from .sigma_data_element import SigmaDataElement
from .sigma_data_element_field import SigmaDataElementField
from .sigma_data_model import SigmaDataModel
from .sigma_data_model_column import SigmaDataModelColumn
from .sigma_dataset import SigmaDataset
from .sigma_dataset_column import SigmaDatasetColumn
from .sigma_page import SigmaPage
from .sigma_related import (
RelatedSigma,
RelatedSigmaDataElement,
RelatedSigmaDataElementField,
RelatedSigmaDataModel,
RelatedSigmaDataModelColumn,
RelatedSigmaDataset,
RelatedSigmaDatasetColumn,
RelatedSigmaPage,
Expand All @@ -29,13 +33,17 @@
"RelatedSigma",
"RelatedSigmaDataElement",
"RelatedSigmaDataElementField",
"RelatedSigmaDataModel",
"RelatedSigmaDataModelColumn",
"RelatedSigmaDataset",
"RelatedSigmaDatasetColumn",
"RelatedSigmaPage",
"RelatedSigmaWorkbook",
"Sigma",
"SigmaDataElement",
"SigmaDataElementField",
"SigmaDataModel",
"SigmaDataModelColumn",
"SigmaDataset",
"SigmaDatasetColumn",
"SigmaPage",
Expand Down
71 changes: 4 additions & 67 deletions pyatlan_v9/model/assets/access_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pyatlan_v9.model.serde import Serde, get_serde
from pyatlan_v9.model.transform import register_asset

from .access_control_related import RelatedAccessControl, RelatedAuthPolicy
from .access_control_related import RelatedAuthPolicy
from .anomalo_related import RelatedAnomaloCheck
from .app_related import RelatedApplication, RelatedApplicationField
from .asset import (
Expand Down Expand Up @@ -95,6 +95,8 @@ class AccessControl(Asset):
SCHEMA_REGISTRY_SUBJECTS: ClassVar[Any] = None
SODA_CHECKS: ClassVar[Any] = None

type_name: Union[str, UnsetType] = "AccessControl"

channel_link: Union[str, None, UnsetType] = UNSET
"""TBC"""

Expand Down Expand Up @@ -208,66 +210,6 @@ class AccessControl(Asset):
def __post_init__(self) -> None:
self.type_name = "AccessControl"

# =========================================================================
# SDK Methods
# =========================================================================

def validate(self, for_creation: bool = False) -> None:
"""
Dry-run validation of this AccessControl instance.

Checks that required fields (type_name, name, qualified_name) are set.
When ``for_creation=True``, also checks hierarchy-specific fields
(parent references, denormalized attributes) needed to create this asset.

This is purely opt-in and is NOT called by any serde path — only by
explicit user invocation (e.g., validating JSONL before sending to Atlan).

Args:
for_creation: If True, also validate fields required for asset creation.

Raises:
ValueError: If any required fields are missing or invalid.
"""
errors: list[str] = []
if self.type_name is UNSET:
errors.append("type_name is required")
if self.name is UNSET:
errors.append("name is required")
if self.qualified_name is UNSET or self.qualified_name is None:
errors.append("qualified_name is required")
if errors:
raise ValueError(f"AccessControl validation failed: {errors}")

def minimize(self) -> "AccessControl":
"""
Return a minimal copy of this AccessControl with only updater-required fields.

Calls :meth:`validate` first to ensure the instance is valid, then
returns a new AccessControl with only the fields needed for an update
(qualified_name, name, and any type-specific additional fields).

Returns:
A new AccessControl instance with only the minimum required fields.
"""
self.validate()
return AccessControl(qualified_name=self.qualified_name, name=self.name)

def relate(self) -> "RelatedAccessControl":
"""
Create a :class:`RelatedAccessControl` reference from this instance.

Returns a lightweight reference suitable for use in relationship
attributes. Prefers ``guid`` if set, otherwise falls back to
``qualified_name``.

Returns:
A RelatedAccessControl reference to this asset.
"""
if self.guid is not UNSET:
return RelatedAccessControl(guid=self.guid)
return RelatedAccessControl(qualified_name=self.qualified_name)

# =========================================================================
# Optimized Serialization Methods (override Asset base class)
# =========================================================================
Expand Down Expand Up @@ -553,9 +495,6 @@ def _access_control_to_nested(access_control: AccessControl) -> AccessControlNes
is_incomplete=access_control.is_incomplete,
provenance_type=access_control.provenance_type,
home_id=access_control.home_id,
depth=access_control.depth,
immediate_upstream=access_control.immediate_upstream,
immediate_downstream=access_control.immediate_downstream,
attributes=attrs,
relationship_attributes=replace_rels,
append_relationship_attributes=append_rels,
Expand Down Expand Up @@ -589,6 +528,7 @@ def _access_control_from_nested(nested: AccessControlNested) -> AccessControl:
updated_by=nested.updated_by,
classifications=nested.classifications,
classification_names=nested.classification_names,
meanings=nested.meanings,
labels=nested.labels,
business_attributes=nested.business_attributes,
custom_attributes=nested.custom_attributes,
Expand All @@ -597,9 +537,6 @@ def _access_control_from_nested(nested: AccessControlNested) -> AccessControl:
is_incomplete=nested.is_incomplete,
provenance_type=nested.provenance_type,
home_id=nested.home_id,
depth=nested.depth,
immediate_upstream=nested.immediate_upstream,
immediate_downstream=nested.immediate_downstream,
**_extract_access_control_attrs(attrs),
# Merged relationship attributes
**merged_rels,
Expand Down
70 changes: 3 additions & 67 deletions pyatlan_v9/model/assets/adf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from pyatlan_v9.model.serde import Serde, get_serde
from pyatlan_v9.model.transform import register_asset

from .adf_related import RelatedADF
from .airflow_related import RelatedAirflowTask
from .anomalo_related import RelatedAnomaloCheck
from .app_related import RelatedApplication, RelatedApplicationField
Expand Down Expand Up @@ -101,6 +100,8 @@ class ADF(Asset):
INPUT_TO_SPARK_JOBS: ClassVar[Any] = None
OUTPUT_FROM_SPARK_JOBS: ClassVar[Any] = None

type_name: Union[str, UnsetType] = "ADF"

adf_factory_name: Union[str, None, UnsetType] = UNSET
"""Defines the name of the factory in which this asset exists."""

Expand Down Expand Up @@ -219,66 +220,6 @@ class ADF(Asset):
def __post_init__(self) -> None:
self.type_name = "ADF"

# =========================================================================
# SDK Methods
# =========================================================================

def validate(self, for_creation: bool = False) -> None:
"""
Dry-run validation of this ADF instance.

Checks that required fields (type_name, name, qualified_name) are set.
When ``for_creation=True``, also checks hierarchy-specific fields
(parent references, denormalized attributes) needed to create this asset.

This is purely opt-in and is NOT called by any serde path — only by
explicit user invocation (e.g., validating JSONL before sending to Atlan).

Args:
for_creation: If True, also validate fields required for asset creation.

Raises:
ValueError: If any required fields are missing or invalid.
"""
errors: list[str] = []
if self.type_name is UNSET:
errors.append("type_name is required")
if self.name is UNSET:
errors.append("name is required")
if self.qualified_name is UNSET or self.qualified_name is None:
errors.append("qualified_name is required")
if errors:
raise ValueError(f"ADF validation failed: {errors}")

def minimize(self) -> "ADF":
"""
Return a minimal copy of this ADF with only updater-required fields.

Calls :meth:`validate` first to ensure the instance is valid, then
returns a new ADF with only the fields needed for an update
(qualified_name, name, and any type-specific additional fields).

Returns:
A new ADF instance with only the minimum required fields.
"""
self.validate()
return ADF(qualified_name=self.qualified_name, name=self.name)

def relate(self) -> "RelatedADF":
"""
Create a :class:`RelatedADF` reference from this instance.

Returns a lightweight reference suitable for use in relationship
attributes. Prefers ``guid`` if set, otherwise falls back to
``qualified_name``.

Returns:
A RelatedADF reference to this asset.
"""
if self.guid is not UNSET:
return RelatedADF(guid=self.guid)
return RelatedADF(qualified_name=self.qualified_name)

# =========================================================================
# Optimized Serialization Methods (override Asset base class)
# =========================================================================
Expand Down Expand Up @@ -554,9 +495,6 @@ def _adf_to_nested(adf: ADF) -> ADFNested:
is_incomplete=adf.is_incomplete,
provenance_type=adf.provenance_type,
home_id=adf.home_id,
depth=adf.depth,
immediate_upstream=adf.immediate_upstream,
immediate_downstream=adf.immediate_downstream,
attributes=attrs,
relationship_attributes=replace_rels,
append_relationship_attributes=append_rels,
Expand Down Expand Up @@ -586,6 +524,7 @@ def _adf_from_nested(nested: ADFNested) -> ADF:
updated_by=nested.updated_by,
classifications=nested.classifications,
classification_names=nested.classification_names,
meanings=nested.meanings,
labels=nested.labels,
business_attributes=nested.business_attributes,
custom_attributes=nested.custom_attributes,
Expand All @@ -594,9 +533,6 @@ def _adf_from_nested(nested: ADFNested) -> ADF:
is_incomplete=nested.is_incomplete,
provenance_type=nested.provenance_type,
home_id=nested.home_id,
depth=nested.depth,
immediate_upstream=nested.immediate_upstream,
immediate_downstream=nested.immediate_downstream,
**_extract_adf_attrs(attrs),
# Merged relationship attributes
**merged_rels,
Expand Down
Loading
Loading