diff --git a/HISTORY.md b/HISTORY.md index aaa43ff39..91fbe64ab 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,9 @@ +## 0.0.26 (May 4, 2023) + +* Add remove_terms method to AtlanClient +* Add append_terms method to AtlanClient +* Add replace_terms method to AtlanClient + ## 0.0.25 (May 2, 2023) * Update create method for Readme asset diff --git a/pyatlan/client/atlan.py b/pyatlan/client/atlan.py index 46bcca25e..f7cc51e64 100644 --- a/pyatlan/client/atlan.py +++ b/pyatlan/client/atlan.py @@ -313,8 +313,7 @@ def get_asset_by_qualified_name( raw_json["entity"]["attributes"].update( raw_json["entity"]["relationshipAttributes"] ) - asset = AssetResponse[A](**raw_json).entity - asset.is_incomplete = False + asset = self.handle_relationships(raw_json) if not isinstance(asset, asset_type): raise NotFoundError( message=f"Asset with qualifiedName {qualified_name} " @@ -345,16 +344,7 @@ def get_asset_by_guid( GET_ENTITY_BY_GUID.format_path_with_params(guid), query_params, ) - if ( - "relationshipAttributes" in raw_json["entity"] - and raw_json["entity"]["relationshipAttributes"] - ): - raw_json["entity"]["attributes"].update( - raw_json["entity"]["relationshipAttributes"] - ) - raw_json["entity"]["relationshipAttributes"] = {} - asset = AssetResponse[A](**raw_json).entity - asset.is_incomplete = False + asset = self.handle_relationships(raw_json) if not isinstance(asset, asset_type): raise NotFoundError( message=f"Asset with GUID {guid} is not of the type requested: {asset_type.__name__}.", @@ -366,6 +356,19 @@ def get_asset_by_guid( raise NotFoundError(message=ae.user_message, code=ae.code) from ae raise ae + def handle_relationships(self, raw_json): + if ( + "relationshipAttributes" in raw_json["entity"] + and raw_json["entity"]["relationshipAttributes"] + ): + raw_json["entity"]["attributes"].update( + raw_json["entity"]["relationshipAttributes"] + ) + raw_json["entity"]["relationshipAttributes"] = {} + asset = AssetResponse[A](**raw_json).entity + asset.is_incomplete = False + return asset + @validate_arguments() def retrieve_minimal(self, guid: str, asset_type: Type[A]) -> A: return self.get_asset_by_guid( @@ -602,3 +605,100 @@ def replace_custom_metadata(self, guid: str, custom_metadata: CustomMetadata): None, custom_metadata_request, ) + + @validate_arguments() + def append_terms( + self, + asset_type: Type[A], + terms: list[AtlasGlossaryTerm], + guid: Optional[str] = None, + qualified_name: Optional[str] = None, + ) -> A: + if guid: + if qualified_name: + raise ValueError( + "Either guid or qualified_name can be be specified not both" + ) + asset = self.get_asset_by_guid(guid=guid, asset_type=asset_type) + elif qualified_name: + asset = self.get_asset_by_qualified_name( + qualified_name=qualified_name, asset_type=asset_type + ) + else: + raise ValueError("Either guid or qualified name must be specified") + if not terms: + return asset + replacement_terms: list[AtlasGlossaryTerm] = [] + if existing_terms := asset.terms: + replacement_terms.extend( + term for term in existing_terms if term.relationship_status != "DELETED" + ) + replacement_terms.extend(terms) + asset.terms = replacement_terms + response = self.upsert(entity=asset) + if assets := response.assets_updated(asset_type=asset_type): + return assets[0] + return asset + + @validate_arguments() + def replace_terms( + self, + asset_type: Type[A], + terms: list[AtlasGlossaryTerm], + guid: Optional[str] = None, + qualified_name: Optional[str] = None, + ) -> A: + if guid: + if qualified_name: + raise ValueError( + "Either guid or qualified_name can be be specified not both" + ) + asset = self.get_asset_by_guid(guid=guid, asset_type=asset_type) + elif qualified_name: + asset = self.get_asset_by_qualified_name( + qualified_name=qualified_name, asset_type=asset_type + ) + else: + raise ValueError("Either guid or qualified name must be specified") + asset.terms = terms + response = self.upsert(entity=asset) + if assets := response.assets_updated(asset_type=asset_type): + return assets[0] + return asset + + @validate_arguments() + def remove_terms( + self, + asset_type: Type[A], + terms: list[AtlasGlossaryTerm], + guid: Optional[str] = None, + qualified_name: Optional[str] = None, + ) -> A: + if not terms: + raise ValueError("A list of terms to remove must be specified") + if guid: + if qualified_name: + raise ValueError( + "Either guid or qualified_name can be be specified not both" + ) + asset = self.get_asset_by_guid(guid=guid, asset_type=asset_type) + elif qualified_name: + asset = self.get_asset_by_qualified_name( + qualified_name=qualified_name, asset_type=asset_type + ) + else: + raise ValueError("Either guid or qualified name must be specified") + replacement_terms: list[AtlasGlossaryTerm] = [] + guids_to_be_removed = {t.guid for t in terms} + if existing_terms := asset.terms: + replacement_terms.extend( + term + for term in existing_terms + if term.relationship_status != "DELETED" + and term.guid not in guids_to_be_removed + ) + asset.terms = replacement_terms + response = self.upsert(entity=asset) + if assets := response.assets_updated(asset_type=asset_type): + return assets[0] + return asset diff --git a/pyatlan/generator/templates/entity.jinja2 b/pyatlan/generator/templates/entity.jinja2 index 12ccdf875..97b4eaeaa 100644 --- a/pyatlan/generator/templates/entity.jinja2 +++ b/pyatlan/generator/templates/entity.jinja2 @@ -71,11 +71,15 @@ def validate_required_fields(field_names:list[str], values:list[Any]): raise ValueError(f"{field_name} is required") if isinstance(value, str) and not value.strip(): raise ValueError(f"{field_name} cannot be blank") -{%- macro gen_properties(attribute_defs) %} +{%- macro gen_properties(attribute_defs, additional_names=[]) %} _convience_properties: ClassVar[list[str]] = [ {%- for attribute_def in attribute_defs %} "{{ attribute_def.name | to_snake_case }}", - {%- endfor %}] + {%- endfor %} + {%- for name in additional_names %} + "{{ name }}", + {%- endfor %}] + {%- for attribute_def in attribute_defs %} {%- set type = attribute_def.typeName | get_type %} {%- set property_type %}{% if attribute_def.isOptional %}Optional[{% endif %}{{type}}{% if attribute_def.isOptional %}]{% endif %}{% endset %} @@ -107,7 +111,19 @@ class {{ entity_def.name }}({{super_classes[0]}} {%- if "Asset" in super_classes return object.__setattr__(self, name, value) super().__setattr__( name, value) - {{ gen_properties(entity_def.attribute_defs) }} + {{ gen_properties(entity_def.attribute_defs, ["terms"]) }} + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms {%- if entity_def.name == "Referenceable" %} diff --git a/pyatlan/model/assets.py b/pyatlan/model/assets.py index cac2a2839..fe896ade1 100644 --- a/pyatlan/model/assets.py +++ b/pyatlan/model/assets.py @@ -100,6 +100,7 @@ def __setattr__(self, name, value): "qualified_name", "replicated_from", "replicated_to", + "terms", ] @property @@ -132,6 +133,18 @@ def replicated_to(self, replicated_to: Optional[list[AtlasServer]]): self.attributes = self.Attributes() self.attributes.replicated_to = replicated_to + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + class Attributes(AtlanObject): qualified_name: str = Field("", description="", alias="qualifiedName") replicated_from: Optional[list[AtlasServer]] = Field( @@ -400,6 +413,7 @@ def __setattr__(self, name, value): "asset_dbt_source_freshness_criteria", "sample_data_url", "asset_tags", + "terms", ] @property @@ -1505,6 +1519,18 @@ def asset_tags(self, asset_tags: Optional[set[str]]): self.attributes = self.Attributes() self.attributes.asset_tags = asset_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + _subtypes_: dict[str, type] = dict() def __init_subclass__(cls, type_name=None): @@ -1930,6 +1956,7 @@ def __setattr__(self, name, value): "language", "usage", "additional_attributes", + "terms", ] @property @@ -1982,6 +2009,18 @@ def additional_attributes(self, additional_attributes: Optional[dict[str, str]]) self.attributes = self.Attributes() self.attributes.additional_attributes = additional_attributes + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("AtlasGlossary", allow_mutation=False) @validator("type_name") @@ -2058,7 +2097,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("DataSet", allow_mutation=False) @@ -2097,7 +2150,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("ProcessExecution", allow_mutation=False) @@ -2143,6 +2210,7 @@ def __setattr__(self, name, value): "abbreviation", "usage", "additional_attributes", + "terms", ] @property @@ -2205,6 +2273,18 @@ def additional_attributes(self, additional_attributes: Optional[dict[str, str]]) self.attributes = self.Attributes() self.attributes.additional_attributes = additional_attributes + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("AtlasGlossaryTerm", allow_mutation=False) @validator("type_name") @@ -2382,7 +2462,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Cloud", allow_mutation=False) @@ -2421,7 +2515,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Infrastructure", allow_mutation=False) @@ -2482,6 +2590,7 @@ def __setattr__(self, name, value): "popularity_insights_timeframe", "has_popularity_insights", "connection_dbt_environments", + "terms", ] @property @@ -2702,6 +2811,18 @@ def connection_dbt_environments( self.attributes = self.Attributes() self.attributes.connection_dbt_environments = connection_dbt_environments + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Connection", allow_mutation=False) @validator("type_name") @@ -2865,6 +2986,7 @@ def __setattr__(self, name, value): "code", "sql", "ast", + "terms", ] @property @@ -2917,6 +3039,18 @@ def ast(self, ast: Optional[str]): self.attributes = self.Attributes() self.attributes.ast = ast + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Process", allow_mutation=False) @validator("type_name") @@ -2966,6 +3100,7 @@ def __setattr__(self, name, value): "short_description", "long_description", "additional_attributes", + "terms", ] @property @@ -2998,6 +3133,18 @@ def additional_attributes(self, additional_attributes: Optional[dict[str, str]]) self.attributes = self.Attributes() self.attributes.additional_attributes = additional_attributes + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("AtlasGlossaryCategory", allow_mutation=False) @validator("type_name") @@ -3102,6 +3249,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "badge_conditions", "badge_metadata_attribute", + "terms", ] @property @@ -3124,6 +3272,18 @@ def badge_metadata_attribute(self, badge_metadata_attribute: Optional[str]): self.attributes = self.Attributes() self.attributes.badge_metadata_attribute = badge_metadata_attribute + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Badge", allow_mutation=False) @validator("type_name") @@ -3167,7 +3327,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Namespace", allow_mutation=False) @@ -3212,7 +3386,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Catalog", allow_mutation=False) @@ -3266,6 +3454,7 @@ def __setattr__(self, name, value): "google_location_type", "google_labels", "google_tags", + "terms", ] @property @@ -3348,6 +3537,18 @@ def google_tags(self, google_tags: Optional[list[GoogleTag]]): self.attributes = self.Attributes() self.attributes.google_tags = google_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Google", allow_mutation=False) @validator("type_name") @@ -3414,6 +3615,7 @@ def __setattr__(self, name, value): "azure_location", "adls_account_secondary_location", "azure_tags", + "terms", ] @property @@ -3460,6 +3662,18 @@ def azure_tags(self, azure_tags: Optional[list[AzureTag]]): self.attributes = self.Attributes() self.attributes.azure_tags = azure_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Azure", allow_mutation=False) @validator("type_name") @@ -3519,6 +3733,7 @@ def __setattr__(self, name, value): "aws_owner_name", "aws_owner_id", "aws_tags", + "terms", ] @property @@ -3611,6 +3826,18 @@ def aws_tags(self, aws_tags: Optional[list[AwsTag]]): self.attributes = self.Attributes() self.attributes.aws_tags = aws_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("AWS", allow_mutation=False) @validator("type_name") @@ -3663,7 +3890,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("BIProcess", allow_mutation=False) @@ -3711,7 +3952,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("ColumnProcess", allow_mutation=False) @@ -3765,6 +4020,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "icon", "icon_type", + "terms", ] @property @@ -3787,6 +4043,18 @@ def icon_type(self, icon_type: Optional[IconType]): self.attributes = self.Attributes() self.attributes.icon_type = icon_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Collection", allow_mutation=False) @validator("type_name") @@ -3835,6 +4103,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "parent_qualified_name", "collection_qualified_name", + "terms", ] @property @@ -3857,6 +4126,18 @@ def collection_qualified_name(self, collection_qualified_name: str): self.attributes = self.Attributes() self.attributes.collection_qualified_name = collection_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Folder", allow_mutation=False) @validator("type_name") @@ -3907,7 +4188,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("EventStore", allow_mutation=False) @@ -3952,7 +4247,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("ObjectStore", allow_mutation=False) @@ -3997,7 +4306,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("DataQuality", allow_mutation=False) @@ -4042,7 +4365,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("BI", allow_mutation=False) @@ -4087,7 +4424,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("SaaS", allow_mutation=False) @@ -4151,6 +4502,7 @@ def __setattr__(self, name, value): "dbt_tags", "dbt_connection_context", "dbt_semantic_layer_proxy_url", + "terms", ] @property @@ -4337,6 +4689,18 @@ def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[st self.attributes = self.Attributes() self.attributes.dbt_semantic_layer_proxy_url = dbt_semantic_layer_proxy_url + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Dbt", allow_mutation=False) @validator("type_name") @@ -4429,6 +4793,7 @@ def __setattr__(self, name, value): "is_global", "reference", "resource_metadata", + "terms", ] @property @@ -4471,6 +4836,18 @@ def resource_metadata(self, resource_metadata: Optional[dict[str, str]]): self.attributes = self.Attributes() self.attributes.resource_metadata = resource_metadata + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Resource", allow_mutation=False) @validator("type_name") @@ -4520,7 +4897,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Insight", allow_mutation=False) @@ -4572,6 +4963,7 @@ def __setattr__(self, name, value): "api_spec_qualified_name", "api_external_docs", "api_is_auth_optional", + "terms", ] @property @@ -4634,6 +5026,18 @@ def api_is_auth_optional(self, api_is_auth_optional: Optional[bool]): self.attributes = self.Attributes() self.attributes.api_is_auth_optional = api_is_auth_optional + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("API", allow_mutation=False) @validator("type_name") @@ -4706,6 +5110,7 @@ def __setattr__(self, name, value): "view_qualified_name", "is_profiled", "last_profiled_at", + "terms", ] @property @@ -4848,6 +5253,18 @@ def last_profiled_at(self, last_profiled_at: Optional[datetime]): self.attributes = self.Attributes() self.attributes.last_profiled_at = last_profiled_at + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SQL", allow_mutation=False) @validator("type_name") @@ -4942,6 +5359,7 @@ def __setattr__(self, name, value): "google_location_type", "google_labels", "google_tags", + "terms", ] @property @@ -5024,6 +5442,18 @@ def google_tags(self, google_tags: Optional[list[GoogleTag]]): self.attributes = self.Attributes() self.attributes.google_tags = google_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DataStudio", allow_mutation=False) @validator("type_name") @@ -5106,6 +5536,7 @@ def __setattr__(self, name, value): "google_location_type", "google_labels", "google_tags", + "terms", ] @property @@ -5248,7 +5679,19 @@ def google_tags(self, google_tags: Optional[list[GoogleTag]]): self.attributes = self.Attributes() self.attributes.google_tags = google_tags - type_name: str = Field("GCS", allow_mutation=False) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("GCS", allow_mutation=False) @validator("type_name") def validate_type_name(cls, v): @@ -5344,6 +5787,7 @@ def __setattr__(self, name, value): "google_location_type", "google_labels", "google_tags", + "terms", ] @property @@ -5470,6 +5914,18 @@ def google_tags(self, google_tags: Optional[list[GoogleTag]]): self.attributes = self.Attributes() self.attributes.google_tags = google_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DataStudioAsset", allow_mutation=False) @validator("type_name") @@ -5555,6 +6011,7 @@ def __setattr__(self, name, value): "azure_location", "adls_account_secondary_location", "azure_tags", + "terms", ] @property @@ -5611,6 +6068,18 @@ def azure_tags(self, azure_tags: Optional[list[AzureTag]]): self.attributes = self.Attributes() self.attributes.azure_tags = azure_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ADLS", allow_mutation=False) @validator("type_name") @@ -5681,6 +6150,7 @@ def __setattr__(self, name, value): "aws_owner_name", "aws_owner_id", "aws_tags", + "terms", ] @property @@ -5793,6 +6263,18 @@ def aws_tags(self, aws_tags: Optional[list[AwsTag]]): self.attributes = self.Attributes() self.attributes.aws_tags = aws_tags + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("S3", allow_mutation=False) @validator("type_name") @@ -5878,6 +6360,7 @@ def __setattr__(self, name, value): "code", "sql", "ast", + "terms", ] @property @@ -6126,6 +6609,18 @@ def ast(self, ast: Optional[str]): self.attributes = self.Attributes() self.attributes.ast = ast + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtColumnProcess", allow_mutation=False) @validator("type_name") @@ -6227,7 +6722,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Kafka", allow_mutation=False) @@ -6277,6 +6786,7 @@ def __setattr__(self, name, value): "metric_s_q_l", "metric_filters", "metric_time_grains", + "terms", ] @property @@ -6319,6 +6829,18 @@ def metric_time_grains(self, metric_time_grains: Optional[set[str]]): self.attributes = self.Attributes() self.attributes.metric_time_grains = metric_time_grains + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Metric", allow_mutation=False) @validator("type_name") @@ -6382,6 +6904,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "metabase_collection_name", "metabase_collection_qualified_name", + "terms", ] @property @@ -6408,6 +6931,18 @@ def metabase_collection_qualified_name( metabase_collection_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Metabase", allow_mutation=False) @validator("type_name") @@ -6461,6 +6996,7 @@ def __setattr__(self, name, value): "quick_sight_id", "quick_sight_sheet_id", "quick_sight_sheet_name", + "terms", ] @property @@ -6493,6 +7029,18 @@ def quick_sight_sheet_name(self, quick_sight_sheet_name: Optional[str]): self.attributes = self.Attributes() self.attributes.quick_sight_sheet_name = quick_sight_sheet_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSight", allow_mutation=False) @validator("type_name") @@ -6548,6 +7096,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "thoughtspot_chart_type", "thoughtspot_question_text", + "terms", ] @property @@ -6570,6 +7119,18 @@ def thoughtspot_question_text(self, thoughtspot_question_text: Optional[str]): self.attributes = self.Attributes() self.attributes.thoughtspot_question_text = thoughtspot_question_text + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Thoughtspot", allow_mutation=False) @validator("type_name") @@ -6624,6 +7185,7 @@ def __setattr__(self, name, value): "power_b_i_table_qualified_name", "power_b_i_format_string", "power_b_i_endorsement", + "terms", ] @property @@ -6670,6 +7232,18 @@ def power_b_i_endorsement( self.attributes = self.Attributes() self.attributes.power_b_i_endorsement = power_b_i_endorsement + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBI", allow_mutation=False) @validator("type_name") @@ -6730,6 +7304,7 @@ def __setattr__(self, name, value): "preset_workspace_qualified_name", "preset_dashboard_id", "preset_dashboard_qualified_name", + "terms", ] @property @@ -6780,6 +7355,18 @@ def preset_dashboard_qualified_name( preset_dashboard_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Preset", allow_mutation=False) @validator("type_name") @@ -6845,6 +7432,7 @@ def __setattr__(self, name, value): "mode_report_qualified_name", "mode_query_name", "mode_query_qualified_name", + "terms", ] @property @@ -6939,6 +7527,18 @@ def mode_query_qualified_name(self, mode_query_qualified_name: Optional[str]): self.attributes = self.Attributes() self.attributes.mode_query_qualified_name = mode_query_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Mode", allow_mutation=False) @validator("type_name") @@ -7012,6 +7612,7 @@ def __setattr__(self, name, value): "sigma_page_name", "sigma_data_element_qualified_name", "sigma_data_element_name", + "terms", ] @property @@ -7080,6 +7681,18 @@ def sigma_data_element_name(self, sigma_data_element_name: Optional[str]): self.attributes = self.Attributes() self.attributes.sigma_data_element_name = sigma_data_element_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Sigma", allow_mutation=False) @validator("type_name") @@ -7150,6 +7763,7 @@ def __setattr__(self, name, value): "qlik_app_qualified_name", "qlik_owner_id", "qlik_is_published", + "terms", ] @property @@ -7232,6 +7846,18 @@ def qlik_is_published(self, qlik_is_published: Optional[bool]): self.attributes = self.Attributes() self.attributes.qlik_is_published = qlik_is_published + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Qlik", allow_mutation=False) @validator("type_name") @@ -7289,7 +7915,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Tableau", allow_mutation=False) @@ -7334,7 +7974,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Looker", allow_mutation=False) @@ -7371,6 +8025,79 @@ class Attributes(BI.Attributes): ) +class Redash(BI): + """Description""" + + def __setattr__(self, name, value): + if name in Redash._convience_properties: + return object.__setattr__(self, name, value) + super().__setattr__(name, value) + + _convience_properties: ClassVar[list[str]] = [ + "redash_is_published", + "terms", + ] + + @property + def redash_is_published(self) -> Optional[bool]: + return self.attributes.redash_is_published + + @redash_is_published.setter + def redash_is_published(self, redash_is_published: Optional[bool]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_is_published = redash_is_published + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("Redash", allow_mutation=False) + + @validator("type_name") + def validate_type_name(cls, v): + if v != "Redash": + raise ValueError("must be Redash") + return v + + class Attributes(BI.Attributes): + redash_is_published: Optional[bool] = Field( + None, description="", alias="redashIsPublished" + ) + input_to_processes: Optional[list[Process]] = Field( + None, description="", alias="inputToProcesses" + ) # relationship + links: Optional[list[Link]] = Field( + None, description="", alias="links" + ) # relationship + metrics: Optional[list[Metric]] = Field( + None, description="", alias="metrics" + ) # relationship + readme: Optional[Readme] = Field( + None, description="", alias="readme" + ) # relationship + meanings: Optional[list[AtlasGlossaryTerm]] = Field( + None, description="", alias="meanings" + ) # relationship + output_from_processes: Optional[list[Process]] = Field( + None, description="", alias="outputFromProcesses" + ) # relationship + + attributes: "Redash.Attributes" = Field( + None, + description="Map of attributes in the instance and their values. The specific keys of this map will vary by " + "type, so are described in the sub-types of this schema.\n", + ) + + class Salesforce(SaaS): """Description""" @@ -7382,6 +8109,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "organization_qualified_name", "api_name", + "terms", ] @property @@ -7404,6 +8132,18 @@ def api_name(self, api_name: Optional[str]): self.attributes = self.Attributes() self.attributes.api_name = api_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Salesforce", allow_mutation=False) @validator("type_name") @@ -7455,6 +8195,7 @@ def __setattr__(self, name, value): "dbt_model_qualified_name", "dbt_model_column_data_type", "dbt_model_column_order", + "terms", ] @property @@ -7487,6 +8228,18 @@ def dbt_model_column_order(self, dbt_model_column_order: Optional[int]): self.attributes = self.Attributes() self.attributes.dbt_model_column_order = dbt_model_column_order + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtModelColumn", allow_mutation=False) @validator("type_name") @@ -7562,6 +8315,7 @@ def __setattr__(self, name, value): "dbt_model_execution_time", "dbt_model_run_generated_at", "dbt_model_run_elapsed_time", + "terms", ] @property @@ -7704,6 +8458,18 @@ def dbt_model_run_elapsed_time(self, dbt_model_run_elapsed_time: Optional[float] self.attributes = self.Attributes() self.attributes.dbt_model_run_elapsed_time = dbt_model_run_elapsed_time + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtModel", allow_mutation=False) @validator("type_name") @@ -7814,6 +8580,7 @@ def __setattr__(self, name, value): "metric_s_q_l", "metric_filters", "metric_time_grains", + "terms", ] @property @@ -8050,6 +8817,18 @@ def metric_time_grains(self, metric_time_grains: Optional[set[str]]): self.attributes = self.Attributes() self.attributes.metric_time_grains = metric_time_grains + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtMetric", allow_mutation=False) @validator("type_name") @@ -8166,6 +8945,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "dbt_state", "dbt_freshness_criteria", + "terms", ] @property @@ -8188,6 +8968,18 @@ def dbt_freshness_criteria(self, dbt_freshness_criteria: Optional[str]): self.attributes = self.Attributes() self.attributes.dbt_freshness_criteria = dbt_freshness_criteria + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtSource", allow_mutation=False) @validator("type_name") @@ -8266,6 +9058,7 @@ def __setattr__(self, name, value): "code", "sql", "ast", + "terms", ] @property @@ -8512,6 +9305,18 @@ def ast(self, ast: Optional[str]): self.attributes = self.Attributes() self.attributes.ast = ast + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("DbtProcess", allow_mutation=False) @validator("type_name") @@ -8613,6 +9418,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "icon", "icon_type", + "terms", ] @property @@ -8635,6 +9441,18 @@ def icon_type(self, icon_type: Optional[IconType]): self.attributes = self.Attributes() self.attributes.icon_type = icon_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ReadmeTemplate", allow_mutation=False) @validator("type_name") @@ -8680,7 +9498,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("Readme", allow_mutation=False) @@ -8785,6 +9617,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "icon", "icon_type", + "terms", ] @property @@ -8807,6 +9640,18 @@ def icon_type(self, icon_type: Optional[IconType]): self.attributes = self.Attributes() self.attributes.icon_type = icon_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Link", allow_mutation=False) @validator("type_name") @@ -8867,6 +9712,7 @@ def __setattr__(self, name, value): "api_spec_license_url", "api_spec_contract_version", "api_spec_service_alias", + "terms", ] @property @@ -8951,6 +9797,18 @@ def api_spec_service_alias(self, api_spec_service_alias: Optional[str]): self.attributes = self.Attributes() self.attributes.api_spec_service_alias = api_spec_service_alias + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("APISpec", allow_mutation=False) @validator("type_name") @@ -9028,6 +9886,7 @@ def __setattr__(self, name, value): "api_path_available_operations", "api_path_available_response_codes", "api_path_is_ingress_exposed", + "terms", ] @property @@ -9096,6 +9955,18 @@ def api_path_is_ingress_exposed(self, api_path_is_ingress_exposed: Optional[bool self.attributes = self.Attributes() self.attributes.api_path_is_ingress_exposed = api_path_is_ingress_exposed + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("APIPath", allow_mutation=False) @validator("type_name") @@ -9176,6 +10047,7 @@ def __setattr__(self, name, value): "partition_strategy", "partition_count", "partition_list", + "terms", ] @property @@ -9328,7 +10200,19 @@ def partition_list(self, partition_list: Optional[str]): self.attributes = self.Attributes() self.attributes.partition_list = partition_list - type_name: str = Field("TablePartition", allow_mutation=False) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("TablePartition", allow_mutation=False) @validator("type_name") def validate_type_name(cls, v): @@ -9437,6 +10321,7 @@ def __setattr__(self, name, value): "partition_strategy", "partition_count", "partition_list", + "terms", ] @property @@ -9579,6 +10464,18 @@ def partition_list(self, partition_list: Optional[str]): self.attributes = self.Attributes() self.attributes.partition_list = partition_list + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Table", allow_mutation=False) @validator("type_name") @@ -9725,6 +10622,7 @@ def __setattr__(self, name, value): "collection_qualified_name", "is_visual_query", "visual_builder_schema_base64", + "terms", ] @property @@ -9833,6 +10731,18 @@ def visual_builder_schema_base64(self, visual_builder_schema_base64: Optional[st self.attributes = self.Attributes() self.attributes.visual_builder_schema_base64 = visual_builder_schema_base64 + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Query", allow_mutation=False) @validator("type_name") @@ -9970,6 +10880,7 @@ def __setattr__(self, name, value): "column_uniqueness_percentage", "column_variance", "column_top_values", + "terms", ] @property @@ -10448,6 +11359,18 @@ def column_top_values( self.attributes = self.Attributes() self.attributes.column_top_values = column_top_values + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Column", allow_mutation=False) @validator("type_name") @@ -10690,6 +11613,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "table_count", "views_count", + "terms", ] @property @@ -10712,6 +11636,18 @@ def views_count(self, views_count: Optional[int]): self.attributes = self.Attributes() self.attributes.views_count = views_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Schema", allow_mutation=False) @validator("type_name") @@ -10834,6 +11770,7 @@ def __setattr__(self, name, value): "snowflake_stream_mode", "snowflake_stream_is_stale", "snowflake_stream_stale_after", + "terms", ] @property @@ -10888,6 +11825,18 @@ def snowflake_stream_stale_after( self.attributes = self.Attributes() self.attributes.snowflake_stream_stale_after = snowflake_stream_stale_after + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SnowflakeStream", allow_mutation=False) @validator("type_name") @@ -10965,6 +11914,7 @@ def __setattr__(self, name, value): "definition", "snowflake_pipe_is_auto_ingest_enabled", "snowflake_pipe_notification_channel_name", + "terms", ] @property @@ -11005,6 +11955,18 @@ def snowflake_pipe_notification_channel_name( snowflake_pipe_notification_channel_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SnowflakePipe", allow_mutation=False) @validator("type_name") @@ -11072,6 +12034,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "schema_count", + "terms", ] @property @@ -11084,6 +12047,18 @@ def schema_count(self, schema_count: Optional[int]): self.attributes = self.Attributes() self.attributes.schema_count = schema_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Database", allow_mutation=False) @validator("type_name") @@ -11192,6 +12167,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "definition", + "terms", ] @property @@ -11204,6 +12180,18 @@ def definition(self, definition: str): self.attributes = self.Attributes() self.attributes.definition = definition + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("Procedure", allow_mutation=False) @validator("type_name") @@ -11272,6 +12260,7 @@ def __setattr__(self, name, value): "alias", "is_temporary", "definition", + "terms", ] @property @@ -11354,6 +12343,18 @@ def definition(self, definition: Optional[str]): self.attributes = self.Attributes() self.attributes.definition = definition + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("View", allow_mutation=False) @validator("type_name") @@ -11479,6 +12480,7 @@ def __setattr__(self, name, value): "alias", "is_temporary", "definition", + "terms", ] @property @@ -11601,6 +12603,18 @@ def definition(self, definition: Optional[str]): self.attributes = self.Attributes() self.attributes.definition = definition + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("MaterialisedView", allow_mutation=False) @validator("type_name") @@ -11698,6 +12712,7 @@ def __setattr__(self, name, value): "gcs_object_content_disposition", "gcs_object_content_language", "gcs_object_retention_expiration_date", + "terms", ] @property @@ -11860,6 +12875,18 @@ def gcs_object_retention_expiration_date( gcs_object_retention_expiration_date ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("GCSObject", allow_mutation=False) @validator("type_name") @@ -11959,6 +12986,7 @@ def __setattr__(self, name, value): "gcs_bucket_retention_effective_time", "gcs_bucket_lifecycle_rules", "gcs_bucket_retention_policy", + "terms", ] @property @@ -12037,6 +13065,18 @@ def gcs_bucket_retention_policy(self, gcs_bucket_retention_policy: Optional[str] self.attributes = self.Attributes() self.attributes.gcs_bucket_retention_policy = gcs_bucket_retention_policy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("GCSBucket", allow_mutation=False) @validator("type_name") @@ -12115,6 +13155,7 @@ def __setattr__(self, name, value): "adls_primary_disk_state", "adls_account_provision_state", "adls_account_access_tier", + "terms", ] @property @@ -12227,6 +13268,18 @@ def adls_account_access_tier( self.attributes = self.Attributes() self.attributes.adls_account_access_tier = adls_account_access_tier + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ADLSAccount", allow_mutation=False) @validator("type_name") @@ -12308,6 +13361,7 @@ def __setattr__(self, name, value): "adls_container_encryption_scope", "adls_container_version_level_immutability_support", "adls_object_count", + "terms", ] @property @@ -12382,6 +13436,18 @@ def adls_object_count(self, adls_object_count: Optional[int]): self.attributes = self.Attributes() self.attributes.adls_object_count = adls_object_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ADLSContainer", allow_mutation=False) @validator("type_name") @@ -12467,6 +13533,7 @@ def __setattr__(self, name, value): "adls_object_lease_state", "adls_object_metadata", "adls_container_qualified_name", + "terms", ] @property @@ -12661,6 +13728,18 @@ def adls_container_qualified_name( self.attributes = self.Attributes() self.attributes.adls_container_qualified_name = adls_container_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ADLSObject", allow_mutation=False) @validator("type_name") @@ -12761,6 +13840,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "s3_object_count", "s3_bucket_versioning_enabled", + "terms", ] @property @@ -12785,6 +13865,18 @@ def s3_bucket_versioning_enabled( self.attributes = self.Attributes() self.attributes.s3_bucket_versioning_enabled = s3_bucket_versioning_enabled + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("S3Bucket", allow_mutation=False) @validator("type_name") @@ -12891,6 +13983,7 @@ def __setattr__(self, name, value): "s3_object_content_type", "s3_object_content_disposition", "s3_object_version_id", + "terms", ] @property @@ -12987,6 +14080,18 @@ def s3_object_version_id(self, s3_object_version_id: Optional[str]): self.attributes = self.Attributes() self.attributes.s3_object_version_id = s3_object_version_id + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("S3Object", allow_mutation=False) @validator("type_name") @@ -13123,6 +14228,7 @@ def __setattr__(self, name, value): "kafka_topic_size_in_bytes", "kafka_topic_record_count", "kafka_topic_cleanup_policy", + "terms", ] @property @@ -13211,6 +14317,18 @@ def kafka_topic_cleanup_policy( self.attributes = self.Attributes() self.attributes.kafka_topic_cleanup_policy = kafka_topic_cleanup_policy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("KafkaTopic", allow_mutation=False) @validator("type_name") @@ -13286,6 +14404,7 @@ def __setattr__(self, name, value): "kafka_consumer_group_member_count", "kafka_topic_names", "kafka_topic_qualified_names", + "terms", ] @property @@ -13343,6 +14462,18 @@ def kafka_topic_qualified_names( self.attributes = self.Attributes() self.attributes.kafka_topic_qualified_names = kafka_topic_qualified_names + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("KafkaConsumerGroup", allow_mutation=False) @validator("type_name") @@ -13407,6 +14538,7 @@ def __setattr__(self, name, value): "metabase_dashboard_count", "metabase_query_type", "metabase_query", + "terms", ] @property @@ -13439,6 +14571,18 @@ def metabase_query(self, metabase_query: Optional[str]): self.attributes = self.Attributes() self.attributes.metabase_query = metabase_query + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("MetabaseQuestion", allow_mutation=False) @validator("type_name") @@ -13502,6 +14646,7 @@ def __setattr__(self, name, value): "metabase_color", "metabase_namespace", "metabase_is_personal_collection", + "terms", ] @property @@ -13548,6 +14693,18 @@ def metabase_is_personal_collection( metabase_is_personal_collection ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("MetabaseCollection", allow_mutation=False) @validator("type_name") @@ -13609,6 +14766,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "metabase_question_count", + "terms", ] @property @@ -13621,6 +14779,18 @@ def metabase_question_count(self, metabase_question_count: Optional[int]): self.attributes = self.Attributes() self.attributes.metabase_question_count = metabase_question_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("MetabaseDashboard", allow_mutation=False) @validator("type_name") @@ -13676,6 +14846,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_folder_type", "quick_sight_folder_hierarchy", + "terms", ] @property @@ -13702,6 +14873,18 @@ def quick_sight_folder_hierarchy( self.attributes = self.Attributes() self.attributes.quick_sight_folder_hierarchy = quick_sight_folder_hierarchy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightFolder", allow_mutation=False) @validator("type_name") @@ -13762,6 +14945,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_dashboard_qualified_name", + "terms", ] @property @@ -13778,6 +14962,18 @@ def quick_sight_dashboard_qualified_name( quick_sight_dashboard_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightDashboardVisual", allow_mutation=False) @validator("type_name") @@ -13829,6 +15025,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_analysis_qualified_name", + "terms", ] @property @@ -13845,6 +15042,18 @@ def quick_sight_analysis_qualified_name( quick_sight_analysis_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightAnalysisVisual", allow_mutation=False) @validator("type_name") @@ -13897,6 +15106,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_dataset_field_type", "quick_sight_dataset_qualified_name", + "terms", ] @property @@ -13925,6 +15135,18 @@ def quick_sight_dataset_qualified_name( quick_sight_dataset_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightDatasetField", allow_mutation=False) @validator("type_name") @@ -13982,6 +15204,7 @@ def __setattr__(self, name, value): "quick_sight_analysis_calculated_fields", "quick_sight_analysis_parameter_declarations", "quick_sight_analysis_filter_groups", + "terms", ] @property @@ -14038,6 +15261,18 @@ def quick_sight_analysis_filter_groups( quick_sight_analysis_filter_groups ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightAnalysis", allow_mutation=False) @validator("type_name") @@ -14102,6 +15337,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_dashboard_published_version_number", "quick_sight_dashboard_last_published_time", + "terms", ] @property @@ -14132,6 +15368,18 @@ def quick_sight_dashboard_last_published_time( quick_sight_dashboard_last_published_time ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightDashboard", allow_mutation=False) @validator("type_name") @@ -14192,6 +15440,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "quick_sight_dataset_import_mode", "quick_sight_dataset_column_count", + "terms", ] @property @@ -14222,6 +15471,18 @@ def quick_sight_dataset_column_count( quick_sight_dataset_column_count ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QuickSightDataset", allow_mutation=False) @validator("type_name") @@ -14277,7 +15538,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("ThoughtspotLiveboard", allow_mutation=False) @@ -14328,6 +15603,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "thoughtspot_liveboard_name", "thoughtspot_liveboard_qualified_name", + "terms", ] @property @@ -14354,6 +15630,18 @@ def thoughtspot_liveboard_qualified_name( thoughtspot_liveboard_qualified_name ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ThoughtspotDashlet", allow_mutation=False) @validator("type_name") @@ -14406,7 +15694,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("ThoughtspotAnswer", allow_mutation=False) @@ -14456,6 +15758,7 @@ def __setattr__(self, name, value): "dataset_qualified_name", "web_url", "page_count", + "terms", ] @property @@ -14498,6 +15801,18 @@ def page_count(self, page_count: Optional[int]): self.attributes = self.Attributes() self.attributes.page_count = page_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIReport", allow_mutation=False) @validator("type_name") @@ -14566,6 +15881,7 @@ def __setattr__(self, name, value): "dataset_qualified_name", "power_b_i_measure_expression", "power_b_i_is_external_measure", + "terms", ] @property @@ -14610,6 +15926,18 @@ def power_b_i_is_external_measure( self.attributes = self.Attributes() self.attributes.power_b_i_is_external_measure = power_b_i_is_external_measure + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIMeasure", allow_mutation=False) @validator("type_name") @@ -14675,6 +16003,7 @@ def __setattr__(self, name, value): "power_b_i_column_data_type", "power_b_i_sort_by_column", "power_b_i_column_summarize_by", + "terms", ] @property @@ -14741,10 +16070,22 @@ def power_b_i_column_summarize_by( self.attributes = self.Attributes() self.attributes.power_b_i_column_summarize_by = power_b_i_column_summarize_by - type_name: str = Field("PowerBIColumn", allow_mutation=False) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings - @validator("type_name") - def validate_type_name(cls, v): + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("PowerBIColumn", allow_mutation=False) + + @validator("type_name") + def validate_type_name(cls, v): if v != "PowerBIColumn": raise ValueError("must be PowerBIColumn") return v @@ -14811,6 +16152,7 @@ def __setattr__(self, name, value): "power_b_i_table_source_expressions", "power_b_i_table_column_count", "power_b_i_table_measure_count", + "terms", ] @property @@ -14869,6 +16211,18 @@ def power_b_i_table_measure_count( self.attributes = self.Attributes() self.attributes.power_b_i_table_measure_count = power_b_i_table_measure_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBITable", allow_mutation=False) @validator("type_name") @@ -14939,6 +16293,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "workspace_qualified_name", "dashboard_qualified_name", + "terms", ] @property @@ -14961,6 +16316,18 @@ def dashboard_qualified_name(self, dashboard_qualified_name: Optional[str]): self.attributes = self.Attributes() self.attributes.dashboard_qualified_name = dashboard_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBITile", allow_mutation=False) @validator("type_name") @@ -15021,6 +16388,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "connection_details", + "terms", ] @property @@ -15033,6 +16401,18 @@ def connection_details(self, connection_details: Optional[dict[str, str]]): self.attributes = self.Attributes() self.attributes.connection_details = connection_details + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIDatasource", allow_mutation=False) @validator("type_name") @@ -15088,6 +16468,7 @@ def __setattr__(self, name, value): "dashboard_count", "dataset_count", "dataflow_count", + "terms", ] @property @@ -15140,6 +16521,18 @@ def dataflow_count(self, dataflow_count: Optional[int]): self.attributes = self.Attributes() self.attributes.dataflow_count = dataflow_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIWorkspace", allow_mutation=False) @validator("type_name") @@ -15207,6 +16600,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "workspace_qualified_name", "web_url", + "terms", ] @property @@ -15229,6 +16623,18 @@ def web_url(self, web_url: Optional[str]): self.attributes = self.Attributes() self.attributes.web_url = web_url + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIDataset", allow_mutation=False) @validator("type_name") @@ -15298,6 +16704,7 @@ def __setattr__(self, name, value): "workspace_qualified_name", "web_url", "tile_count", + "terms", ] @property @@ -15330,6 +16737,18 @@ def tile_count(self, tile_count: Optional[int]): self.attributes = self.Attributes() self.attributes.tile_count = tile_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIDashboard", allow_mutation=False) @validator("type_name") @@ -15387,6 +16806,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "workspace_qualified_name", "web_url", + "terms", ] @property @@ -15409,6 +16829,18 @@ def web_url(self, web_url: Optional[str]): self.attributes = self.Attributes() self.attributes.web_url = web_url + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIDataflow", allow_mutation=False) @validator("type_name") @@ -15465,6 +16897,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "workspace_qualified_name", "report_qualified_name", + "terms", ] @property @@ -15487,6 +16920,18 @@ def report_qualified_name(self, report_qualified_name: Optional[str]): self.attributes = self.Attributes() self.attributes.report_qualified_name = report_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PowerBIPage", allow_mutation=False) @validator("type_name") @@ -15542,6 +16987,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "preset_chart_description_markdown", "preset_chart_form_data", + "terms", ] @property @@ -15568,6 +17014,18 @@ def preset_chart_form_data(self, preset_chart_form_data: Optional[dict[str, str] self.attributes = self.Attributes() self.attributes.preset_chart_form_data = preset_chart_form_data + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PresetChart", allow_mutation=False) @validator("type_name") @@ -15624,6 +17082,7 @@ def __setattr__(self, name, value): "preset_dataset_datasource_name", "preset_dataset_id", "preset_dataset_type", + "terms", ] @property @@ -15658,6 +17117,18 @@ def preset_dataset_type(self, preset_dataset_type: Optional[str]): self.attributes = self.Attributes() self.attributes.preset_dataset_type = preset_dataset_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PresetDataset", allow_mutation=False) @validator("type_name") @@ -15720,6 +17191,7 @@ def __setattr__(self, name, value): "preset_dashboard_is_published", "preset_dashboard_thumbnail_url", "preset_dashboard_chart_count", + "terms", ] @property @@ -15798,6 +17270,18 @@ def preset_dashboard_chart_count(self, preset_dashboard_chart_count: Optional[in self.attributes = self.Attributes() self.attributes.preset_dashboard_chart_count = preset_dashboard_chart_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PresetDashboard", allow_mutation=False) @validator("type_name") @@ -15878,6 +17362,7 @@ def __setattr__(self, name, value): "preset_workspace_deployment_id", "preset_workspace_dashboard_count", "preset_workspace_dataset_count", + "terms", ] @property @@ -15986,6 +17471,18 @@ def preset_workspace_dataset_count( self.attributes = self.Attributes() self.attributes.preset_workspace_dataset_count = preset_workspace_dataset_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("PresetWorkspace", allow_mutation=False) @validator("type_name") @@ -16067,6 +17564,7 @@ def __setattr__(self, name, value): "mode_query_preview", "mode_is_public", "mode_is_shared", + "terms", ] @property @@ -16139,6 +17637,18 @@ def mode_is_shared(self, mode_is_shared: Optional[bool]): self.attributes = self.Attributes() self.attributes.mode_is_shared = mode_is_shared + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ModeReport", allow_mutation=False) @validator("type_name") @@ -16212,6 +17722,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "mode_raw_query", "mode_report_import_count", + "terms", ] @property @@ -16234,6 +17745,18 @@ def mode_report_import_count(self, mode_report_import_count: Optional[int]): self.attributes = self.Attributes() self.attributes.mode_report_import_count = mode_report_import_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ModeQuery", allow_mutation=False) @validator("type_name") @@ -16291,6 +17814,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "mode_chart_type", + "terms", ] @property @@ -16303,6 +17827,18 @@ def mode_chart_type(self, mode_chart_type: Optional[str]): self.attributes = self.Attributes() self.attributes.mode_chart_type = mode_chart_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ModeChart", allow_mutation=False) @validator("type_name") @@ -16354,6 +17890,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "mode_collection_count", + "terms", ] @property @@ -16366,6 +17903,18 @@ def mode_collection_count(self, mode_collection_count: Optional[int]): self.attributes = self.Attributes() self.attributes.mode_collection_count = mode_collection_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ModeWorkspace", allow_mutation=False) @validator("type_name") @@ -16418,6 +17967,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "mode_collection_type", "mode_collection_state", + "terms", ] @property @@ -16440,6 +17990,18 @@ def mode_collection_state(self, mode_collection_state: Optional[str]): self.attributes = self.Attributes() self.attributes.mode_collection_state = mode_collection_state + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("ModeCollection", allow_mutation=False) @validator("type_name") @@ -16498,6 +18060,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "sigma_dataset_qualified_name", "sigma_dataset_name", + "terms", ] @property @@ -16520,6 +18083,18 @@ def sigma_dataset_name(self, sigma_dataset_name: Optional[str]): self.attributes = self.Attributes() self.attributes.sigma_dataset_name = sigma_dataset_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaDatasetColumn", allow_mutation=False) @validator("type_name") @@ -16574,6 +18149,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "sigma_dataset_column_count", + "terms", ] @property @@ -16586,6 +18162,18 @@ def sigma_dataset_column_count(self, sigma_dataset_column_count: Optional[int]): self.attributes = self.Attributes() self.attributes.sigma_dataset_column_count = sigma_dataset_column_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaDataset", allow_mutation=False) @validator("type_name") @@ -16637,6 +18225,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "sigma_page_count", + "terms", ] @property @@ -16649,6 +18238,18 @@ def sigma_page_count(self, sigma_page_count: Optional[int]): self.attributes = self.Attributes() self.attributes.sigma_page_count = sigma_page_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaWorkbook", allow_mutation=False) @validator("type_name") @@ -16701,6 +18302,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "sigma_data_element_field_is_hidden", "sigma_data_element_field_formula", + "terms", ] @property @@ -16731,6 +18333,18 @@ def sigma_data_element_field_formula( sigma_data_element_field_formula ) + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaDataElementField", allow_mutation=False) @validator("type_name") @@ -16785,6 +18399,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "sigma_data_element_count", + "terms", ] @property @@ -16797,6 +18412,18 @@ def sigma_data_element_count(self, sigma_data_element_count: Optional[int]): self.attributes = self.Attributes() self.attributes.sigma_data_element_count = sigma_data_element_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaPage", allow_mutation=False) @validator("type_name") @@ -16853,6 +18480,7 @@ def __setattr__(self, name, value): "sigma_data_element_query", "sigma_data_element_type", "sigma_data_element_field_count", + "terms", ] @property @@ -16887,6 +18515,18 @@ def sigma_data_element_field_count( self.attributes = self.Attributes() self.attributes.sigma_data_element_field_count = sigma_data_element_field_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SigmaDataElement", allow_mutation=False) @validator("type_name") @@ -16947,6 +18587,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "qlik_space_type", + "terms", ] @property @@ -16959,6 +18600,18 @@ def qlik_space_type(self, qlik_space_type: Optional[str]): self.attributes = self.Attributes() self.attributes.qlik_space_type = qlik_space_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QlikSpace", allow_mutation=False) @validator("type_name") @@ -17017,6 +18670,7 @@ def __setattr__(self, name, value): "qlik_is_encrypted", "qlik_is_direct_query_mode", "qlik_app_static_byte_size", + "terms", ] @property @@ -17069,6 +18723,18 @@ def qlik_app_static_byte_size(self, qlik_app_static_byte_size: Optional[int]): self.attributes = self.Attributes() self.attributes.qlik_app_static_byte_size = qlik_app_static_byte_size + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QlikApp", allow_mutation=False) @validator("type_name") @@ -17138,6 +18804,7 @@ def __setattr__(self, name, value): "qlik_chart_footnote", "qlik_chart_orientation", "qlik_chart_type", + "terms", ] @property @@ -17180,6 +18847,18 @@ def qlik_chart_type(self, qlik_chart_type: Optional[str]): self.attributes = self.Attributes() self.attributes.qlik_chart_type = qlik_chart_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QlikChart", allow_mutation=False) @validator("type_name") @@ -17243,6 +18922,7 @@ def __setattr__(self, name, value): "qlik_dataset_type", "qlik_dataset_uri", "qlik_dataset_subtype", + "terms", ] @property @@ -17285,6 +18965,18 @@ def qlik_dataset_subtype(self, qlik_dataset_subtype: Optional[str]): self.attributes = self.Attributes() self.attributes.qlik_dataset_subtype = qlik_dataset_subtype + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QlikDataset", allow_mutation=False) @validator("type_name") @@ -17345,6 +19037,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "qlik_sheet_is_approved", + "terms", ] @property @@ -17357,6 +19050,18 @@ def qlik_sheet_is_approved(self, qlik_sheet_is_approved: Optional[bool]): self.attributes = self.Attributes() self.attributes.qlik_sheet_is_approved = qlik_sheet_is_approved + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("QlikSheet", allow_mutation=False) @validator("type_name") @@ -17415,6 +19120,7 @@ def __setattr__(self, name, value): "top_level_project_name", "top_level_project_qualified_name", "project_hierarchy", + "terms", ] @property @@ -17471,6 +19177,18 @@ def project_hierarchy(self, project_hierarchy: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.project_hierarchy = project_hierarchy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauWorkbook", allow_mutation=False) @validator("type_name") @@ -17558,6 +19276,7 @@ def __setattr__(self, name, value): "upstream_columns", "upstream_fields", "datasource_field_type", + "terms", ] @property @@ -17742,6 +19461,18 @@ def datasource_field_type(self, datasource_field_type: Optional[str]): self.attributes = self.Attributes() self.attributes.datasource_field_type = datasource_field_type + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauDatasourceField", allow_mutation=False) @validator("type_name") @@ -17851,6 +19582,7 @@ def __setattr__(self, name, value): "tableau_data_type", "formula", "upstream_fields", + "terms", ] @property @@ -17967,6 +19699,18 @@ def upstream_fields(self, upstream_fields: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.upstream_fields = upstream_fields + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauCalculatedField", allow_mutation=False) @validator("type_name") @@ -18048,6 +19792,7 @@ def __setattr__(self, name, value): "top_level_project_qualified_name", "is_top_level_project", "project_hierarchy", + "terms", ] @property @@ -18094,6 +19839,18 @@ def project_hierarchy(self, project_hierarchy: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.project_hierarchy = project_hierarchy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauProject", allow_mutation=False) @validator("type_name") @@ -18172,6 +19929,7 @@ def __setattr__(self, name, value): "project_qualified_name", "top_level_project_qualified_name", "project_hierarchy", + "terms", ] @property @@ -18218,6 +19976,18 @@ def project_hierarchy(self, project_hierarchy: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.project_hierarchy = project_hierarchy + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauMetric", allow_mutation=False) @validator("type_name") @@ -18276,7 +20046,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("TableauSite", allow_mutation=False) @@ -18338,6 +20122,7 @@ def __setattr__(self, name, value): "certifier_display_name", "upstream_tables", "upstream_datasources", + "terms", ] @property @@ -18476,6 +20261,18 @@ def upstream_datasources( self.attributes = self.Attributes() self.attributes.upstream_datasources = upstream_datasources + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauDatasource", allow_mutation=False) @validator("type_name") @@ -18567,6 +20364,7 @@ def __setattr__(self, name, value): "workbook_qualified_name", "top_level_project_qualified_name", "project_hierarchy", + "terms", ] @property @@ -18623,8 +20421,20 @@ def project_hierarchy(self, project_hierarchy: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.project_hierarchy = project_hierarchy - type_name: str = Field("TableauDashboard", allow_mutation=False) - + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("TableauDashboard", allow_mutation=False) + @validator("type_name") def validate_type_name(cls, v): if v != "TableauDashboard": @@ -18695,6 +20505,7 @@ def __setattr__(self, name, value): "input_fields", "output_fields", "output_steps", + "terms", ] @property @@ -18771,6 +20582,18 @@ def output_steps(self, output_steps: Optional[list[dict[str, str]]]): self.attributes = self.Attributes() self.attributes.output_steps = output_steps + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauFlow", allow_mutation=False) @validator("type_name") @@ -18844,6 +20667,7 @@ def __setattr__(self, name, value): "top_level_project_qualified_name", "project_hierarchy", "workbook_qualified_name", + "terms", ] @property @@ -18900,6 +20724,18 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): self.attributes = self.Attributes() self.attributes.workbook_qualified_name = workbook_qualified_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("TableauWorksheet", allow_mutation=False) @validator("type_name") @@ -18980,6 +20816,7 @@ def __setattr__(self, name, value): "source_content_metadata_id", "source_query_id", "model_name", + "terms", ] @property @@ -19072,6 +20909,18 @@ def model_name(self, model_name: Optional[str]): self.attributes = self.Attributes() self.attributes.model_name = model_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerLook", allow_mutation=False) @validator("type_name") @@ -19161,6 +21010,7 @@ def __setattr__(self, name, value): "sourcelast_updater_id", "source_last_accessed_at", "source_last_viewed_at", + "terms", ] @property @@ -19233,6 +21083,18 @@ def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): self.attributes = self.Attributes() self.attributes.source_last_viewed_at = source_last_viewed_at + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerDashboard", allow_mutation=False) @validator("type_name") @@ -19309,6 +21171,7 @@ def __setattr__(self, name, value): "source_creator_id", "source_child_count", "source_parent_i_d", + "terms", ] @property @@ -19351,6 +21214,18 @@ def source_parent_i_d(self, source_parent_i_d: Optional[int]): self.attributes = self.Attributes() self.attributes.source_parent_i_d = source_parent_i_d + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerFolder", allow_mutation=False) @validator("type_name") @@ -19420,6 +21295,7 @@ def __setattr__(self, name, value): "result_maker_i_d", "subtitle_text", "look_id", + "terms", ] @property @@ -19492,6 +21368,18 @@ def look_id(self, look_id: Optional[int]): self.attributes = self.Attributes() self.attributes.look_id = look_id + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerTile", allow_mutation=False) @validator("type_name") @@ -19559,6 +21447,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "project_name", + "terms", ] @property @@ -19571,6 +21460,18 @@ def project_name(self, project_name: Optional[str]): self.attributes = self.Attributes() self.attributes.project_name = project_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerModel", allow_mutation=False) @validator("type_name") @@ -19636,6 +21537,7 @@ def __setattr__(self, name, value): "source_connection_name", "view_name", "sql_table_name", + "terms", ] @property @@ -19688,6 +21590,18 @@ def sql_table_name(self, sql_table_name: Optional[str]): self.attributes = self.Attributes() self.attributes.sql_table_name = sql_table_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerExplore", allow_mutation=False) @validator("type_name") @@ -19749,7 +21663,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("LookerProject", allow_mutation=False) @@ -19811,6 +21739,7 @@ def __setattr__(self, name, value): "source_definition_database", "source_definition_schema", "fields", + "terms", ] @property @@ -19853,6 +21782,18 @@ def fields(self, fields: Optional[set[str]]): self.attributes = self.Attributes() self.attributes.fields = fields + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerQuery", allow_mutation=False) @validator("type_name") @@ -19923,6 +21864,7 @@ def __setattr__(self, name, value): "source_definition", "looker_field_data_type", "looker_times_used", + "terms", ] @property @@ -19997,6 +21939,18 @@ def looker_times_used(self, looker_times_used: Optional[int]): self.attributes = self.Attributes() self.attributes.looker_times_used = looker_times_used + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerField", allow_mutation=False) @validator("type_name") @@ -20071,6 +22025,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "project_name", + "terms", ] @property @@ -20083,6 +22038,18 @@ def project_name(self, project_name: Optional[str]): self.attributes = self.Attributes() self.attributes.project_name = project_name + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("LookerView", allow_mutation=False) @validator("type_name") @@ -20125,6 +22092,341 @@ class Attributes(Looker.Attributes): ) +class RedashDashboard(Redash): + """Description""" + + def __setattr__(self, name, value): + if name in RedashDashboard._convience_properties: + return object.__setattr__(self, name, value) + super().__setattr__(name, value) + + _convience_properties: ClassVar[list[str]] = [ + "redash_dashboard_widget_count", + "terms", + ] + + @property + def redash_dashboard_widget_count(self) -> Optional[int]: + return self.attributes.redash_dashboard_widget_count + + @redash_dashboard_widget_count.setter + def redash_dashboard_widget_count( + self, redash_dashboard_widget_count: Optional[int] + ): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_dashboard_widget_count = redash_dashboard_widget_count + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("RedashDashboard", allow_mutation=False) + + @validator("type_name") + def validate_type_name(cls, v): + if v != "RedashDashboard": + raise ValueError("must be RedashDashboard") + return v + + class Attributes(Redash.Attributes): + redash_dashboard_widget_count: Optional[int] = Field( + None, description="", alias="redashDashboardWidgetCount" + ) + input_to_processes: Optional[list[Process]] = Field( + None, description="", alias="inputToProcesses" + ) # relationship + links: Optional[list[Link]] = Field( + None, description="", alias="links" + ) # relationship + metrics: Optional[list[Metric]] = Field( + None, description="", alias="metrics" + ) # relationship + readme: Optional[Readme] = Field( + None, description="", alias="readme" + ) # relationship + meanings: Optional[list[AtlasGlossaryTerm]] = Field( + None, description="", alias="meanings" + ) # relationship + output_from_processes: Optional[list[Process]] = Field( + None, description="", alias="outputFromProcesses" + ) # relationship + + attributes: "RedashDashboard.Attributes" = Field( + None, + description="Map of attributes in the instance and their values. The specific keys of this map will vary by " + "type, so are described in the sub-types of this schema.\n", + ) + + +class RedashQuery(Redash): + """Description""" + + def __setattr__(self, name, value): + if name in RedashQuery._convience_properties: + return object.__setattr__(self, name, value) + super().__setattr__(name, value) + + _convience_properties: ClassVar[list[str]] = [ + "redash_query_s_q_l", + "redash_query_parameters", + "redash_query_schedule", + "redash_query_last_execution_runtime", + "redash_query_last_executed_at", + "redash_query_schedule_humanized", + "terms", + ] + + @property + def redash_query_s_q_l(self) -> Optional[str]: + return self.attributes.redash_query_s_q_l + + @redash_query_s_q_l.setter + def redash_query_s_q_l(self, redash_query_s_q_l: Optional[str]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_s_q_l = redash_query_s_q_l + + @property + def redash_query_parameters(self) -> Optional[str]: + return self.attributes.redash_query_parameters + + @redash_query_parameters.setter + def redash_query_parameters(self, redash_query_parameters: Optional[str]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_parameters = redash_query_parameters + + @property + def redash_query_schedule(self) -> Optional[dict[str, str]]: + return self.attributes.redash_query_schedule + + @redash_query_schedule.setter + def redash_query_schedule(self, redash_query_schedule: Optional[dict[str, str]]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_schedule = redash_query_schedule + + @property + def redash_query_last_execution_runtime(self) -> Optional[float]: + return self.attributes.redash_query_last_execution_runtime + + @redash_query_last_execution_runtime.setter + def redash_query_last_execution_runtime( + self, redash_query_last_execution_runtime: Optional[float] + ): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_last_execution_runtime = ( + redash_query_last_execution_runtime + ) + + @property + def redash_query_last_executed_at(self) -> Optional[datetime]: + return self.attributes.redash_query_last_executed_at + + @redash_query_last_executed_at.setter + def redash_query_last_executed_at( + self, redash_query_last_executed_at: Optional[datetime] + ): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_last_executed_at = redash_query_last_executed_at + + @property + def redash_query_schedule_humanized(self) -> Optional[str]: + return self.attributes.redash_query_schedule_humanized + + @redash_query_schedule_humanized.setter + def redash_query_schedule_humanized( + self, redash_query_schedule_humanized: Optional[str] + ): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_schedule_humanized = ( + redash_query_schedule_humanized + ) + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("RedashQuery", allow_mutation=False) + + @validator("type_name") + def validate_type_name(cls, v): + if v != "RedashQuery": + raise ValueError("must be RedashQuery") + return v + + class Attributes(Redash.Attributes): + redash_query_s_q_l: Optional[str] = Field( + None, description="", alias="redashQuerySQL" + ) + redash_query_parameters: Optional[str] = Field( + None, description="", alias="redashQueryParameters" + ) + redash_query_schedule: Optional[dict[str, str]] = Field( + None, description="", alias="redashQuerySchedule" + ) + redash_query_last_execution_runtime: Optional[float] = Field( + None, description="", alias="redashQueryLastExecutionRuntime" + ) + redash_query_last_executed_at: Optional[datetime] = Field( + None, description="", alias="redashQueryLastExecutedAt" + ) + redash_query_schedule_humanized: Optional[str] = Field( + None, description="", alias="redashQueryScheduleHumanized" + ) + input_to_processes: Optional[list[Process]] = Field( + None, description="", alias="inputToProcesses" + ) # relationship + redash_visualizations: Optional[list[RedashVisualization]] = Field( + None, description="", alias="redashVisualizations" + ) # relationship + links: Optional[list[Link]] = Field( + None, description="", alias="links" + ) # relationship + metrics: Optional[list[Metric]] = Field( + None, description="", alias="metrics" + ) # relationship + readme: Optional[Readme] = Field( + None, description="", alias="readme" + ) # relationship + meanings: Optional[list[AtlasGlossaryTerm]] = Field( + None, description="", alias="meanings" + ) # relationship + output_from_processes: Optional[list[Process]] = Field( + None, description="", alias="outputFromProcesses" + ) # relationship + + attributes: "RedashQuery.Attributes" = Field( + None, + description="Map of attributes in the instance and their values. The specific keys of this map will vary by " + "type, so are described in the sub-types of this schema.\n", + ) + + +class RedashVisualization(Redash): + """Description""" + + def __setattr__(self, name, value): + if name in RedashVisualization._convience_properties: + return object.__setattr__(self, name, value) + super().__setattr__(name, value) + + _convience_properties: ClassVar[list[str]] = [ + "redash_visualization_type", + "redash_query_name", + "redash_query_qualified_name", + "terms", + ] + + @property + def redash_visualization_type(self) -> Optional[str]: + return self.attributes.redash_visualization_type + + @redash_visualization_type.setter + def redash_visualization_type(self, redash_visualization_type: Optional[str]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_visualization_type = redash_visualization_type + + @property + def redash_query_name(self) -> Optional[str]: + return self.attributes.redash_query_name + + @redash_query_name.setter + def redash_query_name(self, redash_query_name: Optional[str]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_name = redash_query_name + + @property + def redash_query_qualified_name(self) -> Optional[str]: + return self.attributes.redash_query_qualified_name + + @redash_query_qualified_name.setter + def redash_query_qualified_name(self, redash_query_qualified_name: Optional[str]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.redash_query_qualified_name = redash_query_qualified_name + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + + type_name: str = Field("RedashVisualization", allow_mutation=False) + + @validator("type_name") + def validate_type_name(cls, v): + if v != "RedashVisualization": + raise ValueError("must be RedashVisualization") + return v + + class Attributes(Redash.Attributes): + redash_visualization_type: Optional[str] = Field( + None, description="", alias="redashVisualizationType" + ) + redash_query_name: Optional[str] = Field( + None, description="", alias="redashQueryName" + ) + redash_query_qualified_name: Optional[str] = Field( + None, description="", alias="redashQueryQualifiedName" + ) + input_to_processes: Optional[list[Process]] = Field( + None, description="", alias="inputToProcesses" + ) # relationship + links: Optional[list[Link]] = Field( + None, description="", alias="links" + ) # relationship + metrics: Optional[list[Metric]] = Field( + None, description="", alias="metrics" + ) # relationship + readme: Optional[Readme] = Field( + None, description="", alias="readme" + ) # relationship + redash_query: Optional[RedashQuery] = Field( + None, description="", alias="redashQuery" + ) # relationship + meanings: Optional[list[AtlasGlossaryTerm]] = Field( + None, description="", alias="meanings" + ) # relationship + output_from_processes: Optional[list[Process]] = Field( + None, description="", alias="outputFromProcesses" + ) # relationship + + attributes: "RedashVisualization.Attributes" = Field( + None, + description="Map of attributes in the instance and their values. The specific keys of this map will vary by " + "type, so are described in the sub-types of this schema.\n", + ) + + class SalesforceObject(Salesforce): """Description""" @@ -20138,6 +22440,7 @@ def __setattr__(self, name, value): "is_mergable", "is_queryable", "field_count", + "terms", ] @property @@ -20180,6 +22483,18 @@ def field_count(self, field_count: Optional[int]): self.attributes = self.Attributes() self.attributes.field_count = field_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SalesforceObject", allow_mutation=False) @validator("type_name") @@ -20253,6 +22568,7 @@ def __setattr__(self, name, value): "picklist_values", "is_polymorphic_foreign_key", "default_value_formula", + "terms", ] @property @@ -20415,6 +22731,18 @@ def default_value_formula(self, default_value_formula: Optional[str]): self.attributes = self.Attributes() self.attributes.default_value_formula = default_value_formula + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SalesforceField", allow_mutation=False) @validator("type_name") @@ -20498,6 +22826,7 @@ def __setattr__(self, name, value): _convience_properties: ClassVar[list[str]] = [ "source_id", + "terms", ] @property @@ -20510,6 +22839,18 @@ def source_id(self, source_id: Optional[str]): self.attributes = self.Attributes() self.attributes.source_id = source_id + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SalesforceOrganization", allow_mutation=False) @validator("type_name") @@ -20567,6 +22908,7 @@ def __setattr__(self, name, value): "source_id", "dashboard_type", "report_count", + "terms", ] @property @@ -20599,6 +22941,18 @@ def report_count(self, report_count: Optional[int]): self.attributes = self.Attributes() self.attributes.report_count = report_count + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SalesforceDashboard", allow_mutation=False) @validator("type_name") @@ -20657,6 +23011,7 @@ def __setattr__(self, name, value): "source_id", "report_type", "detail_columns", + "terms", ] @property @@ -20689,6 +23044,18 @@ def detail_columns(self, detail_columns: Optional[set[str]]): self.attributes = self.Attributes() self.attributes.detail_columns = detail_columns + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms + type_name: str = Field("SalesforceReport", allow_mutation=False) @validator("type_name") @@ -20745,7 +23112,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - _convience_properties: ClassVar[list[str]] = [] + _convience_properties: ClassVar[list[str]] = [ + "terms", + ] + + @property + def terms(self) -> list[AtlasGlossaryTerm]: + if self.attributes is None: + self.attributes = self.Attributes() + return [] if self.attributes.meanings is None else self.attributes.meanings + + @terms.setter + def terms(self, terms: list[AtlasGlossaryTerm]): + if self.attributes is None: + self.attributes = self.Attributes() + self.attributes.meanings = terms type_name: str = Field("QlikStream", allow_mutation=False) @@ -20889,6 +23270,8 @@ class Attributes(QlikSpace.Attributes): Looker.Attributes.update_forward_refs() +Redash.Attributes.update_forward_refs() + Salesforce.Attributes.update_forward_refs() DbtModelColumn.Attributes.update_forward_refs() @@ -21079,6 +23462,12 @@ class Attributes(QlikSpace.Attributes): LookerView.Attributes.update_forward_refs() +RedashDashboard.Attributes.update_forward_refs() + +RedashQuery.Attributes.update_forward_refs() + +RedashVisualization.Attributes.update_forward_refs() + SalesforceObject.Attributes.update_forward_refs() SalesforceField.Attributes.update_forward_refs() diff --git a/pyatlan/version.txt b/pyatlan/version.txt index 2678ff8d6..c4475d3bb 100644 --- a/pyatlan/version.txt +++ b/pyatlan/version.txt @@ -1 +1 @@ -0.0.25 +0.0.26 diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index ac2ec7b89..909d996a5 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -1,6 +1,66 @@ +from itertools import count +from typing import Callable, Generator + import pytest from pyatlan.client.atlan import AtlanClient +from pyatlan.model.assets import AtlasGlossary, AtlasGlossaryTerm, Connection, Database + +iter_count = count(1) + + +@pytest.fixture(scope="module") +def client() -> AtlanClient: + return AtlanClient() + + +@pytest.fixture(scope="module") +def connection(client: AtlanClient) -> Connection: + return client.get_asset_by_guid("b3a5c49a-0c7c-4e66-8453-f4da8d9ce222", Connection) + + +@pytest.fixture(scope="module") +def glossary(client: AtlanClient) -> Generator[AtlasGlossary, None, None]: + glossary = AtlasGlossary.create(name="Integration Test Glossary") + glossary = client.upsert(glossary).assets_created(asset_type=AtlasGlossary)[0] + yield glossary + client.purge_entity_by_guid(guid=glossary.guid) + + +@pytest.fixture() +def database( + client: AtlanClient, connection: Connection +) -> Generator[Database, None, None]: + + database = Database.create( + name=f"Integration_Test_Entity_DB{next(iter_count)}", + connection_qualified_name=connection.attributes.qualified_name, + ) + database = client.upsert(database).assets_created(Database)[0] + + yield database + + client.purge_entity_by_guid(guid=database.guid) + + +@pytest.fixture() +def make_term( + client: AtlanClient, glossary +) -> Generator[Callable[[str], AtlasGlossaryTerm], None, None]: + created_term_guids = [] + + def _make_term(name: str) -> AtlasGlossaryTerm: + term = AtlasGlossaryTerm.create( + name=f"Integration Test Glossary Term {name}", anchor=glossary + ) + term = client.upsert(term).assets_created(AtlasGlossaryTerm)[0] + created_term_guids.append(term.guid) + return term + + yield _make_term + + for guid in created_term_guids: + client.purge_entity_by_guid(guid=guid) def test_register_client_with_bad_parameter_raises_valueerror(): @@ -13,3 +73,149 @@ def test_register_client(): client = AtlanClient(base_url="http://mark.atlan.com", api_key="123") AtlanClient.register_client(client) assert AtlanClient.get_default_client() == client + + +def test_append_terms_with_guid( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + term = make_term("Term1") + + assert ( + database := client.append_terms( + guid=database.guid, asset_type=Database, terms=[term] + ) + ) + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 1 + assert database.terms[0].guid == term.guid + + +def test_append_terms_with_qualified_name( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + term = make_term("Term1") + + assert ( + database := client.append_terms( + qualified_name=database.qualified_name, asset_type=Database, terms=[term] + ) + ) + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 1 + assert database.terms[0].guid == term.guid + + +def test_append_terms_using_ref_by_guid_for_term( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + term = make_term("Term1") + + assert ( + database := client.append_terms( + qualified_name=database.qualified_name, + asset_type=Database, + terms=[AtlasGlossaryTerm.ref_by_guid(guid=term.guid)], + ) + ) + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 1 + assert database.terms[0].guid == term.guid + + +def test_replace_a_term( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + original_term = make_term("Term1") + assert ( + database := client.append_terms( + qualified_name=database.qualified_name, + asset_type=Database, + terms=[AtlasGlossaryTerm.ref_by_guid(guid=original_term.guid)], + ) + ) + + replacemant_term = make_term("Term2") + assert ( + database := client.replace_terms( + guid=database.guid, asset_type=Database, terms=[replacemant_term] + ) + ) + + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 2 + deleted_terms = [t for t in database.terms if t.relationship_status == "DELETED"] + assert len(deleted_terms) == 1 + assert deleted_terms[0].guid == original_term.guid + active_terms = [t for t in database.terms if t.relationship_status != "DELETED"] + assert len(active_terms) == 1 + assert active_terms[0].guid == replacemant_term.guid + + +def test_replace_all_term( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + original_term = make_term("Term1") + assert ( + database := client.append_terms( + qualified_name=database.qualified_name, + asset_type=Database, + terms=[AtlasGlossaryTerm.ref_by_guid(guid=original_term.guid)], + ) + ) + + assert ( + database := client.replace_terms( + guid=database.guid, asset_type=Database, terms=[] + ) + ) + + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 1 + deleted_terms = [t for t in database.terms if t.relationship_status == "DELETED"] + assert len(deleted_terms) == 1 + assert deleted_terms[0].guid == original_term.guid + + +def test_remove_term( + client: AtlanClient, + make_term: Callable[[str], AtlasGlossaryTerm], + database: Database, +): + original_term = make_term("Term1") + another_term = make_term("Term2") + assert ( + database := client.append_terms( + qualified_name=database.qualified_name, + asset_type=Database, + terms=[ + AtlasGlossaryTerm.ref_by_guid(guid=original_term.guid), + AtlasGlossaryTerm.ref_by_guid(guid=another_term.guid), + ], + ) + ) + + assert ( + database := client.remove_terms( + guid=database.guid, + asset_type=Database, + terms=[AtlasGlossaryTerm.ref_by_guid(original_term.guid)], + ) + ) + + database = client.get_asset_by_guid(guid=database.guid, asset_type=Database) + assert len(database.terms) == 2 + deleted_terms = [t for t in database.terms if t.relationship_status == "DELETED"] + assert len(deleted_terms) == 1 + assert deleted_terms[0].guid == original_term.guid + active_terms = [t for t in database.terms if t.relationship_status != "DELETED"] + assert active_terms[0].guid == another_term.guid diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py new file mode 100644 index 000000000..7d27ef1cf --- /dev/null +++ b/tests/unit/test_client.py @@ -0,0 +1,315 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2022 Atlan Pte. Ltd. +from unittest.mock import DEFAULT, patch + +import pytest + +from pyatlan.client.atlan import AtlanClient +from pyatlan.model.assets import AtlasGlossaryTerm, Table + + +@pytest.mark.parametrize( + "guid, qualified_name, asset_type, terms, message", + [ + ( + "123", + None, + Table, + None, + "1 validation error for AppendTerms\\nterms\\n none is not an allowed value ", + ), + ( + None, + None, + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified name must be specified", + ), + ( + "123", + None, + None, + [AtlasGlossaryTerm()], + "1 validation error for AppendTerms\\nasset_type\\n none is not an allowed value ", + ), + ( + "123", + "default/abc", + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified_name can be be specified not both", + ), + ], +) +def test_append_terms_with_invalid_parameter_raises_valueerror( + guid, + qualified_name, + asset_type, + terms, + message, + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + client = AtlanClient() + + with pytest.raises(ValueError, match=message): + client.append_terms( + guid=guid, qualified_name=qualified_name, asset_type=asset_type, terms=terms + ) + + +def test_append_with_valid_guid_and_no_terms_returns_asset(monkeypatch): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + table = asset_type() + + with patch.object( + AtlanClient, "get_asset_by_guid", return_value=table + ) as mock_method: + client = AtlanClient() + guid = "123" + terms = [] + + assert ( + client.append_terms(guid=guid, asset_type=asset_type, terms=terms) == table + ) + mock_method.assert_called_once_with(guid=guid, asset_type=asset_type) + + +def test_append_with_valid_guid_when_no_terms_present_returns_asset_with_given_terms( + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + with patch.multiple( + AtlanClient, get_asset_by_guid=DEFAULT, upsert=DEFAULT + ) as mock_methods: + table = Table() + mock_methods["get_asset_by_guid"].return_value = table + mock_methods["upsert"].return_value.assets_updated.return_value = [table] + client = AtlanClient() + guid = "123" + terms = [AtlasGlossaryTerm()] + + assert ( + asset := client.append_terms(guid=guid, asset_type=asset_type, terms=terms) + ) + assert asset.terms == terms + + +def test_append_with_valid_guid_when_deleted_terms_present_returns_asset_with_given_terms( + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + with patch.multiple( + AtlanClient, get_asset_by_guid=DEFAULT, upsert=DEFAULT + ) as mock_methods: + table = Table(attributes=Table.Attributes()) + term = AtlasGlossaryTerm() + term.relationship_status = "DELETED" + table.attributes.meanings = [term] + mock_methods["get_asset_by_guid"].return_value = table + mock_methods["upsert"].return_value.assets_updated.return_value = [table] + client = AtlanClient() + guid = "123" + terms = [AtlasGlossaryTerm()] + + assert ( + asset := client.append_terms(guid=guid, asset_type=asset_type, terms=terms) + ) + assert asset.terms == terms + + +def test_append_with_valid_guid_when_terms_present_returns_asset_with_combined_terms( + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + with patch.multiple( + AtlanClient, get_asset_by_guid=DEFAULT, upsert=DEFAULT + ) as mock_methods: + table = Table(attributes=Table.Attributes()) + exisiting_term = AtlasGlossaryTerm() + table.attributes.meanings = [exisiting_term] + mock_methods["get_asset_by_guid"].return_value = table + mock_methods["upsert"].return_value.assets_updated.return_value = [table] + client = AtlanClient() + guid = "123" + + new_term = AtlasGlossaryTerm() + terms = [new_term] + + assert ( + asset := client.append_terms(guid=guid, asset_type=asset_type, terms=terms) + ) + assert (updated_terms := asset.terms) + assert len(updated_terms) == 2 + assert exisiting_term in updated_terms + assert new_term in updated_terms + + +@pytest.mark.parametrize( + "guid, qualified_name, asset_type, terms, message", + [ + ( + None, + None, + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified name must be specified", + ), + ( + "123", + None, + None, + [AtlasGlossaryTerm()], + "1 validation error for ReplaceTerms\\nasset_type\\n none is not an allowed value ", + ), + ( + "123", + "default/abc", + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified_name can be be specified not both", + ), + ( + "123", + None, + Table, + None, + "1 validation error for ReplaceTerms\\nterms\\n none is not an allowed value ", + ), + ], +) +def test_replace_terms_with_invalid_parameter_raises_valueerror( + guid, + qualified_name, + asset_type, + terms, + message, + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + client = AtlanClient() + + with pytest.raises(ValueError, match=message): + client.replace_terms( + guid=guid, qualified_name=qualified_name, asset_type=asset_type, terms=terms + ) + + +def test_replace_terms( + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + with patch.multiple( + AtlanClient, get_asset_by_guid=DEFAULT, upsert=DEFAULT + ) as mock_methods: + table = Table() + mock_methods["get_asset_by_guid"].return_value = table + mock_methods["upsert"].return_value.assets_updated.return_value = [table] + client = AtlanClient() + guid = "123" + terms = [AtlasGlossaryTerm()] + + assert ( + asset := client.replace_terms(guid=guid, asset_type=asset_type, terms=terms) + ) + assert asset.terms == terms + + +@pytest.mark.parametrize( + "guid, qualified_name, asset_type, terms, message", + [ + ( + None, + None, + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified name must be specified", + ), + ( + "123", + None, + None, + [AtlasGlossaryTerm()], + "1 validation error for RemoveTerms\\nasset_type\\n none is not an allowed value ", + ), + ( + "123", + "default/abc", + Table, + [AtlasGlossaryTerm()], + "Either guid or qualified_name can be be specified not both", + ), + ( + "123", + None, + Table, + None, + "1 validation error for RemoveTerms\\nterms\\n none is not an allowed value ", + ), + ( + "123", + None, + Table, + [], + "A list of terms to remove must be specified", + ), + ], +) +def test_remove_terms_with_invalid_parameter_raises_valueerror( + guid, + qualified_name, + asset_type, + terms, + message, + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + client = AtlanClient() + + with pytest.raises(ValueError, match=message): + client.remove_terms( + guid=guid, qualified_name=qualified_name, asset_type=asset_type, terms=terms + ) + + +def test_remove_with_valid_guid_when_terms_present_returns_asset_with_terms_removed( + monkeypatch, +): + monkeypatch.setenv("ATLAN_BASE_URL", "https://name.atlan.com") + monkeypatch.setenv("ATLAN_API_KEY", "abkj") + asset_type = Table + with patch.multiple( + AtlanClient, get_asset_by_guid=DEFAULT, upsert=DEFAULT + ) as mock_methods: + table = Table(attributes=Table.Attributes()) + exisiting_term = AtlasGlossaryTerm() + exisiting_term.guid = "b4113341-251b-4adc-81fb-2420501c30e6" + other_term = AtlasGlossaryTerm() + other_term.guid = "b267858d-8316-4c41-a56a-6e9b840cef4a" + table.attributes.meanings = [exisiting_term, other_term] + mock_methods["get_asset_by_guid"].return_value = table + mock_methods["upsert"].return_value.assets_updated.return_value = [table] + client = AtlanClient() + guid = "123" + + assert ( + asset := client.remove_terms( + guid=guid, asset_type=asset_type, terms=[exisiting_term] + ) + ) + assert (updated_terms := asset.terms) + assert len(updated_terms) == 1 + assert other_term in updated_terms diff --git a/tests/unit/test_model.py b/tests/unit/test_model.py index b3aab7d5f..db7b1e004 100644 --- a/tests/unit/test_model.py +++ b/tests/unit/test_model.py @@ -132,6 +132,7 @@ "Optional[QuickSightAnalysisStatus]": QuickSightAnalysisStatus.CREATION_FAILED, "Optional[QuickSightDatasetImportMode]": QuickSightDatasetImportMode.SPICE, "Optional[list[KafkaTopicConsumption]]": [KafkaTopicConsumption()], + "list[AtlasGlossaryTerm]": [AtlasGlossaryTerm()], } @@ -1321,7 +1322,7 @@ def test_attributes(clazz, property_name, attribute_value): ) assert attribute_value == local_ns["ret_value"] exec( - f"ret_value = sut.attributes.{property_name}", + f"ret_value = sut.attributes.{property_name if property_name != 'terms' else 'meanings'}", {"sut": sut, "property_name": property_name}, local_ns, )