diff --git a/.vscode/cspell.json b/.vscode/cspell.json index f934b304cb8f..719d9cb3b85b 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -682,37 +682,37 @@ }, { "filename": "sdk/core/azure-core-tracing-opentelemetry/**", - "words": ["ctxt", "somethingstuid"] + "words": [ "ctxt", "somethingstuid" ] }, { "filename": "sdk/cognitivelanguage/azure-ai-language-conversations/**", - "words": ["conv", "summ"], + "words": [ "conv", "summ" ], "caseSensitive": false }, { "filename": "sdk/cognitivelanguage/azure-ai-language-conversations/doc/*.rst", - "words": ["undoc"] + "words": [ "undoc" ] }, { "filename": "sdk/cognitivelanguage/azure-ai-language-conversations/azure/ai/language/conversations/**/_serialization.py", - "words": ["ctxt", "wday", "mday", "astimezone", "unflattened", "JSONify", "deseralize"] + "words": [ "ctxt", "wday", "mday", "astimezone", "unflattened", "JSONify", "deseralize" ] }, { "filename": "sdk/cognitivelanguage/azure-ai-language-questionanswering/**", - "words": ["qnas", "qnamaker", "ADTO"], + "words": [ "qnas", "qnamaker", "ADTO" ], "caseSensitive": false }, { "filename": "sdk/cognitivelanguage/azure-ai-language-questionanswering/tests/test_query_text*.py", - "words": ["groovin", "Olufsen"] + "words": [ "groovin", "Olufsen" ] }, { "filename": "sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/**/_serialization.py", - "words": ["ctxt", "wday", "mday", "astimezone", "unflattened", "JSONify", "deseralize"] + "words": [ "ctxt", "wday", "mday", "astimezone", "unflattened", "JSONify", "deseralize" ] }, { "filename": "sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/tests/*.py", - "words": ["Apim", "cognituve"] + "words": [ "Apim", "cognituve" ] }, { "filename": "sdk/communication/**", @@ -1110,7 +1110,7 @@ }, { "filename": "sdk/loadtestservice/azure-developer-loadtesting/azure/developer/loadtesting/**", - "words":[ + "words": [ "vusers" ] }, @@ -1275,7 +1275,7 @@ }, { "filename": "sdk/attestation/azure-security-attestation/tests/conftest.py", - "words":[ + "words": [ "sharedwus" ] }, @@ -1303,8 +1303,8 @@ "resouce", "nnumeral" ] - }, - { + }, + { "filename": "sdk/storage/azure-storage-file-share/**", "words": [ "XSMB", @@ -1498,7 +1498,7 @@ "jsonify", "ints", "inirudebwoy", - "mghextreme" + "mghextreme" ] }, { @@ -1649,8 +1649,8 @@ "Nify", "ctxt", "unflattened", - "deseralize", - "wday" + "deseralize", + "wday" ] }, { @@ -1709,6 +1709,16 @@ "wday" ] }, + { + "filename": "sdk/purview/azure-purview-datamap/azure/purview/datamap/*.py", + "words": [ + "mros", + "Nify", + "deserializers", + "ctxt", + "wday" + ] + }, { "filename": "sdk/healthinsights/azure-healthinsights-radiologyinsights/**", "words": [ diff --git a/sdk/purview/azure-purview-datamap/CHANGELOG.md b/sdk/purview/azure-purview-datamap/CHANGELOG.md new file mode 100644 index 000000000000..8f2b22b47deb --- /dev/null +++ b/sdk/purview/azure-purview-datamap/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (2024-03-05) + +- Initial version for Purview DataMap diff --git a/sdk/purview/azure-purview-datamap/LICENSE b/sdk/purview/azure-purview-datamap/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/purview/azure-purview-datamap/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/MANIFEST.in b/sdk/purview/azure-purview-datamap/MANIFEST.in new file mode 100644 index 000000000000..70ec06cdfc26 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include azure/purview/datamap/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/purview/__init__.py \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/README.md b/sdk/purview/azure-purview-datamap/README.md new file mode 100644 index 000000000000..6d9e8a389c46 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/README.md @@ -0,0 +1,92 @@ +# Azure Purview Datamap client library for Python +Microsoft Purview Data Map provides the foundation for data discovery and data governance. Microsoft Purview Data Map is a cloud native PaaS service that captures metadata about enterprise data present in analytics and operation systems on-premises and cloud. DataMapClient provides a set of APIs in the Purview Data Map service. For a full list of APIs, please refer to [Data Map API](https://learn.microsoft.com/rest/api/purview/datamapdataplane/operation-groups?view=rest-purview-datamapdataplane-2023-09-01). + +## Getting started + +### Installing the package + +```bash +python -m pip install azure-purview-datamap +``` + +#### Prequisites + +- Python 3.8 or later is required to use this package. +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Azure Purview Datamap instance. +#### Create with an Azure Active Directory Credential +To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], +provide an instance of the desired credential type obtained from the +[azure-identity][azure_identity_credentials] library. + +To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] + +After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. +As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: + +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` + +Use the returned token credential to authenticate the client: + +```python +>>> from azure.purview.datamap import DataMapClient +>>> from azure.identity import DefaultAzureCredential +>>> client = DataMapClient(endpoint='', credential=DefaultAzureCredential()) +``` + +## Key concepts + +### Client + +This package offers request builders so you can build http requests and send these requests to the service using the `send_request` method. +For more information on how to use request builders and our clients, see [here][request_builders_and_client]. + +## Examples + +```python +>>> from azure.purview.datamap import DataMapClient +>>> from azure.identity import DefaultAzureCredential +>>> from azure.core.exceptions import HttpResponseError + +>>> client = DataMapClient(endpoint='', credential=DefaultAzureCredential()) +>>> try: + client.type_definition.get() + except HttpResponseError as e: + print('service responds error: {}'.format(e.response.json())) + +``` + +## Troubleshooting + +## Next steps + +For more generic samples, see our [client docs][request_builders_and_client]. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, +see the Code of Conduct FAQ or contact opencode@microsoft.com with any +additional questions or comments. + + +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials +[azure_identity_pip]: https://pypi.org/project/azure-identity/ +[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential +[request_builders_and_client]: https://aka.ms/azsdk/python/protocol/quickstart +[pip]: https://pypi.org/project/pip/ +[azure_sub]: https://azure.microsoft.com/free/ + diff --git a/sdk/purview/azure-purview-datamap/assets.json b/sdk/purview/azure-purview-datamap/assets.json new file mode 100644 index 000000000000..aac5463e42ac --- /dev/null +++ b/sdk/purview/azure-purview-datamap/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "python", + "TagPrefix": "python/purview/azure-purview-datamap", + "Tag": "python/purview/azure-purview-datamap_3f980f3fd6" +} diff --git a/sdk/purview/azure-purview-datamap/azure/__init__.py b/sdk/purview/azure-purview-datamap/azure/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/purview/azure-purview-datamap/azure/purview/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/__init__.py new file mode 100644 index 000000000000..eb84dde7b903 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import DataMapClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataMapClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_client.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_client.py new file mode 100644 index 000000000000..4dac6f59e70b --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_client.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core import PipelineClient +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse + +from ._configuration import DataMapClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import ( + DiscoveryOperations, + EntityOperations, + GlossaryOperations, + LineageOperations, + RelationshipOperations, + TypeDefinitionOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class DataMapClient: # pylint: disable=client-accepts-api-version-keyword + """DataMapClient. + + :ivar entity: EntityOperations operations + :vartype entity: azure.purview.datamap.operations.EntityOperations + :ivar glossary: GlossaryOperations operations + :vartype glossary: azure.purview.datamap.operations.GlossaryOperations + :ivar discovery: DiscoveryOperations operations + :vartype discovery: azure.purview.datamap.operations.DiscoveryOperations + :ivar lineage: LineageOperations operations + :vartype lineage: azure.purview.datamap.operations.LineageOperations + :ivar relationship: RelationshipOperations operations + :vartype relationship: azure.purview.datamap.operations.RelationshipOperations + :ivar type_definition: TypeDefinitionOperations operations + :vartype type_definition: azure.purview.datamap.operations.TypeDefinitionOperations + :param endpoint: Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Known values are "2023-09-01" + and None. Default value is "2023-09-01". Note that overriding this default value may result in + unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + _endpoint = "{endpoint}/datamap/api" + self._config = DataMapClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.entity = EntityOperations(self._client, self._config, self._serialize, self._deserialize) + self.glossary = GlossaryOperations(self._client, self._config, self._serialize, self._deserialize) + self.discovery = DiscoveryOperations(self._client, self._config, self._serialize, self._deserialize) + self.lineage = LineageOperations(self._client, self._config, self._serialize, self._deserialize) + self.relationship = RelationshipOperations(self._client, self._config, self._serialize, self._deserialize) + self.type_definition = TypeDefinitionOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "DataMapClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_configuration.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_configuration.py new file mode 100644 index 000000000000..1084d8ba9649 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class DataMapClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for DataMapClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Known values are "2023-09-01" + and None. Default value is "2023-09-01". Note that overriding this default value may result in + unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2023-09-01") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://purview.azure.net/.default"]) + kwargs.setdefault("sdk_moniker", "purview-datamap/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_model_base.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_model_base.py new file mode 100644 index 000000000000..1ddc071517d6 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_model_base.py @@ -0,0 +1,874 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except + +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import copy +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] # pylint: disable=protected-access + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = copy.deepcopy(data) + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: + ... + + @typing.overload + def pop(self, key: str, default: _T) -> _T: + ... + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: + ... + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + return self._data.popitem() + + def clear(self) -> None: + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: + ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: + ... + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + # we know the last three classes in mro are going to be 'Model', 'dict', and 'object' + mros = cls.__mro__[:-3][::-1] # ignore model, dict, and object parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + + return super().__new__(cls) # pylint: disable=no-value-for-parameter + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): # pylint: disable=no-member + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: + for v in cls.__dict__.values(): + if ( + isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators + ): # pylint: disable=protected-access + return v._rest_name # pylint: disable=protected-access + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + exist_discriminators.append(discriminator) + mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pyright: ignore # pylint: disable=no-member + if mapped_cls == cls: + return cls(data) + return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be JSONify using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation or annotation in [int, float]: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + except AttributeError: + pass + + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in sorted( + annotation.__args__, key=lambda x: hasattr(x, "__name__") and x.__name__ == "str" # pyright: ignore + ) + ] + + def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + obj: typing.Dict[typing.Any, typing.Any], + ): + if obj is None: + return obj + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + return functools.partial( + _deserialize_dict, + value_deserializer, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + + def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + obj, + ): + if obj is None: + return obj + return type(obj)( + _deserialize(deserializer, entry, module) + for entry, deserializer in zip(obj, entry_deserializers) + ) + + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + obj, + ): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + return functools.partial(_deserialize_sequence, deserializer) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): + try: + if value is None or isinstance(value, _Null): + return None + if deserializer is None: + return value + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_patch.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_serialization.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_serialization.py new file mode 100644 index 000000000000..2f781d740827 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_serialization.py @@ -0,0 +1,1998 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + else: + return date_obj diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_vendor.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_vendor.py new file mode 100644 index 000000000000..ab863f3898ef --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_vendor.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import json +from typing import Any, Dict, IO, List, Mapping, Optional, Sequence, Tuple, Union + +from ._model_base import Model, SdkJSONEncoder + + +# file-like tuple could be `(filename, IO (or bytes))` or `(filename, IO (or bytes), content_type)` +FileContent = Union[str, bytes, IO[str], IO[bytes]] + +FileType = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], +] + +FilesType = Union[Mapping[str, FileType], Sequence[Tuple[str, FileType]]] + + +def serialize_multipart_data_entry(data_entry: Any) -> Any: + if isinstance(data_entry, (list, tuple, dict, Model)): + return json.dumps(data_entry, cls=SdkJSONEncoder, exclude_readonly=True) + return data_entry + + +def prepare_multipart_form_data( + body: Mapping[str, Any], multipart_fields: List[str], data_fields: List[str] +) -> Tuple[List[FileType], Dict[str, Any]]: + files: List[FileType] = [] + data: Dict[str, Any] = {} + for multipart_field in multipart_fields: + multipart_entry = body.get(multipart_field) + if isinstance(multipart_entry, list): + files.extend([(multipart_field, e) for e in multipart_entry]) + elif multipart_entry: + files.append((multipart_field, multipart_entry)) + + for data_field in data_fields: + data_entry = body.get(data_field) + if data_entry: + data[data_field] = serialize_multipart_data_entry(data_entry) + + return files, data diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/_version.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_version.py new file mode 100644 index 000000000000..be71c81bd282 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/__init__.py new file mode 100644 index 000000000000..1a94f3a4925f --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import DataMapClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataMapClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_client.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_client.py new file mode 100644 index 000000000000..f6ff86ec1c34 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_client.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core import AsyncPipelineClient +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest + +from .._serialization import Deserializer, Serializer +from ._configuration import DataMapClientConfiguration +from .operations import ( + DiscoveryOperations, + EntityOperations, + GlossaryOperations, + LineageOperations, + RelationshipOperations, + TypeDefinitionOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DataMapClient: # pylint: disable=client-accepts-api-version-keyword + """DataMapClient. + + :ivar entity: EntityOperations operations + :vartype entity: azure.purview.datamap.aio.operations.EntityOperations + :ivar glossary: GlossaryOperations operations + :vartype glossary: azure.purview.datamap.aio.operations.GlossaryOperations + :ivar discovery: DiscoveryOperations operations + :vartype discovery: azure.purview.datamap.aio.operations.DiscoveryOperations + :ivar lineage: LineageOperations operations + :vartype lineage: azure.purview.datamap.aio.operations.LineageOperations + :ivar relationship: RelationshipOperations operations + :vartype relationship: azure.purview.datamap.aio.operations.RelationshipOperations + :ivar type_definition: TypeDefinitionOperations operations + :vartype type_definition: azure.purview.datamap.aio.operations.TypeDefinitionOperations + :param endpoint: Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Known values are "2023-09-01" + and None. Default value is "2023-09-01". Note that overriding this default value may result in + unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + _endpoint = "{endpoint}/datamap/api" + self._config = DataMapClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.entity = EntityOperations(self._client, self._config, self._serialize, self._deserialize) + self.glossary = GlossaryOperations(self._client, self._config, self._serialize, self._deserialize) + self.discovery = DiscoveryOperations(self._client, self._config, self._serialize, self._deserialize) + self.lineage = LineageOperations(self._client, self._config, self._serialize, self._deserialize) + self.relationship = RelationshipOperations(self._client, self._config, self._serialize, self._deserialize) + self.type_definition = TypeDefinitionOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DataMapClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_configuration.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_configuration.py new file mode 100644 index 000000000000..8f67d155f7df --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class DataMapClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for DataMapClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Known values are "2023-09-01" + and None. Default value is "2023-09-01". Note that overriding this default value may result in + unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2023-09-01") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://purview.azure.net/.default"]) + kwargs.setdefault("sdk_moniker", "purview-datamap/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_patch.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/__init__.py new file mode 100644 index 000000000000..f87703413c74 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import EntityOperations +from ._operations import GlossaryOperations +from ._operations import DiscoveryOperations +from ._operations import LineageOperations +from ._operations import RelationshipOperations +from ._operations import TypeDefinitionOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EntityOperations", + "GlossaryOperations", + "DiscoveryOperations", + "LineageOperations", + "RelationshipOperations", + "TypeDefinitionOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py new file mode 100644 index 000000000000..3d3e3db3b6ae --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py @@ -0,0 +1,45102 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import _model_base, models as _models +from ..._model_base import SdkJSONEncoder, _deserialize +from ..._vendor import prepare_multipart_form_data +from ...operations._operations import ( + build_discovery_auto_complete_request, + build_discovery_query_request, + build_discovery_suggest_request, + build_entity_add_classification_request, + build_entity_add_classifications_by_unique_attribute_request, + build_entity_add_classifications_request, + build_entity_add_label_request, + build_entity_add_labels_by_unique_attribute_request, + build_entity_add_or_update_business_metadata_attributes_request, + build_entity_add_or_update_business_metadata_request, + build_entity_batch_create_or_update_request, + build_entity_batch_delete_request, + build_entity_batch_get_by_unique_attributes_request, + build_entity_batch_set_classifications_request, + build_entity_create_or_update_request, + build_entity_delete_by_unique_attribute_request, + build_entity_delete_request, + build_entity_get_business_metadata_template_request, + build_entity_get_by_ids_request, + build_entity_get_by_unique_attribute_request, + build_entity_get_classification_request, + build_entity_get_classifications_request, + build_entity_get_header_request, + build_entity_get_request, + build_entity_import_business_metadata_request, + build_entity_move_entities_to_collection_request, + build_entity_remove_business_metadata_attributes_request, + build_entity_remove_business_metadata_request, + build_entity_remove_classification_by_unique_attribute_request, + build_entity_remove_classification_request, + build_entity_remove_labels_by_unique_attribute_request, + build_entity_remove_labels_request, + build_entity_set_labels_by_unique_attribute_request, + build_entity_set_labels_request, + build_entity_update_attribute_by_id_request, + build_entity_update_by_unique_attribute_request, + build_entity_update_classifications_request, + build_entity_update_classifications_unique_by_attribute_request, + build_glossary_assign_term_to_entities_request, + build_glossary_batch_get_request, + build_glossary_create_categories_request, + build_glossary_create_category_request, + build_glossary_create_request, + build_glossary_create_term_request, + build_glossary_create_terms_request, + build_glossary_delete_category_request, + build_glossary_delete_request, + build_glossary_delete_term_assignment_from_entities_request, + build_glossary_delete_term_request, + build_glossary_get_categories_headers_request, + build_glossary_get_categories_request, + build_glossary_get_category_request, + build_glossary_get_category_terms_request, + build_glossary_get_detailed_request, + build_glossary_get_entities_assigned_with_term_request, + build_glossary_get_related_categories_request, + build_glossary_get_related_terms_request, + build_glossary_get_request, + build_glossary_get_term_headers_request, + build_glossary_get_term_request, + build_glossary_get_terms_request, + build_glossary_partial_update_category_request, + build_glossary_partial_update_request, + build_glossary_partial_update_term_request, + build_glossary_update_category_request, + build_glossary_update_request, + build_glossary_update_term_request, + build_lineage_get_by_unique_attribute_request, + build_lineage_get_next_page_request, + build_lineage_get_request, + build_relationship_create_request, + build_relationship_delete_request, + build_relationship_get_request, + build_relationship_update_request, + build_type_definition_batch_create_request, + build_type_definition_batch_delete_request, + build_type_definition_batch_update_request, + build_type_definition_delete_request, + build_type_definition_get_business_metadata_by_id_request, + build_type_definition_get_business_metadata_by_name_request, + build_type_definition_get_by_id_request, + build_type_definition_get_by_name_request, + build_type_definition_get_classification_by_id_request, + build_type_definition_get_classification_by_name_request, + build_type_definition_get_entity_by_id_request, + build_type_definition_get_entity_by_name_request, + build_type_definition_get_enum_by_id_request, + build_type_definition_get_enum_by_name_request, + build_type_definition_get_headers_request, + build_type_definition_get_relationship_by_id_request, + build_type_definition_get_relationship_by_name_request, + build_type_definition_get_request, + build_type_definition_get_struct_by_id_request, + build_type_definition_get_struct_by_name_request, + build_type_definition_get_term_template_by_id_request, + build_type_definition_get_term_template_by_name_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class EntityOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`entity` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def create_or_update( + self, + body: _models.AtlasEntityWithExtInfo, + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def create_or_update( + self, + body: JSON, + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: JSON + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def create_or_update( + self, + body: IO[bytes], + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: IO[bytes] + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace_async + async def create_or_update( + self, + body: Union[_models.AtlasEntityWithExtInfo, JSON, IO[bytes]], + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Is one of the following types: AtlasEntityWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo or JSON or IO[bytes] + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_create_or_update_request( + business_attribute_update_behavior=business_attribute_update_behavior, + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_ids( + self, + *, + guid: List[str], + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasEntitiesWithExtInfo: + # pylint: disable=line-too-long + """List entities in bulk identified by its GUIDs. + + :keyword guid: An array of GUIDs of entities to list. Required. + :paramtype guid: list[str] + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :return: AtlasEntitiesWithExtInfo. The AtlasEntitiesWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntitiesWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_by_ids_request( + guid=guid, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntitiesWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def batch_create_or_update( + self, + body: _models.AtlasEntitiesWithExtInfo, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def batch_create_or_update( + self, + body: JSON, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: JSON + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def batch_create_or_update( + self, + body: IO[bytes], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace_async + async def batch_create_or_update( + self, + body: Union[_models.AtlasEntitiesWithExtInfo, JSON, IO[bytes]], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Is one of the following types: AtlasEntitiesWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo or JSON or IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_batch_create_or_update_request( + collection_id=collection_id, + business_attribute_update_behavior=business_attribute_update_behavior, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def batch_delete(self, *, guid: List[str], **kwargs: Any) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete a list of entities in bulk identified by their GUIDs or unique + attributes. + + :keyword guid: An array of GUIDs of entities to delete. Required. + :paramtype guid: list[str] + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_batch_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def add_classification( # pylint: disable=inconsistent-return-statements + self, body: _models.ClassificationAssociateOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.ClassificationAssociateOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "classification": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + }, + "entityGuids": [ + "str" # Optional. The GUID of the entity. + ] + } + """ + + @overload + async def add_classification( # pylint: disable=inconsistent-return-statements + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def add_classification( # pylint: disable=inconsistent-return-statements + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_classification( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClassificationAssociateOptions, JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param body: Is one of the following types: ClassificationAssociateOptions, JSON, IO[bytes] + Required. + :type body: ~azure.purview.datamap.models.ClassificationAssociateOptions or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "classification": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + }, + "entityGuids": [ + "str" # Optional. The GUID of the entity. + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classification_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get( + self, + guid: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasEntityWithExtInfo: + # pylint: disable=line-too-long + """Get complete definition of an entity given its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :return: AtlasEntityWithExtInfo. The AtlasEntityWithExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_request( + guid=guid, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def update_attribute_by_id( + self, guid: str, body: Any, *, name: str, **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - create or update entity attribute identified by its + GUID. + Supports only primitive attribute type and entity references. + It does not support updating complex types like arrays, and maps. + Null updates are not possible. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: The value of the attribute. Required. + :type body: any + :keyword name: The name of the attribute. Required. + :paramtype name: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_attribute_by_id_request( + guid=guid, + name=name, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, guid: str, **kwargs: Any) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete an entity identified by its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_classification( + self, guid: str, classification_name: str, **kwargs: Any + ) -> _models.AtlasClassification: + # pylint: disable=line-too-long + """Get classification for a given entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :return: AtlasClassification. The AtlasClassification is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassification + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time boundary. + "startTime": "str", # Optional. The start of the time + boundary. + "timeZone": "str" # Optional. The timezone of the time + boundary. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassification] = kwargs.pop("cls", None) + + _request = build_entity_get_classification_request( + guid=guid, + classification_name=classification_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassification, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def remove_classification( # pylint: disable=inconsistent-return-statements + self, guid: str, classification_name: str, **kwargs: Any + ) -> None: + """Delete a given classification from an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_entity_remove_classification_request( + guid=guid, + classification_name=classification_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_classifications(self, guid: str, **kwargs: Any) -> _models.AtlasClassifications: + # pylint: disable=line-too-long + """List classifications for a given entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasClassifications. The AtlasClassifications is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassifications + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "list": [ + {} # Optional. An array of objects. + ], + "pageSize": 0, # Optional. The size of the page. + "sortBy": "str", # Optional. The sorted by field. + "sortType": "str", # Optional. to specify whether the result should be + sorted? If yes, whether asc or desc. Known values are: "NONE", "ASC", and "DESC". + "startIndex": 0, # Optional. The start index of the page. + "totalCount": 0 # Optional. The total count of items. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassifications] = kwargs.pop("cls", None) + + _request = build_entity_get_classifications_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassifications, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def add_classifications( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: List[_models.AtlasClassification], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + async def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[List[_models.AtlasClassification], IO[bytes]], **kwargs: Any + ) -> None: + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Is either a [AtlasClassification] type or + a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classifications_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def update_classifications( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: List[_models.AtlasClassification], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + async def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[List[_models.AtlasClassification], IO[bytes]], **kwargs: Any + ) -> None: + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Is either a [AtlasClassification] type + or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_classifications_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_by_unique_attribute( + self, + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasEntityWithExtInfo: + # pylint: disable=line-too-long + """Get complete definition of an entity given its type and unique attribute. + + In + addition to the typeName path parameter, attribute key-value pair(s) can be + provided in the following format: + attr:\:code:``=:code:``. + + NOTE: The + attrName and attrValue should be unique across entities, eg. + qualifiedName. + + The REST request would look something like this: + GET + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: AtlasEntityWithExtInfo. The AtlasEntityWithExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_by_unique_attribute_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_by_unique_attribute( + self, + type_name: str, + body: _models.AtlasEntityWithExtInfo, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def update_by_unique_attribute( + self, + type_name: str, + body: JSON, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: JSON + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def update_by_unique_attribute( + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace_async + async def update_by_unique_attribute( + self, + type_name: str, + body: Union[_models.AtlasEntityWithExtInfo, JSON, IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Is one of the following types: AtlasEntityWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo or JSON or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_by_unique_attribute( + self, type_name: str, *, attribute: Optional[str] = None, **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete an entity identified by its type and unique attributes. + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + attr:\:code:``=\:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_delete_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def remove_classification_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, type_name: str, classification_name: str, *, attribute: Optional[str] = None, **kwargs: Any + ) -> None: + """Delete a given classification from an entity identified by its type and unique + attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_entity_remove_classification_by_unique_attribute_request( + type_name=type_name, + classification_name=classification_name, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: List[_models.AtlasClassification], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + async def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Union[List[_models.AtlasClassification], IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Is either a [AtlasClassification] type or + a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classifications_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: List[_models.AtlasClassification], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + async def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: Union[List[_models.AtlasClassification], IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Is either a [AtlasClassification] type + or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_classifications_unique_by_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def batch_set_classifications( + self, body: _models.AtlasEntityHeaders, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityHeaders + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "guidHeaderMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + } + } + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @overload + async def batch_set_classifications( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @overload + async def batch_set_classifications( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @distributed_trace_async + async def batch_set_classifications( + self, body: Union[_models.AtlasEntityHeaders, JSON, IO[bytes]], **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param body: Is one of the following types: AtlasEntityHeaders, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityHeaders or JSON or IO[bytes] + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "guidHeaderMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + } + } + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_batch_set_classifications_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[str], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def batch_get_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attr_n_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasEntitiesWithExtInfo: + # pylint: disable=line-too-long + """Bulk API to retrieve list of entities identified by its unique attributes. + In + addition to the typeName path parameter, attribute key-value pair(s) can be + provided in the following + format + + typeName=\:code:``&attr_1:\:code:``=\:code:``&attr_2:\:code:``=\:code:``&attr_3:\:code:``=\:code:`` + + NOTE: + The attrName should be an unique attribute for the given entity-type. + The REST + request would look something like this + + GET + /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1 + + Note: + at least one unique attribute must be provided. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :keyword attr_n_qualified_name: Qualified name of an entity. E.g. to find 2 entities you can + set + attrs_1:qualifiedName=db1@cl1&attrs_2:qualifiedName=db2@cl1. (This is only an + example. qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_n_qualified_name: str + :return: AtlasEntitiesWithExtInfo. The AtlasEntitiesWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntitiesWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_batch_get_by_unique_attributes_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attr_n_qualified_name=attr_n_qualified_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntitiesWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_header(self, guid: str, **kwargs: Any) -> _models.AtlasEntityHeader: + # pylint: disable=line-too-long + """Get entity header given its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasEntityHeader. The AtlasEntityHeader is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityHeader + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the term + assignment. + "createdBy": "str", # Optional. The user who created the + record. + "description": "str", # Optional. The description of the + term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term + assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms assignment. + Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", "VALIDATED", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str" # Optional. The name of the type. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityHeader] = kwargs.pop("cls", None) + + _request = build_entity_get_header_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityHeader, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Dict[str, Dict[str, Any]], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Required. + :type body: dict[str, dict[str, any]] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": { + "str": {} # Optional. + } + } + """ + + @overload + async def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[Dict[str, Dict[str, Any]], IO[bytes]], **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Is either a {str: {str: Any}} type or a IO[bytes] type. + Required. + :type body: dict[str, dict[str, any]] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_remove_business_metadata_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: Dict[str, Dict[str, Any]], + *, + overwrite: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Required. + :type body: dict[str, dict[str, any]] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": { + "str": {} # Optional. + } + } + """ + + @overload + async def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: IO[bytes], + *, + overwrite: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Required. + :type body: IO[bytes] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: Union[Dict[str, Dict[str, Any]], IO[bytes]], + *, + overwrite: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Is either a {str: {str: Any}} type or a IO[bytes] type. + Required. + :type body: dict[str, dict[str, any]] or IO[bytes] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_or_update_business_metadata_request( + guid=guid, + overwrite=overwrite, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + business_metadata_name: str, + guid: str, + body: Dict[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": {} # Optional. + } + """ + + @overload + async def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + business_metadata_name: str, + guid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, business_metadata_name: str, guid: str, body: Union[Dict[str, Any], IO[bytes]], **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Is either a {str: Any} type or a IO[bytes] + type. Required. + :type body: dict[str, any] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_remove_business_metadata_attributes_request( + business_metadata_name=business_metadata_name, + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + business_metadata_name: str, + guid: str, + body: Dict[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": {} # Optional. + } + """ + + @overload + async def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + business_metadata_name: str, + guid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, business_metadata_name: str, guid: str, body: Union[Dict[str, Any], IO[bytes]], **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Is either a {str: Any} type or a IO[bytes] + type. Required. + :type body: dict[str, any] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_or_update_business_metadata_attributes_request( + business_metadata_name=business_metadata_name, + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_business_metadata_template(self, **kwargs: Any) -> bytes: + """Get the sample Template for uploading/creating bulk BusinessMetaData. + + :return: bytes + :rtype: bytes + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[bytes] = kwargs.pop("cls", None) + + _request = build_entity_get_business_metadata_template_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = await response.read() + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def import_business_metadata( + self, body: _models.BusinessMetadataOptions, **kwargs: Any + ) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Required. + :type body: ~azure.purview.datamap.models.BusinessMetadataOptions + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file": filetype + } + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + + @overload + async def import_business_metadata(self, body: JSON, **kwargs: Any) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Required. + :type body: JSON + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + + @distributed_trace_async + async def import_business_metadata( + self, body: Union[_models.BusinessMetadataOptions, JSON], **kwargs: Any + ) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Is either a BusinessMetadataOptions type or a JSON type. Required. + :type body: ~azure.purview.datamap.models.BusinessMetadataOptions or JSON + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file": filetype + } + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.BulkImportResult] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["file"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_entity_import_business_metadata_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.BulkImportResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_remove_labels_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Is either a [str] type or a IO[bytes] type. + Default value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_set_labels_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_add_label_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_remove_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Is either a [str] type or a IO[bytes] type. Default value + is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_set_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + async def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_add_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def move_entities_to_collection( + self, + body: _models.MoveEntitiesOptions, + *, + collection_id: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: ~azure.purview.datamap.models.MoveEntitiesOptions + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entityGuids": [ + "str" # Optional. An array of entity guids to be moved to target + collection. + ] + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def move_entities_to_collection( + self, body: JSON, *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: JSON + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + async def move_entities_to_collection( + self, body: IO[bytes], *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace_async + async def move_entities_to_collection( + self, body: Union[_models.MoveEntitiesOptions, JSON, IO[bytes]], *, collection_id: str, **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Is one of the following types: MoveEntitiesOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.MoveEntitiesOptions or JSON or IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entityGuids": [ + "str" # Optional. An array of entity guids to be moved to target + collection. + ] + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_move_entities_to_collection_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GlossaryOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`glossary` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def batch_get( + self, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossary]: + # pylint: disable=line-too-long + """Get all glossaries. Recommend using limit/offset to get pagination result. + Recommend using 'ignoreTermsAndCategories=true' and fetch terms/categories + separately using + + 'GET /datamap/api/atlas/v2/glossary/{glossaryId}/terms' + and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryId}/categories'. + + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: list of AtlasGlossary + :rtype: list[~azure.purview.datamap.models.AtlasGlossary] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossary]] = kwargs.pop("cls", None) + + _request = build_glossary_batch_get_request( + limit=limit, + offset=offset, + sort=sort, + ignore_terms_and_categories=ignore_terms_and_categories, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossary], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, body: _models.AtlasGlossary, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + async def create( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + async def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace_async + async def create(self, body: Union[_models.AtlasGlossary, JSON, IO[bytes]], **kwargs: Any) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Is one of the following types: AtlasGlossary, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary or JSON or IO[bytes] + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_categories( + self, body: List[_models.AtlasGlossaryCategory], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + + @overload + async def create_categories( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + + @distributed_trace_async + async def create_categories( + self, body: Union[List[_models.AtlasGlossaryCategory], IO[bytes]], **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Is either a + [AtlasGlossaryCategory] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryCategory] or IO[bytes] + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.AtlasGlossaryCategory]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_categories_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryCategory], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_category( + self, body: _models.AtlasGlossaryCategory, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + async def create_category( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + async def create_category( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace_async + async def create_category( + self, body: Union[_models.AtlasGlossaryCategory, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Is one of the following types: AtlasGlossaryCategory, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory or JSON or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_category_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_category(self, category_id: str, **kwargs: Any) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Get specific glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_request( + category_id=category_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_category( + self, + category_id: str, + body: _models.AtlasGlossaryCategory, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + async def update_category( + self, category_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + async def update_category( + self, category_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace_async + async def update_category( + self, category_id: str, body: Union[_models.AtlasGlossaryCategory, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Is one of the following types: AtlasGlossaryCategory, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory or JSON or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_category_request( + category_id=category_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_category( # pylint: disable=inconsistent-return-statements + self, category_id: str, **kwargs: Any + ) -> None: + """Delete a glossary category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_category_request( + category_id=category_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def partial_update_category( + self, category_id: str, body: Dict[str, str], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Required. + :type body: dict[str, str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + async def partial_update_category( + self, category_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace_async + async def partial_update_category( + self, category_id: str, body: Union[Dict[str, str], IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_category_request( + category_id=category_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_related_categories( + self, + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> Dict[str, List[_models.AtlasRelatedCategoryHeader]]: + """Get all related categories (parent and children). Limit, offset, and sort + parameters are currently not being enabled and won't work even they are passed. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: dict mapping str to list of AtlasRelatedCategoryHeader + :rtype: dict[str, list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader]] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "str": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Dict[str, List[_models.AtlasRelatedCategoryHeader]]] = kwargs.pop("cls", None) + + _request = build_glossary_get_related_categories_request( + category_id=category_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(Dict[str, List[_models.AtlasRelatedCategoryHeader]], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_category_terms( + self, + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedTermHeader]: + # pylint: disable=line-too-long + """Get all terms associated with the specific category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedTermHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "description": "str", # Optional. The description of the related + term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the relationship. + "status": "str", # Optional. The status of term relationship. Known + values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedTermHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_terms_request( + category_id=category_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedTermHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_term( + self, + body: _models.AtlasGlossaryTerm, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + async def create_term( + self, + body: JSON, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + async def create_term( + self, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace_async + async def create_term( + self, + body: Union[_models.AtlasGlossaryTerm, JSON, IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Is one of the following types: AtlasGlossaryTerm, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm or JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_term_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_term(self, term_id: str, **kwargs: Any) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Get a specific glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_request( + term_id=term_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_term( + self, + term_id: str, + body: _models.AtlasGlossaryTerm, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + async def update_term( + self, + term_id: str, + body: JSON, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + async def update_term( + self, + term_id: str, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace_async + async def update_term( + self, + term_id: str, + body: Union[_models.AtlasGlossaryTerm, JSON, IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Is one of the following types: AtlasGlossaryTerm, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm or JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_term_request( + term_id=term_id, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_term(self, term_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a glossary term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_term_request( + term_id=term_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def partial_update_term( + self, + term_id: str, + body: Dict[str, str], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Required. + :type body: dict[str, str] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + async def partial_update_term( + self, + term_id: str, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace_async + async def partial_update_term( + self, + term_id: str, + body: Union[Dict[str, str], IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_term_request( + term_id=term_id, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_terms( + self, + body: List[_models.AtlasGlossaryTerm], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + + @overload + async def create_terms( + self, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + + @distributed_trace_async + async def create_terms( + self, + body: Union[List[_models.AtlasGlossaryTerm], IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Is either a + [AtlasGlossaryTerm] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryTerm] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.AtlasGlossaryTerm]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_terms_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryTerm], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_entities_assigned_with_term( + self, + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedObjectId]: + # pylint: disable=line-too-long + """List all related objects assigned with the specified term. Recommend using + limit/offset to get pagination result. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedObjectId + :rtype: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedObjectId]] = kwargs.pop("cls", None) + + _request = build_glossary_get_entities_assigned_with_term_request( + term_id=term_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedObjectId], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, + term_id: str, + body: List[_models.AtlasRelatedObjectId], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + + @overload + async def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: Union[List[_models.AtlasRelatedObjectId], IO[bytes]], **kwargs: Any + ) -> None: + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Is either a + [AtlasRelatedObjectId] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_assign_term_to_entities_request( + term_id=term_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, + term_id: str, + body: List[_models.AtlasRelatedObjectId], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. + Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + + @overload + async def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. + Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: Union[List[_models.AtlasRelatedObjectId], IO[bytes]], **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. Is + either a [AtlasRelatedObjectId] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_delete_term_assignment_from_entities_request( + term_id=term_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_related_terms( + self, + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> Dict[str, List[_models.AtlasRelatedTermHeader]]: + # pylint: disable=line-too-long + """Get all related terms for a specific term by its GUID. Limit, offset, and sort + parameters are currently not being enabled and won't work even they are passed. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: dict mapping str to list of AtlasRelatedTermHeader + :rtype: dict[str, list[~azure.purview.datamap.models.AtlasRelatedTermHeader]] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "str": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Dict[str, List[_models.AtlasRelatedTermHeader]]] = kwargs.pop("cls", None) + + _request = build_glossary_get_related_terms_request( + term_id=term_id, + limit=limit, + offset=offset, + sort=sort, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(Dict[str, List[_models.AtlasRelatedTermHeader]], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, glossary_id: str, **kwargs: Any) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Get a specific Glossary by its GUID. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + _request = build_glossary_get_request( + glossary_id=glossary_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + glossary_id: str, + body: _models.AtlasGlossary, + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + async def update( + self, + glossary_id: str, + body: JSON, + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + async def update( + self, + glossary_id: str, + body: IO[bytes], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace_async + async def update( + self, + glossary_id: str, + body: Union[_models.AtlasGlossary, JSON, IO[bytes]], + *, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Is one of the following types: AtlasGlossary, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary or JSON or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_request( + glossary_id=glossary_id, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, glossary_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a glossary. Will delete underlying terms/categories together. Recommend + separate delete terms and categories. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_request( + glossary_id=glossary_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_categories( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Get the categories belonging to a specific glossary. Recommend using + limit/offset to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossaryCategory]] = kwargs.pop("cls", None) + + _request = build_glossary_get_categories_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryCategory], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_categories_headers( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedCategoryHeader]: + """Get the category headers belonging to a specific glossary. Recommend using + limit/offset to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedCategoryHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedCategoryHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_categories_headers_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedCategoryHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_detailed(self, glossary_id: str, **kwargs: Any) -> _models.AtlasGlossaryExtInfo: + # pylint: disable=line-too-long + """Get a specific glossary with detailed information. This API is not + recommend. + + Recommend to fetch terms/categories details separately using + + GET /datamap/api/atlas/v2/glossary/{glossaryId}/terms and + + GET /datamap/api/atlas/v2/glossary/{glossaryId}/categories. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: AtlasGlossaryExtInfo. The AtlasGlossaryExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "categoryInfo": { + "str": { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the + glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID + of the category. + "description": "str", # Optional. The + description of the category header. + "displayText": "str", # Optional. The + display text. + "parentCategoryGuid": "str", # Optional. The + GUID of the parent category. + "relationGuid": "str" # Optional. The GUID + of the relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "longDescription": "str", # Optional. The long version + description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of + the glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the + record. + } + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "termInfo": { + "str": { + "abbreviation": "str", # Optional. The abbreviation of the + term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the + glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The + display text. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the + object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "typeName": "str" # Optional. The + name of the type. + }, + "relationshipGuid": "str", # Optional. The + GUID of the relationship. + "relationshipStatus": "str", # Optional. The + enum of relationship status. Known values are: "ACTIVE" and + "DELETED". + "relationshipType": "str", # Optional. + Relationship type. + "typeName": "str", # Optional. The name of + the type. + "uniqueAttributes": { + "str": {} # Optional. The unique + attributes of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes + of the term, which is map>. The key of + the first layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID + of the category. + "description": "str", # Optional. The + description of the record. + "displayText": "str", # Optional. The + display text. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str" # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display + text. + "guid": "str", # Optional. The GUID of the + object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource + Id. + "typeName": "str", # Optional. The name of + the type. + "uniqueAttributes": { + "str": {} # Optional. The unique + attributes of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "longDescription": "str", # Optional. The long version + description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of + the glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display + name for url. + "url": "str" # Optional. web url. http or + https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the + AtlasGlossaryTerm. Known values are: "Draft", "Approved", "Alert", and + "Expired". + "synonyms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ] + } + }, + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryExtInfo] = kwargs.pop("cls", None) + + _request = build_glossary_get_detailed_request( + glossary_id=glossary_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def partial_update( + self, + glossary_id: str, + body: Dict[str, str], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Required. + :type body: dict[str, str] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + async def partial_update( + self, + glossary_id: str, + body: IO[bytes], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Required. + :type body: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace_async + async def partial_update( + self, + glossary_id: str, + body: Union[Dict[str, str], IO[bytes]], + *, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_request( + glossary_id=glossary_id, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_terms( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Get terms belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossaryTerm]] = kwargs.pop("cls", None) + + _request = build_glossary_get_terms_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryTerm], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_term_headers( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedTermHeader]: + # pylint: disable=line-too-long + """Get term headers belonging to a specific glossary. Recommend using limit/offset + to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedTermHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "description": "str", # Optional. The description of the related + term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the relationship. + "status": "str", # Optional. The status of term relationship. Known + values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedTermHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_headers_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedTermHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DiscoveryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`discovery` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def query( + self, body: _models.QueryOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: ~azure.purview.datamap.models.QueryOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "continuationToken": "str", # Optional. The token used to get next batch of + data. Default 'Null' to get the first batch, and will return new token in each + response unless there's no more data. + "facets": [ + { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + ], + "filter": {}, # Optional. The filter for the search. See examples for the + usage of supported filters. + "keywords": "str", # Optional. The keywords applied to all searchable + fields. + "limit": 0, # Optional. The limit of the number of the search result. + default value is 50; maximum value is 1000. + "orderby": [ + {} # Optional. The sort order of search results, can specify + multiple fields. + ], + "taxonomySetting": { + "assetTypes": [ + "str" # Optional. Asset types. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + } + } + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + async def query(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + async def query( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @distributed_trace_async + async def query(self, body: Union[_models.QueryOptions, JSON, IO[bytes]], **kwargs: Any) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Is one of the following types: QueryOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.QueryOptions or JSON or IO[bytes] + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "continuationToken": "str", # Optional. The token used to get next batch of + data. Default 'Null' to get the first batch, and will return new token in each + response unless there's no more data. + "facets": [ + { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + ], + "filter": {}, # Optional. The filter for the search. See examples for the + usage of supported filters. + "keywords": "str", # Optional. The keywords applied to all searchable + fields. + "limit": 0, # Optional. The limit of the number of the search result. + default value is 50; maximum value is 1000. + "orderby": [ + {} # Optional. The sort order of search results, can specify + multiple fields. + ], + "taxonomySetting": { + "assetTypes": [ + "str" # Optional. Asset types. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + } + } + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_query_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.QueryResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def suggest( + self, body: _models.SuggestOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: ~azure.purview.datamap.models.SuggestOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the search. + "keywords": "str", # Optional. The keywords applied to all fields that + support suggest operation. It must be at least 1 character, and no more than 100 + characters. In the index schema we defined a default suggester which lists all + the supported fields and specifies a search mode. + "limit": 0 # Optional. The number of suggestions we hope to return. The + default value is 5. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + async def suggest( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + async def suggest( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @distributed_trace_async + async def suggest( + self, body: Union[_models.SuggestOptions, JSON, IO[bytes]], **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Is one of the following types: SuggestOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.SuggestOptions or JSON or IO[bytes] + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the search. + "keywords": "str", # Optional. The keywords applied to all fields that + support suggest operation. It must be at least 1 character, and no more than 100 + characters. In the index schema we defined a default suggester which lists all + the supported fields and specifies a search mode. + "limit": 0 # Optional. The number of suggestions we hope to return. The + default value is 5. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SuggestResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_suggest_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SuggestResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def auto_complete( + self, body: _models.AutoCompleteOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + # pylint: disable=line-too-long + """Get auto complete options. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AutoCompleteOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the autocomplete request. + "keywords": "str", # Optional. The keywords applied to all fields that + support autocomplete operation. It must be at least 1 character, and no more than + 100 characters. + "limit": 0 # Optional. The number of autocomplete results we hope to return. + The default value is 50. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @overload + async def auto_complete( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + """Get auto complete options. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @overload + async def auto_complete( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + """Get auto complete options. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @distributed_trace_async + async def auto_complete( + self, body: Union[_models.AutoCompleteOptions, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AutoCompleteResult: + # pylint: disable=line-too-long + """Get auto complete options. + + :param body: Is one of the following types: AutoCompleteOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AutoCompleteOptions or JSON or IO[bytes] + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the autocomplete request. + "keywords": "str", # Optional. The keywords applied to all fields that + support autocomplete operation. It must be at least 1 character, and no more than + 100 characters. + "limit": 0 # Optional. The number of autocomplete results we hope to return. + The default value is 50. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutoCompleteResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_auto_complete_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutoCompleteResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LineageOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`lineage` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, guid: str, *, direction: Union[str, _models.LineageDirection], depth: Optional[int] = None, **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Get lineage info of the entity specified by GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword depth: The number of hops for lineage. Default value is None. + :paramtype depth: int + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_request( + guid=guid, + direction=direction, + depth=depth, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_next_page( + self, + guid: str, + *, + direction: Union[str, _models.LineageDirection], + offset: Optional[int] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Return immediate next page lineage info about entity with pagination. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_next_page_request( + guid=guid, + direction=direction, + offset=offset, + limit=limit, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_unique_attribute( + self, + type_name: str, + *, + direction: Union[str, _models.LineageDirection], + depth: Optional[int] = None, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Return lineage info about entity. + + In addition to the typeName path parameter, + attribute key-value pair(s) can be provided in the following + format + + attr:[attrName]=[attrValue] + + NOTE: The attrName and attrValue should be + unique across entities, eg. qualifiedName. + + The REST request would look + something like this: + + GET + /v2/lineage/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword depth: The number of hops for lineage. Default value is None. + :paramtype depth: int + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_by_unique_attribute_request( + type_name=type_name, + direction=direction, + depth=depth, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RelationshipOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`relationship` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def create( + self, body: _models.AtlasRelationship, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + async def create( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + async def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @distributed_trace_async + async def create( + self, body: Union[_models.AtlasRelationship, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Is one of the following types: AtlasRelationship, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship or JSON or IO[bytes] + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasRelationship] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_relationship_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationship, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, body: _models.AtlasRelationship, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + async def update( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + async def update( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @distributed_trace_async + async def update( + self, body: Union[_models.AtlasRelationship, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Is one of the following types: AtlasRelationship, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship or JSON or IO[bytes] + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasRelationship] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_relationship_update_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationship, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, guid: str, *, extended_info: Optional[bool] = None, **kwargs: Any + ) -> _models.AtlasRelationshipWithExtInfo: + # pylint: disable=line-too-long + """Get relationship information between entities by its GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :keyword extended_info: Limits whether includes extended information. Default value is None. + :paramtype extended_info: bool + :return: AtlasRelationshipWithExtInfo. The AtlasRelationshipWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "relationship": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipWithExtInfo] = kwargs.pop("cls", None) + + _request = build_relationship_get_request( + guid=guid, + extended_info=extended_info, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, guid: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a relationship between entities by its GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_relationship_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TypeDefinitionOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.DataMapClient`'s + :attr:`type_definition` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_business_metadata_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasBusinessMetadataDef: + # pylint: disable=line-too-long + """Get the businessMetadata definition for the given guid. + + :param guid: businessMetadata guid. Required. + :type guid: str + :return: AtlasBusinessMetadataDef. The AtlasBusinessMetadataDef is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasBusinessMetadataDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasBusinessMetadataDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_business_metadata_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasBusinessMetadataDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_business_metadata_by_name(self, name: str, **kwargs: Any) -> _models.AtlasBusinessMetadataDef: + # pylint: disable=line-too-long + """Get the businessMetadata definition by it's name (unique). + + :param name: businessMetadata name. Required. + :type name: str + :return: AtlasBusinessMetadataDef. The AtlasBusinessMetadataDef is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasBusinessMetadataDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasBusinessMetadataDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_business_metadata_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasBusinessMetadataDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_classification_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasClassificationDef: + # pylint: disable=line-too-long + """Get the classification definition for the given GUID. + + :param guid: The globally unique identifier of the classification. Required. + :type guid: str + :return: AtlasClassificationDef. The AtlasClassificationDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassificationDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassificationDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_classification_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassificationDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_classification_by_name(self, name: str, **kwargs: Any) -> _models.AtlasClassificationDef: + # pylint: disable=line-too-long + """Get the classification definition by its name (unique). + + :param name: The name of the classification. Required. + :type name: str + :return: AtlasClassificationDef. The AtlasClassificationDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassificationDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassificationDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_classification_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassificationDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_entity_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasEntityDef: + # pylint: disable=line-too-long + """Get the Entity definition for the given GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasEntityDef. The AtlasEntityDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_entity_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_entity_by_name(self, name: str, **kwargs: Any) -> _models.AtlasEntityDef: + # pylint: disable=line-too-long + """Get the entity definition by its name (unique). + + :param name: The name of the entity. Required. + :type name: str + :return: AtlasEntityDef. The AtlasEntityDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_entity_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_enum_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasEnumDef: + # pylint: disable=line-too-long + """Get the enum definition for the given GUID. + + :param guid: The globally unique identifier of the enum. Required. + :type guid: str + :return: AtlasEnumDef. The AtlasEnumDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEnumDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEnumDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_enum_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEnumDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_enum_by_name(self, name: str, **kwargs: Any) -> _models.AtlasEnumDef: + # pylint: disable=line-too-long + """Get the enum definition by its name (unique). + + :param name: The name of the enum. Required. + :type name: str + :return: AtlasEnumDef. The AtlasEnumDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEnumDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEnumDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_enum_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEnumDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_relationship_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasRelationshipDef: + # pylint: disable=line-too-long + """Get the relationship definition for the given GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :return: AtlasRelationshipDef. The AtlasRelationshipDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_relationship_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_relationship_by_name(self, name: str, **kwargs: Any) -> _models.AtlasRelationshipDef: + # pylint: disable=line-too-long + """Get the relationship definition by its name (unique). + + :param name: The name of the relationship. Required. + :type name: str + :return: AtlasRelationshipDef. The AtlasRelationshipDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_relationship_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_struct_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasStructDef: + # pylint: disable=line-too-long + """Get the struct definition for the given GUID. + + :param guid: The globally unique identifier of the struct. Required. + :type guid: str + :return: AtlasStructDef. The AtlasStructDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasStructDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasStructDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_struct_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasStructDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_struct_by_name(self, name: str, **kwargs: Any) -> _models.AtlasStructDef: + # pylint: disable=line-too-long + """Get the struct definition by its name (unique). + + :param name: The name of the struct. Required. + :type name: str + :return: AtlasStructDef. The AtlasStructDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasStructDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasStructDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_struct_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasStructDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasTypeDef: + # pylint: disable=line-too-long + """Get the type definition for the given GUID. + + :param guid: The globally unique identifier of the type. Required. + :type guid: str + :return: AtlasTypeDef. The AtlasTypeDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypeDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypeDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypeDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_name(self, name: str, **kwargs: Any) -> _models.AtlasTypeDef: + # pylint: disable=line-too-long + """Get the type definition by its name (unique). + + :param name: The name of the type. Required. + :type name: str + :return: AtlasTypeDef. The AtlasTypeDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypeDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypeDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypeDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete API for type identified by its name. + + :param name: The name of the type. Required. + :type name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_type_definition_delete_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get( + self, + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """List all type definitions in bulk. + + :keyword include_term_template: Whether include termtemplatedef when return all typedefs. + This is always true + when search filter type=term_template. Default value is None. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "PRIMITIVE", + "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", + and "TERM_TEMPLATE". Default value is None. + :paramtype type: str or ~azure.purview.datamap.models.TypeCategory + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_request( + include_term_template=include_term_template, + type=type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def batch_create( + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def batch_create( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def batch_create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace_async + async def batch_create( + self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def batch_update( + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def batch_update( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def batch_update( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace_async + async def batch_update( + self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_update_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_delete_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_headers( + self, + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any + ) -> List[_models.AtlasTypeDefHeader]: + # pylint: disable=line-too-long + """List all type definitions returned as a list of minimal information header. + + :keyword include_term_template: Whether include termtemplatedef when return all typedefs. + This is always true + when search filter type=term_template. Default value is None. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "PRIMITIVE", + "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", + and "TERM_TEMPLATE". Default value is None. + :paramtype type: str or ~azure.purview.datamap.models.TypeCategory + :return: list of AtlasTypeDefHeader + :rtype: list[~azure.purview.datamap.models.AtlasTypeDefHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "category": "str", # Optional. The enum of type category. Known + values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "guid": "str", # Optional. The GUID of the type definition. + "name": "str" # Optional. The name of the type definition. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasTypeDefHeader]] = kwargs.pop("cls", None) + + _request = build_type_definition_get_headers_request( + include_term_template=include_term_template, + type=type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasTypeDefHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_term_template_by_id(self, guid: str, **kwargs: Any) -> _models.TermTemplateDef: + # pylint: disable=line-too-long + """Get the term template definition for the given GUID. + + :param guid: The globally unique identifier of the term template. Required. + :type guid: str + :return: TermTemplateDef. The TermTemplateDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.TermTemplateDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TermTemplateDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_term_template_by_id_request( + guid=guid, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TermTemplateDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_term_template_by_name(self, name: str, **kwargs: Any) -> _models.TermTemplateDef: + # pylint: disable=line-too-long + """Get the term template definition by its name (unique). + + :param name: The unique name of the term template. Required. + :type name: str + :return: TermTemplateDef. The TermTemplateDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.TermTemplateDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TermTemplateDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_term_template_by_name_request( + name=name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TermTemplateDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_patch.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/__init__.py new file mode 100644 index 000000000000..378c36c91d25 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/__init__.py @@ -0,0 +1,185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models import AtlasAttributeDef +from ._models import AtlasBusinessMetadataDef +from ._models import AtlasClassification +from ._models import AtlasClassificationDef +from ._models import AtlasClassifications +from ._models import AtlasConstraintDef +from ._models import AtlasEntitiesWithExtInfo +from ._models import AtlasEntity +from ._models import AtlasEntityDef +from ._models import AtlasEntityHeader +from ._models import AtlasEntityHeaders +from ._models import AtlasEntityWithExtInfo +from ._models import AtlasEnumDef +from ._models import AtlasEnumElementDef +from ._models import AtlasErrorResponse +from ._models import AtlasGlossary +from ._models import AtlasGlossaryCategory +from ._models import AtlasGlossaryExtInfo +from ._models import AtlasGlossaryHeader +from ._models import AtlasGlossaryTerm +from ._models import AtlasLineageInfo +from ._models import AtlasObjectId +from ._models import AtlasRelatedCategoryHeader +from ._models import AtlasRelatedObjectId +from ._models import AtlasRelatedTermHeader +from ._models import AtlasRelationship +from ._models import AtlasRelationshipAttributeDef +from ._models import AtlasRelationshipDef +from ._models import AtlasRelationshipEndDef +from ._models import AtlasRelationshipWithExtInfo +from ._models import AtlasStruct +from ._models import AtlasStructDef +from ._models import AtlasTermAssignmentHeader +from ._models import AtlasTermCategorizationHeader +from ._models import AtlasTypeDef +from ._models import AtlasTypeDefHeader +from ._models import AtlasTypesDef +from ._models import AutoCompleteOptions +from ._models import AutoCompleteResult +from ._models import AutoCompleteResultValue +from ._models import BulkImportResult +from ._models import BusinessMetadataOptions +from ._models import ClassificationAssociateOptions +from ._models import ContactInfo +from ._models import ContactSearchResultValue +from ._models import DateFormat +from ._models import EntityMutationResult +from ._models import ImportInfo +from ._models import LineageRelation +from ._models import MoveEntitiesOptions +from ._models import NumberFormat +from ._models import ParentRelation +from ._models import PurviewObjectId +from ._models import QueryOptions +from ._models import QueryResult +from ._models import ResourceLink +from ._models import SearchFacetItem +from ._models import SearchFacetItemValue +from ._models import SearchFacetResultValue +from ._models import SearchFacetSort +from ._models import SearchHighlights +from ._models import SearchResultValue +from ._models import SearchTaxonomySetting +from ._models import SuggestOptions +from ._models import SuggestResult +from ._models import SuggestResultValue +from ._models import TermSearchResultValue +from ._models import TermTemplateDef +from ._models import TimeBoundary +from ._models import TimeZone + +from ._enums import AtlasTermAssignmentStatus +from ._enums import AtlasTermRelationshipStatus +from ._enums import BusinessAttributeUpdateBehavior +from ._enums import CardinalityValue +from ._enums import EntityStatus +from ._enums import ImportStatus +from ._enums import LineageDirection +from ._enums import RelationshipCategory +from ._enums import RoundingMode +from ._enums import SearchSortOrder +from ._enums import SortType +from ._enums import StatusAtlasRelationship +from ._enums import TermStatus +from ._enums import TypeCategory +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AtlasAttributeDef", + "AtlasBusinessMetadataDef", + "AtlasClassification", + "AtlasClassificationDef", + "AtlasClassifications", + "AtlasConstraintDef", + "AtlasEntitiesWithExtInfo", + "AtlasEntity", + "AtlasEntityDef", + "AtlasEntityHeader", + "AtlasEntityHeaders", + "AtlasEntityWithExtInfo", + "AtlasEnumDef", + "AtlasEnumElementDef", + "AtlasErrorResponse", + "AtlasGlossary", + "AtlasGlossaryCategory", + "AtlasGlossaryExtInfo", + "AtlasGlossaryHeader", + "AtlasGlossaryTerm", + "AtlasLineageInfo", + "AtlasObjectId", + "AtlasRelatedCategoryHeader", + "AtlasRelatedObjectId", + "AtlasRelatedTermHeader", + "AtlasRelationship", + "AtlasRelationshipAttributeDef", + "AtlasRelationshipDef", + "AtlasRelationshipEndDef", + "AtlasRelationshipWithExtInfo", + "AtlasStruct", + "AtlasStructDef", + "AtlasTermAssignmentHeader", + "AtlasTermCategorizationHeader", + "AtlasTypeDef", + "AtlasTypeDefHeader", + "AtlasTypesDef", + "AutoCompleteOptions", + "AutoCompleteResult", + "AutoCompleteResultValue", + "BulkImportResult", + "BusinessMetadataOptions", + "ClassificationAssociateOptions", + "ContactInfo", + "ContactSearchResultValue", + "DateFormat", + "EntityMutationResult", + "ImportInfo", + "LineageRelation", + "MoveEntitiesOptions", + "NumberFormat", + "ParentRelation", + "PurviewObjectId", + "QueryOptions", + "QueryResult", + "ResourceLink", + "SearchFacetItem", + "SearchFacetItemValue", + "SearchFacetResultValue", + "SearchFacetSort", + "SearchHighlights", + "SearchResultValue", + "SearchTaxonomySetting", + "SuggestOptions", + "SuggestResult", + "SuggestResultValue", + "TermSearchResultValue", + "TermTemplateDef", + "TimeBoundary", + "TimeZone", + "AtlasTermAssignmentStatus", + "AtlasTermRelationshipStatus", + "BusinessAttributeUpdateBehavior", + "CardinalityValue", + "EntityStatus", + "ImportStatus", + "LineageDirection", + "RelationshipCategory", + "RoundingMode", + "SearchSortOrder", + "SortType", + "StatusAtlasRelationship", + "TermStatus", + "TypeCategory", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_enums.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_enums.py new file mode 100644 index 000000000000..2ef81a12edc9 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_enums.py @@ -0,0 +1,194 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AtlasTermAssignmentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status for term assignment.""" + + DISCOVERED = "DISCOVERED" + """The status is discovered.""" + PROPOSED = "PROPOSED" + """The status is proposed.""" + IMPORTED = "IMPORTED" + """The status is imported.""" + VALIDATED = "VALIDATED" + """The status is validated.""" + DEPRECATED = "DEPRECATED" + """The status is deprecated.""" + OBSOLETE = "OBSOLETE" + """The status is obsolete.""" + OTHER = "OTHER" + """Other status.""" + + +class AtlasTermRelationshipStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status for atlas term relationship.""" + + DRAFT = "DRAFT" + """draft""" + ACTIVE = "ACTIVE" + """active""" + DEPRECATED = "DEPRECATED" + """deprecated""" + OBSOLETE = "OBSOLETE" + """obsolete""" + OTHER = "OTHER" + """other""" + + +class BusinessAttributeUpdateBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum for business attribute update behavior.""" + + IGNORE = "ignore" + """Ignore the business attribute payload for update.""" + REPLACE = "replace" + """Replace all the business attributes using the payload.""" + MERGE = "merge" + """Merge the business attributes. Business attributes will not be updated if not provided.""" + + +class CardinalityValue(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Cardinality.""" + + SINGLE = "SINGLE" + """single""" + LIST = "LIST" + """list""" + SET = "SET" + """set""" + + +class EntityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status - can be active or deleted.""" + + ACTIVE = "ACTIVE" + """The status is active.""" + DELETED = "DELETED" + """The status is deleted.""" + + +class ImportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status for import.""" + + SUCCESS = "SUCCESS" + """Success""" + FAILED = "FAILED" + """Failed""" + + +class LineageDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Lineage direction.""" + + INPUT = "INPUT" + """input""" + OUTPUT = "OUTPUT" + """output""" + BOTH = "BOTH" + """both""" + + +class RelationshipCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Relationship Category.""" + + ASSOCIATION = "ASSOCIATION" + """association""" + AGGREGATION = "AGGREGATION" + """aggregation""" + COMPOSITION = "COMPOSITION" + """composition""" + + +class RoundingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Rounding Mode.""" + + UP = "UP" + """up""" + DOWN = "DOWN" + """down""" + CEILING = "CEILING" + """ceiling""" + FLOOR = "FLOOR" + """floor""" + HALF_UP = "HALF_UP" + """half up""" + HALF_DOWN = "HALF_DOWN" + """half down""" + HALF_EVEN = "HALF_EVEN" + """half even""" + UNNECESSARY = "UNNECESSARY" + """unnecessary""" + + +class SearchSortOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Search sort order.""" + + ASCEND = "asc" + """Use ascending order for sorting""" + DESCEND = "desc" + """Use descending order for sorting""" + + +class SortType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type for sorting.""" + + NONE = "NONE" + """No sorting order""" + ASCEND = "ASC" + """Use ascending order for sorting""" + DESCEND = "DESC" + """Use descending order for sorting""" + + +class StatusAtlasRelationship(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status for atlas relationship.""" + + ACTIVE = "ACTIVE" + """active""" + DELETED = "DELETED" + """deleted""" + + +class TermStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status for term.""" + + DRAFT = "Draft" + """draft""" + APPROVED = "Approved" + """approved""" + ALERT = "Alert" + """alert""" + EXPIRED = "Expired" + """expired""" + + +class TypeCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type Category.""" + + PRIMITIVE = "PRIMITIVE" + """primitive""" + OBJECT_ID_TYPE = "OBJECT_ID_TYPE" + """object id type""" + ENUM = "ENUM" + """enum""" + STRUCT = "STRUCT" + """struct""" + CLASSIFICATION = "CLASSIFICATION" + """classification""" + ENTITY = "ENTITY" + """entity""" + ARRAY = "ARRAY" + """array""" + MAP = "MAP" + """map""" + RELATIONSHIP = "RELATIONSHIP" + """relationship""" + TERM_TEMPLATE = "TERM_TEMPLATE" + """term template""" diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_models.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_models.py new file mode 100644 index 000000000000..2f689398273b --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_models.py @@ -0,0 +1,4824 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .. import _model_base +from .._model_base import rest_field +from .._vendor import FileType + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AtlasAttributeDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of a struct-attribute. + + :ivar cardinality: single-valued attribute or multi-valued attribute. Known values are: + "SINGLE", "LIST", and "SET". + :vartype cardinality: str or ~azure.purview.datamap.models.CardinalityValue + :ivar constraints: An array of constraints. + :vartype constraints: list[~azure.purview.datamap.models.AtlasConstraintDef] + :ivar default_value: The default value of the attribute. + :vartype default_value: str + :ivar description: The description of the attribute. + :vartype description: str + :ivar include_in_notification: Determines if it is included in notification. + :vartype include_in_notification: bool + :ivar is_indexable: Determines if it is indexable. + :vartype is_indexable: bool + :ivar is_optional: Determines if it is optional. + :vartype is_optional: bool + :ivar is_unique: Determines if it unique. + :vartype is_unique: bool + :ivar name: The name of the attribute. + :vartype name: str + :ivar options: The options for the attribute. + :vartype options: dict[str, str] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar values_max_count: The maximum count of the values. + :vartype values_max_count: int + :ivar values_min_count: The minimum count of the values. + :vartype values_min_count: int + """ + + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = rest_field() + """single-valued attribute or multi-valued attribute. Known values are: \"SINGLE\", \"LIST\", and + \"SET\".""" + constraints: Optional[List["_models.AtlasConstraintDef"]] = rest_field() + """An array of constraints.""" + default_value: Optional[str] = rest_field(name="defaultValue") + """The default value of the attribute.""" + description: Optional[str] = rest_field() + """The description of the attribute.""" + include_in_notification: Optional[bool] = rest_field(name="includeInNotification") + """Determines if it is included in notification.""" + is_indexable: Optional[bool] = rest_field(name="isIndexable") + """Determines if it is indexable.""" + is_optional: Optional[bool] = rest_field(name="isOptional") + """Determines if it is optional.""" + is_unique: Optional[bool] = rest_field(name="isUnique") + """Determines if it unique.""" + name: Optional[str] = rest_field() + """The name of the attribute.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the attribute.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + values_max_count: Optional[int] = rest_field(name="valuesMaxCount") + """The maximum count of the values.""" + values_min_count: Optional[int] = rest_field(name="valuesMinCount") + """The minimum count of the values.""" + + @overload + def __init__( + self, + *, + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = None, + constraints: Optional[List["_models.AtlasConstraintDef"]] = None, + default_value: Optional[str] = None, + description: Optional[str] = None, + include_in_notification: Optional[bool] = None, + is_indexable: Optional[bool] = None, + is_optional: Optional[bool] = None, + is_unique: Optional[bool] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + type_name: Optional[str] = None, + values_max_count: Optional[int] = None, + values_min_count: Optional[int] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasBusinessMetadataDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of a struct-type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasClassification(_model_base.Model): + """An instance of a classification; it doesn't have an identity, this object + exists only when associated with an entity. + + :ivar attributes: The attributes of the struct. + :vartype attributes: dict[str, any] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar entity_guid: The GUID of the entity. + :vartype entity_guid: str + :ivar entity_status: Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + :vartype entity_status: str or ~azure.purview.datamap.models.EntityStatus + :ivar remove_propagations_on_entity_delete: Determines if propagations will be removed on + entity deletion. + :vartype remove_propagations_on_entity_delete: bool + :ivar validity_periods: An array of time boundaries indicating validity periods. + :vartype validity_periods: list[~azure.purview.datamap.models.TimeBoundary] + """ + + attributes: Optional[Dict[str, Any]] = rest_field() + """The attributes of the struct.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + entity_guid: Optional[str] = rest_field(name="entityGuid") + """The GUID of the entity.""" + entity_status: Optional[Union[str, "_models.EntityStatus"]] = rest_field(name="entityStatus") + """Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: \"ACTIVE\" and \"DELETED\".""" + remove_propagations_on_entity_delete: Optional[bool] = rest_field(name="removePropagationsOnEntityDelete") + """Determines if propagations will be removed on entity deletion.""" + validity_periods: Optional[List["_models.TimeBoundary"]] = rest_field(name="validityPeriods") + """An array of time boundaries indicating validity periods.""" + + @overload + def __init__( + self, + *, + attributes: Optional[Dict[str, Any]] = None, + type_name: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + entity_guid: Optional[str] = None, + entity_status: Optional[Union[str, "_models.EntityStatus"]] = None, + remove_propagations_on_entity_delete: Optional[bool] = None, + validity_periods: Optional[List["_models.TimeBoundary"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasClassificationDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of a classification-type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + :ivar entity_types: Specifying a list of entityType names in the classificationDef, ensures + that + classifications can + only be applied to those entityTypes. + + Any subtypes of the entity types inherit the restriction. + + Any classificationDef subtypes inherit the parents entityTypes restrictions. + + Any classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. + + An empty entityTypes list when there are no parent restrictions means there are no + restrictions. + + An empty entityTypes list when there are parent + restrictions means that the subtype picks up the parents + restrictions. + + If a list of entityTypes are supplied, where one inherits + from another, this will be rejected. This should encourage cleaner + classificationsDefs. + :vartype entity_types: list[str] + :ivar sub_types: An array of sub types. + :vartype sub_types: list[str] + :ivar super_types: An array of super types. + :vartype super_types: list[str] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + entity_types: Optional[List[str]] = rest_field(name="entityTypes") + """Specifying a list of entityType names in the classificationDef, ensures that + classifications can + only be applied to those entityTypes. + + Any subtypes of the entity types inherit the restriction. + + Any classificationDef subtypes inherit the parents entityTypes restrictions. + + Any classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. + + An empty entityTypes list when there are no parent restrictions means there are no + restrictions. + + An empty entityTypes list when there are parent + restrictions means that the subtype picks up the parents + restrictions. + + If a list of entityTypes are supplied, where one inherits + from another, this will be rejected. This should encourage cleaner + classificationsDefs.""" + sub_types: Optional[List[str]] = rest_field(name="subTypes") + """An array of sub types.""" + super_types: Optional[List[str]] = rest_field(name="superTypes") + """An array of super types.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + entity_types: Optional[List[str]] = None, + sub_types: Optional[List[str]] = None, + super_types: Optional[List[str]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasClassifications(_model_base.Model): + """REST serialization friendly list. + + :ivar list: An array of objects. + :vartype list: list[any] + :ivar page_size: The size of the page. + :vartype page_size: int + :ivar sort_by: The sorted by field. + :vartype sort_by: str + :ivar sort_type: to specify whether the result should be sorted? If yes, whether asc or desc. + Known values are: "NONE", "ASC", and "DESC". + :vartype sort_type: str or ~azure.purview.datamap.models.SortType + :ivar start_index: The start index of the page. + :vartype start_index: int + :ivar total_count: The total count of items. + :vartype total_count: int + """ + + list: Optional[List[Any]] = rest_field() + """An array of objects.""" + page_size: Optional[int] = rest_field(name="pageSize") + """The size of the page.""" + sort_by: Optional[str] = rest_field(name="sortBy") + """The sorted by field.""" + sort_type: Optional[Union[str, "_models.SortType"]] = rest_field(name="sortType") + """to specify whether the result should be sorted? If yes, whether asc or desc. Known values are: + \"NONE\", \"ASC\", and \"DESC\".""" + start_index: Optional[int] = rest_field(name="startIndex") + """The start index of the page.""" + total_count: Optional[int] = rest_field(name="totalCount") + """The total count of items.""" + + @overload + def __init__( + self, + *, + list: Optional[List[Any]] = None, + page_size: Optional[int] = None, + sort_by: Optional[str] = None, + sort_type: Optional[Union[str, "_models.SortType"]] = None, + start_index: Optional[int] = None, + total_count: Optional[int] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasConstraintDef(_model_base.Model): + """class that captures details of a constraint. + + :ivar params: The parameters of the constraint definition. + :vartype params: dict[str, any] + :ivar type: The type of the constraint. + :vartype type: str + """ + + params: Optional[Dict[str, Any]] = rest_field() + """The parameters of the constraint definition.""" + type: Optional[str] = rest_field() + """The type of the constraint.""" + + @overload + def __init__( + self, + *, + params: Optional[Dict[str, Any]] = None, + type: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntitiesWithExtInfo(_model_base.Model): + """An instance of an entity along with extended info - like hive_table, + hive_database. + + :ivar referred_entities: The referred entities. + :vartype referred_entities: dict[str, ~azure.purview.datamap.models.AtlasEntity] + :ivar entities: An array of entities. + :vartype entities: list[~azure.purview.datamap.models.AtlasEntity] + """ + + referred_entities: Optional[Dict[str, "_models.AtlasEntity"]] = rest_field(name="referredEntities") + """The referred entities.""" + entities: Optional[List["_models.AtlasEntity"]] = rest_field() + """An array of entities.""" + + @overload + def __init__( + self, + *, + referred_entities: Optional[Dict[str, "_models.AtlasEntity"]] = None, + entities: Optional[List["_models.AtlasEntity"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntity(_model_base.Model): # pylint: disable=too-many-instance-attributes + """An instance of an entity - like hive_table, hive_database. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar attributes: The attributes of the struct. + :vartype attributes: dict[str, any] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar business_attributes: Business attributes. + :vartype business_attributes: dict[str, any] + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar custom_attributes: Custom Attribute. + :vartype custom_attributes: dict[str, str] + :ivar guid: The GUID of the entity. + :vartype guid: str + :ivar home_id: The home ID of the entity. + :vartype home_id: str + :ivar collection_id: The collection ID of the entity. + :vartype collection_id: str + :ivar is_incomplete: Whether it is a shell entity. + :vartype is_incomplete: bool + :ivar labels: labels. + :vartype labels: list[str] + :ivar meanings: An array of term assignment headers indicating the meanings of the entity. + :vartype meanings: list[~azure.purview.datamap.models.AtlasTermAssignmentHeader] + :ivar provenance_type: Used to record the provenance of an instance of an entity or + relationship. + :vartype provenance_type: int + :ivar proxy: Determines if there's a proxy. + :vartype proxy: bool + :ivar relationship_attributes: The attributes of relationship. + :vartype relationship_attributes: dict[str, any] + :ivar status: Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + :vartype status: str or ~azure.purview.datamap.models.EntityStatus + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the entity. + :vartype version: int + :ivar contacts: The dictionary of contacts for entities. Key could be Expert or Owner. + :vartype contacts: dict[str, list[~azure.purview.datamap.models.ContactInfo]] + """ + + attributes: Optional[Dict[str, Any]] = rest_field() + """The attributes of the struct.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + business_attributes: Optional[Dict[str, Any]] = rest_field(name="businessAttributes") + """Business attributes.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + custom_attributes: Optional[Dict[str, str]] = rest_field(name="customAttributes") + """Custom Attribute.""" + guid: Optional[str] = rest_field() + """The GUID of the entity.""" + home_id: Optional[str] = rest_field(name="homeId") + """The home ID of the entity.""" + collection_id: Optional[str] = rest_field(name="collectionId", visibility=["read"]) + """The collection ID of the entity.""" + is_incomplete: Optional[bool] = rest_field(name="isIncomplete") + """Whether it is a shell entity.""" + labels: Optional[List[str]] = rest_field() + """labels.""" + meanings: Optional[List["_models.AtlasTermAssignmentHeader"]] = rest_field() + """An array of term assignment headers indicating the meanings of the entity.""" + provenance_type: Optional[int] = rest_field(name="provenanceType") + """Used to record the provenance of an instance of an entity or relationship.""" + proxy: Optional[bool] = rest_field() + """Determines if there's a proxy.""" + relationship_attributes: Optional[Dict[str, Any]] = rest_field(name="relationshipAttributes") + """The attributes of relationship.""" + status: Optional[Union[str, "_models.EntityStatus"]] = rest_field() + """Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: \"ACTIVE\" and \"DELETED\".""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the entity.""" + contacts: Optional[Dict[str, List["_models.ContactInfo"]]] = rest_field() + """The dictionary of contacts for entities. Key could be Expert or Owner.""" + + @overload + def __init__( + self, + *, + attributes: Optional[Dict[str, Any]] = None, + type_name: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + business_attributes: Optional[Dict[str, Any]] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + custom_attributes: Optional[Dict[str, str]] = None, + guid: Optional[str] = None, + home_id: Optional[str] = None, + is_incomplete: Optional[bool] = None, + labels: Optional[List[str]] = None, + meanings: Optional[List["_models.AtlasTermAssignmentHeader"]] = None, + provenance_type: Optional[int] = None, + proxy: Optional[bool] = None, + relationship_attributes: Optional[Dict[str, Any]] = None, + status: Optional[Union[str, "_models.EntityStatus"]] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + contacts: Optional[Dict[str, List["_models.ContactInfo"]]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntityDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of a entity-type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + :ivar sub_types: An array of sub types. + :vartype sub_types: list[str] + :ivar super_types: An array of super types. + :vartype super_types: list[str] + :ivar relationship_attribute_defs: An array of relationship attributes. + :vartype relationship_attribute_defs: + list[~azure.purview.datamap.models.AtlasRelationshipAttributeDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + sub_types: Optional[List[str]] = rest_field(name="subTypes") + """An array of sub types.""" + super_types: Optional[List[str]] = rest_field(name="superTypes") + """An array of super types.""" + relationship_attribute_defs: Optional[List["_models.AtlasRelationshipAttributeDef"]] = rest_field( + name="relationshipAttributeDefs" + ) + """An array of relationship attributes.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + sub_types: Optional[List[str]] = None, + super_types: Optional[List[str]] = None, + relationship_attribute_defs: Optional[List["_models.AtlasRelationshipAttributeDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntityHeader(_model_base.Model): # pylint: disable=too-many-instance-attributes + """An instance of an entity - like hive_table, hive_database. + + :ivar attributes: The attributes of the struct. + :vartype attributes: dict[str, any] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar classification_names: An array of classification names. + :vartype classification_names: list[str] + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar display_text: The display text. + :vartype display_text: str + :ivar guid: The GUID of the record. + :vartype guid: str + :ivar is_incomplete: Whether it is a shell entity. + :vartype is_incomplete: bool + :ivar labels: labels. + :vartype labels: list[str] + :ivar meaning_names: An array of meanings. + :vartype meaning_names: list[str] + :ivar meanings: An array of term assignment headers. + :vartype meanings: list[~azure.purview.datamap.models.AtlasTermAssignmentHeader] + :ivar status: Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + :vartype status: str or ~azure.purview.datamap.models.EntityStatus + """ + + attributes: Optional[Dict[str, Any]] = rest_field() + """The attributes of the struct.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + classification_names: Optional[List[str]] = rest_field(name="classificationNames") + """An array of classification names.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + guid: Optional[str] = rest_field() + """The GUID of the record.""" + is_incomplete: Optional[bool] = rest_field(name="isIncomplete") + """Whether it is a shell entity.""" + labels: Optional[List[str]] = rest_field() + """labels.""" + meaning_names: Optional[List[str]] = rest_field(name="meaningNames") + """An array of meanings.""" + meanings: Optional[List["_models.AtlasTermAssignmentHeader"]] = rest_field() + """An array of term assignment headers.""" + status: Optional[Union[str, "_models.EntityStatus"]] = rest_field() + """Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: \"ACTIVE\" and \"DELETED\".""" + + @overload + def __init__( + self, + *, + attributes: Optional[Dict[str, Any]] = None, + type_name: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + classification_names: Optional[List[str]] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + display_text: Optional[str] = None, + guid: Optional[str] = None, + is_incomplete: Optional[bool] = None, + labels: Optional[List[str]] = None, + meaning_names: Optional[List[str]] = None, + meanings: Optional[List["_models.AtlasTermAssignmentHeader"]] = None, + status: Optional[Union[str, "_models.EntityStatus"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntityHeaders(_model_base.Model): + """An instance of an entity header map. + + :ivar guid_header_map: The description of the guid header map,. + :vartype guid_header_map: dict[str, ~azure.purview.datamap.models.AtlasEntityHeader] + """ + + guid_header_map: Optional[Dict[str, "_models.AtlasEntityHeader"]] = rest_field(name="guidHeaderMap") + """The description of the guid header map,.""" + + @overload + def __init__( + self, + *, + guid_header_map: Optional[Dict[str, "_models.AtlasEntityHeader"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEntityWithExtInfo(_model_base.Model): + """An instance of an entity along with extended info - like hive_table, + hive_database. + + :ivar referred_entities: The referred entities. + :vartype referred_entities: dict[str, ~azure.purview.datamap.models.AtlasEntity] + :ivar entity: An instance of an entity - like hive_table, hive_database. + :vartype entity: ~azure.purview.datamap.models.AtlasEntity + """ + + referred_entities: Optional[Dict[str, "_models.AtlasEntity"]] = rest_field(name="referredEntities") + """The referred entities.""" + entity: Optional["_models.AtlasEntity"] = rest_field() + """An instance of an entity - like hive_table, hive_database.""" + + @overload + def __init__( + self, + *, + referred_entities: Optional[Dict[str, "_models.AtlasEntity"]] = None, + entity: Optional["_models.AtlasEntity"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEnumDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of an enum-type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar default_value: The default value. + :vartype default_value: str + :ivar element_defs: An array of enum element definitions. + :vartype element_defs: list[~azure.purview.datamap.models.AtlasEnumElementDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + default_value: Optional[str] = rest_field(name="defaultValue") + """The default value.""" + element_defs: Optional[List["_models.AtlasEnumElementDef"]] = rest_field(name="elementDefs") + """An array of enum element definitions.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + default_value: Optional[str] = None, + element_defs: Optional[List["_models.AtlasEnumElementDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasEnumElementDef(_model_base.Model): + """class that captures details of an enum-element. + + :ivar description: The description of the enum element definition. + :vartype description: str + :ivar ordinal: The ordinal of the enum element definition. + :vartype ordinal: int + :ivar value: The value of the enum element definition. + :vartype value: str + """ + + description: Optional[str] = rest_field() + """The description of the enum element definition.""" + ordinal: Optional[int] = rest_field() + """The ordinal of the enum element definition.""" + value: Optional[str] = rest_field() + """The value of the enum element definition.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + ordinal: Optional[int] = None, + value: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasErrorResponse(_model_base.Model): + """An error response from the service. + + :ivar request_id: The request ID. + :vartype request_id: str + :ivar error_code: The error code. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + """ + + request_id: Optional[str] = rest_field(name="requestId") + """The request ID.""" + error_code: Optional[str] = rest_field(name="errorCode") + """The error code.""" + error_message: Optional[str] = rest_field(name="errorMessage") + """The error message.""" + + @overload + def __init__( + self, + *, + request_id: Optional[str] = None, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasGlossary(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The glossary object. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar long_description: The long version description. + :vartype long_description: str + :ivar name: The name of the glossary object. + :vartype name: str + :ivar qualified_name: The qualified name of the glossary object. + :vartype qualified_name: str + :ivar short_description: The short version of description. + :vartype short_description: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar categories: An array of categories. + :vartype categories: list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader] + :ivar language: The language of the glossary. + :vartype language: str + :ivar terms: An array of related term headers. + :vartype terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar usage: The usage of the glossary. + :vartype usage: str + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The long version description.""" + name: Optional[str] = rest_field() + """The name of the glossary object.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the glossary object.""" + short_description: Optional[str] = rest_field(name="shortDescription") + """The short version of description.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = rest_field() + """An array of categories.""" + language: Optional[str] = rest_field() + """The language of the glossary.""" + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers.""" + usage: Optional[str] = rest_field() + """The usage of the glossary.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + long_description: Optional[str] = None, + name: Optional[str] = None, + qualified_name: Optional[str] = None, + short_description: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = None, + language: Optional[str] = None, + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + usage: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasGlossaryCategory(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The glossary category. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar long_description: The long version description. + :vartype long_description: str + :ivar name: The name of the glossary object. + :vartype name: str + :ivar qualified_name: The qualified name of the glossary object. + :vartype qualified_name: str + :ivar short_description: The short version of description. + :vartype short_description: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar anchor: The glossary header with basic information. + :vartype anchor: ~azure.purview.datamap.models.AtlasGlossaryHeader + :ivar children_categories: An array of children categories. + :vartype children_categories: list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader] + :ivar parent_category: The header of the related category. + :vartype parent_category: ~azure.purview.datamap.models.AtlasRelatedCategoryHeader + :ivar terms: An array of related term headers. + :vartype terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The long version description.""" + name: Optional[str] = rest_field() + """The name of the glossary object.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the glossary object.""" + short_description: Optional[str] = rest_field(name="shortDescription") + """The short version of description.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + anchor: Optional["_models.AtlasGlossaryHeader"] = rest_field() + """The glossary header with basic information.""" + children_categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = rest_field(name="childrenCategories") + """An array of children categories.""" + parent_category: Optional["_models.AtlasRelatedCategoryHeader"] = rest_field(name="parentCategory") + """The header of the related category.""" + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + long_description: Optional[str] = None, + name: Optional[str] = None, + qualified_name: Optional[str] = None, + short_description: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + anchor: Optional["_models.AtlasGlossaryHeader"] = None, + children_categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = None, + parent_category: Optional["_models.AtlasRelatedCategoryHeader"] = None, + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasGlossaryExtInfo(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The extended information of glossary. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar long_description: The long version description. + :vartype long_description: str + :ivar name: The name of the glossary object. + :vartype name: str + :ivar qualified_name: The qualified name of the glossary object. + :vartype qualified_name: str + :ivar short_description: The short version of description. + :vartype short_description: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar categories: An array of categories. + :vartype categories: list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader] + :ivar language: The language of the glossary. + :vartype language: str + :ivar terms: An array of related term headers. + :vartype terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar usage: The usage of the glossary. + :vartype usage: str + :ivar category_info: The glossary category information. + :vartype category_info: dict[str, ~azure.purview.datamap.models.AtlasGlossaryCategory] + :ivar term_info: The glossary term information. + :vartype term_info: dict[str, ~azure.purview.datamap.models.AtlasGlossaryTerm] + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The long version description.""" + name: Optional[str] = rest_field() + """The name of the glossary object.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the glossary object.""" + short_description: Optional[str] = rest_field(name="shortDescription") + """The short version of description.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = rest_field() + """An array of categories.""" + language: Optional[str] = rest_field() + """The language of the glossary.""" + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers.""" + usage: Optional[str] = rest_field() + """The usage of the glossary.""" + category_info: Optional[Dict[str, "_models.AtlasGlossaryCategory"]] = rest_field(name="categoryInfo") + """The glossary category information.""" + term_info: Optional[Dict[str, "_models.AtlasGlossaryTerm"]] = rest_field(name="termInfo") + """The glossary term information.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + long_description: Optional[str] = None, + name: Optional[str] = None, + qualified_name: Optional[str] = None, + short_description: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + categories: Optional[List["_models.AtlasRelatedCategoryHeader"]] = None, + language: Optional[str] = None, + terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + usage: Optional[str] = None, + category_info: Optional[Dict[str, "_models.AtlasGlossaryCategory"]] = None, + term_info: Optional[Dict[str, "_models.AtlasGlossaryTerm"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasGlossaryHeader(_model_base.Model): + """The glossary header with basic information. + + :ivar display_text: The display text. + :vartype display_text: str + :ivar glossary_guid: The GUID of the glossary. + :vartype glossary_guid: str + :ivar relation_guid: The GUID of the relationship. + :vartype relation_guid: str + """ + + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + glossary_guid: Optional[str] = rest_field(name="glossaryGuid") + """The GUID of the glossary.""" + relation_guid: Optional[str] = rest_field(name="relationGuid") + """The GUID of the relationship.""" + + @overload + def __init__( + self, + *, + display_text: Optional[str] = None, + glossary_guid: Optional[str] = None, + relation_guid: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasGlossaryTerm(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The glossary term. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar classifications: An array of classifications. + :vartype classifications: list[~azure.purview.datamap.models.AtlasClassification] + :ivar long_description: The long version description. + :vartype long_description: str + :ivar name: The name of the glossary object. + :vartype name: str + :ivar qualified_name: The qualified name of the glossary object. + :vartype qualified_name: str + :ivar short_description: The short version of description. + :vartype short_description: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar abbreviation: The abbreviation of the term. + :vartype abbreviation: str + :ivar template_name: The name of the template. + :vartype template_name: list[any] + :ivar anchor: The glossary header with basic information. + :vartype anchor: ~azure.purview.datamap.models.AtlasGlossaryHeader + :ivar antonyms: An array of related term headers as antonyms. + :vartype antonyms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar status: Status of the AtlasGlossaryTerm. Known values are: "Draft", "Approved", "Alert", + and "Expired". + :vartype status: str or ~azure.purview.datamap.models.TermStatus + :ivar nick_name: The nick name of the term. + :vartype nick_name: str + :ivar hierarchy_info: The hierarchy information of the term. + :vartype hierarchy_info: list[~azure.purview.datamap.models.PurviewObjectId] + :ivar resources: An array of resource link for term. + :vartype resources: list[~azure.purview.datamap.models.ResourceLink] + :ivar contacts: The dictionary of contacts for terms. Key could be Expert or Steward. + :vartype contacts: dict[str, list[~azure.purview.datamap.models.ContactInfo]] + :ivar attributes: The custom attributes of the term, which is map>. + The + key of the first layer map is term template name. + :vartype attributes: dict[str, dict[str, any]] + :ivar assigned_entities: An array of related object IDs. + :vartype assigned_entities: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :ivar categories: An array of term categorization headers. + :vartype categories: list[~azure.purview.datamap.models.AtlasTermCategorizationHeader] + :ivar classifies: An array of related term headers. + :vartype classifies: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar examples: An array of examples. + :vartype examples: list[str] + :ivar is_a: An array of related term headers indicating the is-a relationship. + :vartype is_a: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar preferred_terms: An array of preferred related term headers. + :vartype preferred_terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar preferred_to_terms: An array of related term headers that are preferred to. + :vartype preferred_to_terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar replaced_by: An array of related term headers that are replaced by. + :vartype replaced_by: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar replacement_terms: An array of related term headers for replacement. + :vartype replacement_terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar see_also: An array of related term headers for see also. + :vartype see_also: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar synonyms: An array of related term headers as synonyms. + :vartype synonyms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar translated_terms: An array of translated related term headers. + :vartype translated_terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar translation_terms: An array of related term headers for translation. + :vartype translation_terms: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar usage: The usage of the term. + :vartype usage: str + :ivar valid_values: An array of related term headers as valid values. + :vartype valid_values: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :ivar valid_values_for: An array of related term headers as valid values for other records. + :vartype valid_values_for: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + classifications: Optional[List["_models.AtlasClassification"]] = rest_field() + """An array of classifications.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The long version description.""" + name: Optional[str] = rest_field() + """The name of the glossary object.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the glossary object.""" + short_description: Optional[str] = rest_field(name="shortDescription") + """The short version of description.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + abbreviation: Optional[str] = rest_field() + """The abbreviation of the term.""" + template_name: Optional[List[Any]] = rest_field(name="templateName") + """The name of the template.""" + anchor: Optional["_models.AtlasGlossaryHeader"] = rest_field() + """The glossary header with basic information.""" + antonyms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers as antonyms.""" + status: Optional[Union[str, "_models.TermStatus"]] = rest_field() + """Status of the AtlasGlossaryTerm. Known values are: \"Draft\", \"Approved\", \"Alert\", and + \"Expired\".""" + nick_name: Optional[str] = rest_field(name="nickName") + """The nick name of the term.""" + hierarchy_info: Optional[List["_models.PurviewObjectId"]] = rest_field(name="hierarchyInfo") + """The hierarchy information of the term.""" + resources: Optional[List["_models.ResourceLink"]] = rest_field() + """An array of resource link for term.""" + contacts: Optional[Dict[str, List["_models.ContactInfo"]]] = rest_field() + """The dictionary of contacts for terms. Key could be Expert or Steward.""" + attributes: Optional[Dict[str, Dict[str, Any]]] = rest_field() + """The custom attributes of the term, which is map>. + The + key of the first layer map is term template name.""" + assigned_entities: Optional[List["_models.AtlasRelatedObjectId"]] = rest_field(name="assignedEntities") + """An array of related object IDs.""" + categories: Optional[List["_models.AtlasTermCategorizationHeader"]] = rest_field() + """An array of term categorization headers.""" + classifies: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers.""" + examples: Optional[List[str]] = rest_field() + """An array of examples.""" + is_a: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="isA") + """An array of related term headers indicating the is-a relationship.""" + preferred_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="preferredTerms") + """An array of preferred related term headers.""" + preferred_to_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="preferredToTerms") + """An array of related term headers that are preferred to.""" + replaced_by: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="replacedBy") + """An array of related term headers that are replaced by.""" + replacement_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="replacementTerms") + """An array of related term headers for replacement.""" + see_also: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="seeAlso") + """An array of related term headers for see also.""" + synonyms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field() + """An array of related term headers as synonyms.""" + translated_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="translatedTerms") + """An array of translated related term headers.""" + translation_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="translationTerms") + """An array of related term headers for translation.""" + usage: Optional[str] = rest_field() + """The usage of the term.""" + valid_values: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="validValues") + """An array of related term headers as valid values.""" + valid_values_for: Optional[List["_models.AtlasRelatedTermHeader"]] = rest_field(name="validValuesFor") + """An array of related term headers as valid values for other records.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + classifications: Optional[List["_models.AtlasClassification"]] = None, + long_description: Optional[str] = None, + name: Optional[str] = None, + qualified_name: Optional[str] = None, + short_description: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + abbreviation: Optional[str] = None, + template_name: Optional[List[Any]] = None, + anchor: Optional["_models.AtlasGlossaryHeader"] = None, + antonyms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + status: Optional[Union[str, "_models.TermStatus"]] = None, + nick_name: Optional[str] = None, + hierarchy_info: Optional[List["_models.PurviewObjectId"]] = None, + resources: Optional[List["_models.ResourceLink"]] = None, + contacts: Optional[Dict[str, List["_models.ContactInfo"]]] = None, + attributes: Optional[Dict[str, Dict[str, Any]]] = None, + assigned_entities: Optional[List["_models.AtlasRelatedObjectId"]] = None, + categories: Optional[List["_models.AtlasTermCategorizationHeader"]] = None, + classifies: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + examples: Optional[List[str]] = None, + is_a: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + preferred_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + preferred_to_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + replaced_by: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + replacement_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + see_also: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + synonyms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + translated_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + translation_terms: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + usage: Optional[str] = None, + valid_values: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + valid_values_for: Optional[List["_models.AtlasRelatedTermHeader"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasLineageInfo(_model_base.Model): + """The lineage information. + + :ivar base_entity_guid: The GUID of the base entity. + :vartype base_entity_guid: str + :ivar guid_entity_map: The GUID entity map. + :vartype guid_entity_map: dict[str, ~azure.purview.datamap.models.AtlasEntityHeader] + :ivar width_counts: The entity count in specific direction. + :vartype width_counts: dict[str, dict[str, any]] + :ivar lineage_depth: The depth of lineage. + :vartype lineage_depth: int + :ivar lineage_width: The width of lineage. + :vartype lineage_width: int + :ivar children_count: The number of children node. + :vartype children_count: int + :ivar lineage_direction: The enum of lineage direction. Known values are: "INPUT", "OUTPUT", + and "BOTH". + :vartype lineage_direction: str or ~azure.purview.datamap.models.LineageDirection + :ivar parent_relations: An array of parentRelations relations. + :vartype parent_relations: list[~azure.purview.datamap.models.ParentRelation] + :ivar relations: An array of lineage relations. + :vartype relations: list[~azure.purview.datamap.models.LineageRelation] + """ + + base_entity_guid: Optional[str] = rest_field(name="baseEntityGuid") + """The GUID of the base entity.""" + guid_entity_map: Optional[Dict[str, "_models.AtlasEntityHeader"]] = rest_field(name="guidEntityMap") + """The GUID entity map.""" + width_counts: Optional[Dict[str, Dict[str, Any]]] = rest_field(name="widthCounts") + """The entity count in specific direction.""" + lineage_depth: Optional[int] = rest_field(name="lineageDepth") + """The depth of lineage.""" + lineage_width: Optional[int] = rest_field(name="lineageWidth") + """The width of lineage.""" + children_count: Optional[int] = rest_field(name="childrenCount") + """The number of children node.""" + lineage_direction: Optional[Union[str, "_models.LineageDirection"]] = rest_field(name="lineageDirection") + """The enum of lineage direction. Known values are: \"INPUT\", \"OUTPUT\", and \"BOTH\".""" + parent_relations: Optional[List["_models.ParentRelation"]] = rest_field(name="parentRelations") + """An array of parentRelations relations.""" + relations: Optional[List["_models.LineageRelation"]] = rest_field() + """An array of lineage relations.""" + + @overload + def __init__( + self, + *, + base_entity_guid: Optional[str] = None, + guid_entity_map: Optional[Dict[str, "_models.AtlasEntityHeader"]] = None, + width_counts: Optional[Dict[str, Dict[str, Any]]] = None, + lineage_depth: Optional[int] = None, + lineage_width: Optional[int] = None, + children_count: Optional[int] = None, + lineage_direction: Optional[Union[str, "_models.LineageDirection"]] = None, + parent_relations: Optional[List["_models.ParentRelation"]] = None, + relations: Optional[List["_models.LineageRelation"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasObjectId(_model_base.Model): + """Reference to an object-instance of a type - like entity. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar unique_attributes: The unique attributes of the object. + :vartype unique_attributes: dict[str, any] + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + unique_attributes: Optional[Dict[str, Any]] = rest_field(name="uniqueAttributes") + """The unique attributes of the object.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + type_name: Optional[str] = None, + unique_attributes: Optional[Dict[str, Any]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelatedCategoryHeader(_model_base.Model): + """The header of the related category. + + :ivar category_guid: The GUID of the category. + :vartype category_guid: str + :ivar description: The description of the category header. + :vartype description: str + :ivar display_text: The display text. + :vartype display_text: str + :ivar parent_category_guid: The GUID of the parent category. + :vartype parent_category_guid: str + :ivar relation_guid: The GUID of the relationship. + :vartype relation_guid: str + """ + + category_guid: Optional[str] = rest_field(name="categoryGuid") + """The GUID of the category.""" + description: Optional[str] = rest_field() + """The description of the category header.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + parent_category_guid: Optional[str] = rest_field(name="parentCategoryGuid") + """The GUID of the parent category.""" + relation_guid: Optional[str] = rest_field(name="relationGuid") + """The GUID of the relationship.""" + + @overload + def __init__( + self, + *, + category_guid: Optional[str] = None, + description: Optional[str] = None, + display_text: Optional[str] = None, + parent_category_guid: Optional[str] = None, + relation_guid: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelatedObjectId(_model_base.Model): + """Reference to an object-instance of AtlasEntity type used in relationship + attribute values. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar unique_attributes: The unique attributes of the object. + :vartype unique_attributes: dict[str, any] + :ivar display_text: The display text. + :vartype display_text: str + :ivar entity_status: Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + :vartype entity_status: str or ~azure.purview.datamap.models.EntityStatus + :ivar relationship_type: Relationship type. + :vartype relationship_type: str + :ivar relationship_attributes: Captures details of struct contents. Not instantiated directly, + used only via + AtlasEntity, AtlasClassification. + :vartype relationship_attributes: ~azure.purview.datamap.models.AtlasStruct + :ivar relationship_guid: The GUID of the relationship. + :vartype relationship_guid: str + :ivar relationship_status: The enum of relationship status. Known values are: "ACTIVE" and + "DELETED". + :vartype relationship_status: str or ~azure.purview.datamap.models.StatusAtlasRelationship + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + unique_attributes: Optional[Dict[str, Any]] = rest_field(name="uniqueAttributes") + """The unique attributes of the object.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + entity_status: Optional[Union[str, "_models.EntityStatus"]] = rest_field(name="entityStatus") + """Status of the entity - can be active or deleted. Deleted entities are not + removed. Known values are: \"ACTIVE\" and \"DELETED\".""" + relationship_type: Optional[str] = rest_field(name="relationshipType") + """Relationship type.""" + relationship_attributes: Optional["_models.AtlasStruct"] = rest_field(name="relationshipAttributes") + """Captures details of struct contents. Not instantiated directly, used only via + AtlasEntity, AtlasClassification.""" + relationship_guid: Optional[str] = rest_field(name="relationshipGuid") + """The GUID of the relationship.""" + relationship_status: Optional[Union[str, "_models.StatusAtlasRelationship"]] = rest_field(name="relationshipStatus") + """The enum of relationship status. Known values are: \"ACTIVE\" and \"DELETED\".""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + type_name: Optional[str] = None, + unique_attributes: Optional[Dict[str, Any]] = None, + display_text: Optional[str] = None, + entity_status: Optional[Union[str, "_models.EntityStatus"]] = None, + relationship_type: Optional[str] = None, + relationship_attributes: Optional["_models.AtlasStruct"] = None, + relationship_guid: Optional[str] = None, + relationship_status: Optional[Union[str, "_models.StatusAtlasRelationship"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelatedTermHeader(_model_base.Model): + """The header of the related term. + + :ivar description: The description of the related term. + :vartype description: str + :ivar display_text: The display text. + :vartype display_text: str + :ivar expression: The expression of the term. + :vartype expression: str + :ivar relation_guid: The GUID of the relationship. + :vartype relation_guid: str + :ivar status: The status of term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + :vartype status: str or ~azure.purview.datamap.models.AtlasTermRelationshipStatus + :ivar steward: The steward of the term. + :vartype steward: str + :ivar term_guid: The GUID of the term. + :vartype term_guid: str + """ + + description: Optional[str] = rest_field() + """The description of the related term.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + expression: Optional[str] = rest_field() + """The expression of the term.""" + relation_guid: Optional[str] = rest_field(name="relationGuid") + """The GUID of the relationship.""" + status: Optional[Union[str, "_models.AtlasTermRelationshipStatus"]] = rest_field() + """The status of term relationship. Known values are: \"DRAFT\", \"ACTIVE\", \"DEPRECATED\", + \"OBSOLETE\", and \"OTHER\".""" + steward: Optional[str] = rest_field() + """The steward of the term.""" + term_guid: Optional[str] = rest_field(name="termGuid") + """The GUID of the term.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + display_text: Optional[str] = None, + expression: Optional[str] = None, + relation_guid: Optional[str] = None, + status: Optional[Union[str, "_models.AtlasTermRelationshipStatus"]] = None, + steward: Optional[str] = None, + term_guid: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelationship(_model_base.Model): # pylint: disable=too-many-instance-attributes + """Atlas relationship instance. + + :ivar attributes: The attributes of the struct. + :vartype attributes: dict[str, any] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar end1: Reference to an object-instance of a type - like entity. + :vartype end1: ~azure.purview.datamap.models.AtlasObjectId + :ivar end2: Reference to an object-instance of a type - like entity. + :vartype end2: ~azure.purview.datamap.models.AtlasObjectId + :ivar guid: The GUID of the relationship. + :vartype guid: str + :ivar home_id: The home ID of the relationship. + :vartype home_id: str + :ivar label: The label of the relationship. + :vartype label: str + :ivar provenance_type: Used to record the provenance of an instance of an entity or + relationship. + :vartype provenance_type: int + :ivar status: The enum of relationship status. Known values are: "ACTIVE" and "DELETED". + :vartype status: str or ~azure.purview.datamap.models.StatusAtlasRelationship + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the relationship. + :vartype version: int + """ + + attributes: Optional[Dict[str, Any]] = rest_field() + """The attributes of the struct.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + end1: Optional["_models.AtlasObjectId"] = rest_field() + """Reference to an object-instance of a type - like entity.""" + end2: Optional["_models.AtlasObjectId"] = rest_field() + """Reference to an object-instance of a type - like entity.""" + guid: Optional[str] = rest_field() + """The GUID of the relationship.""" + home_id: Optional[str] = rest_field(name="homeId") + """The home ID of the relationship.""" + label: Optional[str] = rest_field() + """The label of the relationship.""" + provenance_type: Optional[int] = rest_field(name="provenanceType") + """Used to record the provenance of an instance of an entity or relationship.""" + status: Optional[Union[str, "_models.StatusAtlasRelationship"]] = rest_field() + """The enum of relationship status. Known values are: \"ACTIVE\" and \"DELETED\".""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the relationship.""" + + @overload + def __init__( + self, + *, + attributes: Optional[Dict[str, Any]] = None, + type_name: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + end1: Optional["_models.AtlasObjectId"] = None, + end2: Optional["_models.AtlasObjectId"] = None, + guid: Optional[str] = None, + home_id: Optional[str] = None, + label: Optional[str] = None, + provenance_type: Optional[int] = None, + status: Optional[Union[str, "_models.StatusAtlasRelationship"]] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelationshipAttributeDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + + :ivar cardinality: single-valued attribute or multi-valued attribute. Known values are: + "SINGLE", "LIST", and "SET". + :vartype cardinality: str or ~azure.purview.datamap.models.CardinalityValue + :ivar constraints: An array of constraints. + :vartype constraints: list[~azure.purview.datamap.models.AtlasConstraintDef] + :ivar default_value: The default value of the attribute. + :vartype default_value: str + :ivar description: The description of the attribute. + :vartype description: str + :ivar include_in_notification: Determines if it is included in notification. + :vartype include_in_notification: bool + :ivar is_indexable: Determines if it is indexable. + :vartype is_indexable: bool + :ivar is_optional: Determines if it is optional. + :vartype is_optional: bool + :ivar is_unique: Determines if it unique. + :vartype is_unique: bool + :ivar name: The name of the attribute. + :vartype name: str + :ivar options: The options for the attribute. + :vartype options: dict[str, str] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar values_max_count: The maximum count of the values. + :vartype values_max_count: int + :ivar values_min_count: The minimum count of the values. + :vartype values_min_count: int + :ivar is_legacy_attribute: Determines if it is a legacy attribute. + :vartype is_legacy_attribute: bool + :ivar relationship_type_name: The name of the relationship type. + :vartype relationship_type_name: str + """ + + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = rest_field() + """single-valued attribute or multi-valued attribute. Known values are: \"SINGLE\", \"LIST\", and + \"SET\".""" + constraints: Optional[List["_models.AtlasConstraintDef"]] = rest_field() + """An array of constraints.""" + default_value: Optional[str] = rest_field(name="defaultValue") + """The default value of the attribute.""" + description: Optional[str] = rest_field() + """The description of the attribute.""" + include_in_notification: Optional[bool] = rest_field(name="includeInNotification") + """Determines if it is included in notification.""" + is_indexable: Optional[bool] = rest_field(name="isIndexable") + """Determines if it is indexable.""" + is_optional: Optional[bool] = rest_field(name="isOptional") + """Determines if it is optional.""" + is_unique: Optional[bool] = rest_field(name="isUnique") + """Determines if it unique.""" + name: Optional[str] = rest_field() + """The name of the attribute.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the attribute.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + values_max_count: Optional[int] = rest_field(name="valuesMaxCount") + """The maximum count of the values.""" + values_min_count: Optional[int] = rest_field(name="valuesMinCount") + """The minimum count of the values.""" + is_legacy_attribute: Optional[bool] = rest_field(name="isLegacyAttribute") + """Determines if it is a legacy attribute.""" + relationship_type_name: Optional[str] = rest_field(name="relationshipTypeName") + """The name of the relationship type.""" + + @overload + def __init__( + self, + *, + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = None, + constraints: Optional[List["_models.AtlasConstraintDef"]] = None, + default_value: Optional[str] = None, + description: Optional[str] = None, + include_in_notification: Optional[bool] = None, + is_indexable: Optional[bool] = None, + is_optional: Optional[bool] = None, + is_unique: Optional[bool] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + type_name: Optional[str] = None, + values_max_count: Optional[int] = None, + values_min_count: Optional[int] = None, + is_legacy_attribute: Optional[bool] = None, + relationship_type_name: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelationshipDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """AtlasRelationshipDef is a TypeDef that defines a relationship. + As with other typeDefs the AtlasRelationshipDef has a name. Once created the + RelationshipDef has a guid. + The name and the guid are the 2 ways that the + RelationshipDef is identified. + RelationshipDefs have 2 ends, each of which + specify cardinality, an EntityDef type name and name and optionally + whether the + end is a container. + RelationshipDefs can have AttributeDefs - though only + primitive types are allowed. + RelationshipDefs have a relationshipCategory + specifying the UML type of relationship required + The way EntityDefs and + RelationshipDefs are intended to be used is that EntityDefs will define + AttributeDefs these AttributeDefs + will not specify an EntityDef type name as + their types. + RelationshipDefs introduce new attributes to the entity + instances. For example + EntityDef A might have attributes attr1,attr2,attr3 + + EntityDef B might have attributes attr4,attr5,attr6 + RelationshipDef + AtoB might define 2 ends + + end1: type A, name attr7 + end2: type B, name attr8 + + When an instance of EntityDef A is created, it + will have attributes attr1,attr2,attr3,attr7 + When an instance of EntityDef + B is created, it will have attributes attr4,attr5,attr6,attr8 + + In this way + relationshipDefs can be authored separately from entityDefs and can inject + relationship attributes into + the entity instances. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + :ivar end_def1: The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + :vartype end_def1: ~azure.purview.datamap.models.AtlasRelationshipEndDef + :ivar end_def2: The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + :vartype end_def2: ~azure.purview.datamap.models.AtlasRelationshipEndDef + :ivar relationship_category: The Relationship category determines the style of relationship + around + containment and lifecycle. + UML terminology is used for the values. + ASSOCIATION is a relationship with no containment. + COMPOSITION and AGGREGATION are containment relationships. + The difference being in the lifecycles of the container and its children. + In the COMPOSITION case, the children cannot exist without the container. + For AGGREGATION, the life cycles of the container and children are totally independent. Known + values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + :vartype relationship_category: str or ~azure.purview.datamap.models.RelationshipCategory + :ivar relationship_label: The label of the relationship. + :vartype relationship_label: str + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + end_def1: Optional["_models.AtlasRelationshipEndDef"] = rest_field(name="endDef1") + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship.""" + end_def2: Optional["_models.AtlasRelationshipEndDef"] = rest_field(name="endDef2") + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship.""" + relationship_category: Optional[Union[str, "_models.RelationshipCategory"]] = rest_field( + name="relationshipCategory" + ) + """The Relationship category determines the style of relationship around + containment and lifecycle. + UML terminology is used for the values. + ASSOCIATION is a relationship with no containment. + COMPOSITION and AGGREGATION are containment relationships. + The difference being in the lifecycles of the container and its children. + In the COMPOSITION case, the children cannot exist without the container. + For AGGREGATION, the life cycles of the container and children are totally independent. Known + values are: \"ASSOCIATION\", \"AGGREGATION\", and \"COMPOSITION\".""" + relationship_label: Optional[str] = rest_field(name="relationshipLabel") + """The label of the relationship.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + end_def1: Optional["_models.AtlasRelationshipEndDef"] = None, + end_def2: Optional["_models.AtlasRelationshipEndDef"] = None, + relationship_category: Optional[Union[str, "_models.RelationshipCategory"]] = None, + relationship_label: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelationshipEndDef(_model_base.Model): + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + + :ivar cardinality: single-valued attribute or multi-valued attribute. Known values are: + "SINGLE", "LIST", and "SET". + :vartype cardinality: str or ~azure.purview.datamap.models.CardinalityValue + :ivar description: The description of the relationship end definition. + :vartype description: str + :ivar is_container: Determines if it is container. + :vartype is_container: bool + :ivar is_legacy_attribute: Determines if it is a legacy attribute. + :vartype is_legacy_attribute: bool + :ivar name: The name of the relationship end definition. + :vartype name: str + :ivar type: The type of the relationship end. + :vartype type: str + """ + + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = rest_field() + """single-valued attribute or multi-valued attribute. Known values are: \"SINGLE\", \"LIST\", and + \"SET\".""" + description: Optional[str] = rest_field() + """The description of the relationship end definition.""" + is_container: Optional[bool] = rest_field(name="isContainer") + """Determines if it is container.""" + is_legacy_attribute: Optional[bool] = rest_field(name="isLegacyAttribute") + """Determines if it is a legacy attribute.""" + name: Optional[str] = rest_field() + """The name of the relationship end definition.""" + type: Optional[str] = rest_field() + """The type of the relationship end.""" + + @overload + def __init__( + self, + *, + cardinality: Optional[Union[str, "_models.CardinalityValue"]] = None, + description: Optional[str] = None, + is_container: Optional[bool] = None, + is_legacy_attribute: Optional[bool] = None, + name: Optional[str] = None, + type: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasRelationshipWithExtInfo(_model_base.Model): + """The relationship with extended information. + + :ivar referred_entities: The referred entity header. + :vartype referred_entities: dict[str, ~azure.purview.datamap.models.AtlasEntityHeader] + :ivar relationship: Atlas relationship instance. + :vartype relationship: ~azure.purview.datamap.models.AtlasRelationship + """ + + referred_entities: Optional[Dict[str, "_models.AtlasEntityHeader"]] = rest_field(name="referredEntities") + """The referred entity header.""" + relationship: Optional["_models.AtlasRelationship"] = rest_field() + """Atlas relationship instance.""" + + @overload + def __init__( + self, + *, + referred_entities: Optional[Dict[str, "_models.AtlasEntityHeader"]] = None, + relationship: Optional["_models.AtlasRelationship"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasStruct(_model_base.Model): + """Captures details of struct contents. Not instantiated directly, used only via + AtlasEntity, AtlasClassification. + + :ivar attributes: The attributes of the struct. + :vartype attributes: dict[str, any] + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + """ + + attributes: Optional[Dict[str, Any]] = rest_field() + """The attributes of the struct.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + + @overload + def __init__( + self, + *, + attributes: Optional[Dict[str, Any]] = None, + type_name: Optional[str] = None, + last_modified_t_s: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasStructDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """class that captures details of a struct-type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasTermAssignmentHeader(_model_base.Model): + """The header for term assignment. + + :ivar confidence: The confidence of the term assignment. + :vartype confidence: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar description: The description of the term assignment. + :vartype description: str + :ivar display_text: The display text. + :vartype display_text: str + :ivar expression: The expression of the term assignment. + :vartype expression: str + :ivar relation_guid: The GUID of the relationship. + :vartype relation_guid: str + :ivar status: The status of terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + :vartype status: str or ~azure.purview.datamap.models.AtlasTermAssignmentStatus + :ivar steward: The steward of the term. + :vartype steward: str + :ivar term_guid: The GUID of the term. + :vartype term_guid: str + """ + + confidence: Optional[int] = rest_field() + """The confidence of the term assignment.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + description: Optional[str] = rest_field() + """The description of the term assignment.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + expression: Optional[str] = rest_field() + """The expression of the term assignment.""" + relation_guid: Optional[str] = rest_field(name="relationGuid") + """The GUID of the relationship.""" + status: Optional[Union[str, "_models.AtlasTermAssignmentStatus"]] = rest_field() + """The status of terms assignment. Known values are: \"DISCOVERED\", \"PROPOSED\", \"IMPORTED\", + \"VALIDATED\", \"DEPRECATED\", \"OBSOLETE\", and \"OTHER\".""" + steward: Optional[str] = rest_field() + """The steward of the term.""" + term_guid: Optional[str] = rest_field(name="termGuid") + """The GUID of the term.""" + + @overload + def __init__( + self, + *, + confidence: Optional[int] = None, + created_by: Optional[str] = None, + description: Optional[str] = None, + display_text: Optional[str] = None, + expression: Optional[str] = None, + relation_guid: Optional[str] = None, + status: Optional[Union[str, "_models.AtlasTermAssignmentStatus"]] = None, + steward: Optional[str] = None, + term_guid: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasTermCategorizationHeader(_model_base.Model): + """The basic information for term categorization. + + :ivar category_guid: The GUID of the category. + :vartype category_guid: str + :ivar description: The description of the record. + :vartype description: str + :ivar display_text: The display text. + :vartype display_text: str + :ivar relation_guid: The GUID of the relationship. + :vartype relation_guid: str + :ivar status: The status of term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + :vartype status: str or ~azure.purview.datamap.models.AtlasTermRelationshipStatus + """ + + category_guid: Optional[str] = rest_field(name="categoryGuid") + """The GUID of the category.""" + description: Optional[str] = rest_field() + """The description of the record.""" + display_text: Optional[str] = rest_field(name="displayText") + """The display text.""" + relation_guid: Optional[str] = rest_field(name="relationGuid") + """The GUID of the relationship.""" + status: Optional[Union[str, "_models.AtlasTermRelationshipStatus"]] = rest_field() + """The status of term relationship. Known values are: \"DRAFT\", \"ACTIVE\", \"DEPRECATED\", + \"OBSOLETE\", and \"OTHER\".""" + + @overload + def __init__( + self, + *, + category_guid: Optional[str] = None, + description: Optional[str] = None, + display_text: Optional[str] = None, + relation_guid: Optional[str] = None, + status: Optional[Union[str, "_models.AtlasTermRelationshipStatus"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasTypeDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The definitions of type. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar entity_types: Specifying a list of entityType names in the classificationDef, ensures + that + classifications can + only be applied to those entityTypes. + + Any subtypes of the entity types inherit the restriction. + + Any classificationDef subtypes inherit the parents entityTypes restrictions. + + Any classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. + + An empty entityTypes list when there are no parent restrictions means there are no + restrictions. + + An empty entityTypes list when there are parent + restrictions means that the subtype picks up the parents + restrictions. + + If a list of entityTypes are supplied, where one inherits + from another, this will be rejected. This should encourage cleaner + classificationsDefs. + :vartype entity_types: list[str] + :ivar sub_types: An array of sub types. + :vartype sub_types: list[str] + :ivar super_types: An array of super types. + :vartype super_types: list[str] + :ivar relationship_attribute_defs: An array of relationship attributes. + :vartype relationship_attribute_defs: + list[~azure.purview.datamap.models.AtlasRelationshipAttributeDef] + :ivar default_value: The default value. + :vartype default_value: str + :ivar element_defs: An array of enum element definitions. + :vartype element_defs: list[~azure.purview.datamap.models.AtlasEnumElementDef] + :ivar end_def1: The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + :vartype end_def1: ~azure.purview.datamap.models.AtlasRelationshipEndDef + :ivar end_def2: The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship. + :vartype end_def2: ~azure.purview.datamap.models.AtlasRelationshipEndDef + :ivar relationship_category: The Relationship category determines the style of relationship + around + containment and lifecycle. + UML terminology is used for the values. + + ASSOCIATION is a relationship with no containment. + COMPOSITION and AGGREGATION are containment relationships. + + The difference being in the lifecycles of the container and its children. + In the COMPOSITION case, the children cannot exist without the container. + For AGGREGATION, the life cycles of the container and children are totally independent. Known + values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + :vartype relationship_category: str or ~azure.purview.datamap.models.RelationshipCategory + :ivar relationship_label: The label of the relationship. + :vartype relationship_label: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + entity_types: Optional[List[str]] = rest_field(name="entityTypes") + """Specifying a list of entityType names in the classificationDef, ensures that + classifications can + only be applied to those entityTypes. + + Any subtypes of the entity types inherit the restriction. + + Any classificationDef subtypes inherit the parents entityTypes restrictions. + + Any classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. + + An empty entityTypes list when there are no parent restrictions means there are no + restrictions. + + An empty entityTypes list when there are parent + restrictions means that the subtype picks up the parents + restrictions. + + If a list of entityTypes are supplied, where one inherits + from another, this will be rejected. This should encourage cleaner + classificationsDefs.""" + sub_types: Optional[List[str]] = rest_field(name="subTypes") + """An array of sub types.""" + super_types: Optional[List[str]] = rest_field(name="superTypes") + """An array of super types.""" + relationship_attribute_defs: Optional[List["_models.AtlasRelationshipAttributeDef"]] = rest_field( + name="relationshipAttributeDefs" + ) + """An array of relationship attributes.""" + default_value: Optional[str] = rest_field(name="defaultValue") + """The default value.""" + element_defs: Optional[List["_models.AtlasEnumElementDef"]] = rest_field(name="elementDefs") + """An array of enum element definitions.""" + end_def1: Optional["_models.AtlasRelationshipEndDef"] = rest_field(name="endDef1") + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship.""" + end_def2: Optional["_models.AtlasRelationshipEndDef"] = rest_field(name="endDef2") + """The relationshipEndDef represents an end of the relationship. The end of the + relationship is defined by a type, an + attribute name, cardinality and whether + it is the container end of the relationship.""" + relationship_category: Optional[Union[str, "_models.RelationshipCategory"]] = rest_field( + name="relationshipCategory" + ) + """The Relationship category determines the style of relationship around + containment and lifecycle. + UML terminology is used for the values. + + ASSOCIATION is a relationship with no containment. + COMPOSITION and AGGREGATION are containment relationships. + + The difference being in the lifecycles of the container and its children. + In the COMPOSITION case, the children cannot exist without the container. + For AGGREGATION, the life cycles of the container and children are totally independent. Known + values are: \"ASSOCIATION\", \"AGGREGATION\", and \"COMPOSITION\".""" + relationship_label: Optional[str] = rest_field(name="relationshipLabel") + """The label of the relationship.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + entity_types: Optional[List[str]] = None, + sub_types: Optional[List[str]] = None, + super_types: Optional[List[str]] = None, + relationship_attribute_defs: Optional[List["_models.AtlasRelationshipAttributeDef"]] = None, + default_value: Optional[str] = None, + element_defs: Optional[List["_models.AtlasEnumElementDef"]] = None, + end_def1: Optional["_models.AtlasRelationshipEndDef"] = None, + end_def2: Optional["_models.AtlasRelationshipEndDef"] = None, + relationship_category: Optional[Union[str, "_models.RelationshipCategory"]] = None, + relationship_label: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasTypeDefHeader(_model_base.Model): + """The basic information of the type definition. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AtlasTypesDef(_model_base.Model): + """The definitions of types. + + :ivar business_metadata_defs: businessMetadataDefs. + :vartype business_metadata_defs: list[~azure.purview.datamap.models.AtlasBusinessMetadataDef] + :ivar classification_defs: An array of classification definitions. + :vartype classification_defs: list[~azure.purview.datamap.models.AtlasClassificationDef] + :ivar entity_defs: An array of entity definitions. + :vartype entity_defs: list[~azure.purview.datamap.models.AtlasEntityDef] + :ivar enum_defs: An array of enum definitions. + :vartype enum_defs: list[~azure.purview.datamap.models.AtlasEnumDef] + :ivar relationship_defs: An array of relationship definitions. + :vartype relationship_defs: list[~azure.purview.datamap.models.AtlasRelationshipDef] + :ivar struct_defs: An array of struct definitions. + :vartype struct_defs: list[~azure.purview.datamap.models.AtlasStructDef] + :ivar term_template_defs: An array of term template definitions. + :vartype term_template_defs: list[~azure.purview.datamap.models.TermTemplateDef] + """ + + business_metadata_defs: Optional[List["_models.AtlasBusinessMetadataDef"]] = rest_field(name="businessMetadataDefs") + """businessMetadataDefs.""" + classification_defs: Optional[List["_models.AtlasClassificationDef"]] = rest_field(name="classificationDefs") + """An array of classification definitions.""" + entity_defs: Optional[List["_models.AtlasEntityDef"]] = rest_field(name="entityDefs") + """An array of entity definitions.""" + enum_defs: Optional[List["_models.AtlasEnumDef"]] = rest_field(name="enumDefs") + """An array of enum definitions.""" + relationship_defs: Optional[List["_models.AtlasRelationshipDef"]] = rest_field(name="relationshipDefs") + """An array of relationship definitions.""" + struct_defs: Optional[List["_models.AtlasStructDef"]] = rest_field(name="structDefs") + """An array of struct definitions.""" + term_template_defs: Optional[List["_models.TermTemplateDef"]] = rest_field(name="termTemplateDefs") + """An array of term template definitions.""" + + @overload + def __init__( + self, + *, + business_metadata_defs: Optional[List["_models.AtlasBusinessMetadataDef"]] = None, + classification_defs: Optional[List["_models.AtlasClassificationDef"]] = None, + entity_defs: Optional[List["_models.AtlasEntityDef"]] = None, + enum_defs: Optional[List["_models.AtlasEnumDef"]] = None, + relationship_defs: Optional[List["_models.AtlasRelationshipDef"]] = None, + struct_defs: Optional[List["_models.AtlasStructDef"]] = None, + term_template_defs: Optional[List["_models.TermTemplateDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AutoCompleteOptions(_model_base.Model): + """The payload of autocomplete request. + + :ivar keywords: The keywords applied to all fields that support autocomplete operation. It must + be at least 1 character, and no more than 100 characters. + :vartype keywords: str + :ivar limit: The number of autocomplete results we hope to return. The default value is 50. + The value must be a number between 1 and 100. + :vartype limit: int + :ivar filter: The filter for the autocomplete request. + :vartype filter: any + """ + + keywords: Optional[str] = rest_field() + """The keywords applied to all fields that support autocomplete operation. It must + be at least 1 character, and no more than 100 characters.""" + limit: Optional[int] = rest_field() + """The number of autocomplete results we hope to return. The default value is 50. + The value must be a number between 1 and 100.""" + filter: Optional[Any] = rest_field() + """The filter for the autocomplete request.""" + + @overload + def __init__( + self, + *, + keywords: Optional[str] = None, + limit: Optional[int] = None, + filter: Optional[Any] = None, # pylint: disable=redefined-builtin + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AutoCompleteResult(_model_base.Model): + """The result of the autocomplete request. + + :ivar value: The result value. + :vartype value: list[~azure.purview.datamap.models.AutoCompleteResultValue] + """ + + value: Optional[List["_models.AutoCompleteResultValue"]] = rest_field() + """The result value.""" + + @overload + def __init__( + self, + *, + value: Optional[List["_models.AutoCompleteResultValue"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class AutoCompleteResultValue(_model_base.Model): + """The value item of the autocomplete suggest. + + :ivar text: The completed term or phrase. + :vartype text: str + :ivar query_plus_text: The completed search query text. + :vartype query_plus_text: str + """ + + text: Optional[str] = rest_field() + """The completed term or phrase.""" + query_plus_text: Optional[str] = rest_field(name="queryPlusText") + """The completed search query text.""" + + @overload + def __init__( + self, + *, + text: Optional[str] = None, + query_plus_text: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class BulkImportResult(_model_base.Model): + """Bulk import result. + + :ivar failed_import_info_list: failed importInfoList. + :vartype failed_import_info_list: list[~azure.purview.datamap.models.ImportInfo] + :ivar success_import_info_list: successful importInfoList. + :vartype success_import_info_list: list[~azure.purview.datamap.models.ImportInfo] + """ + + failed_import_info_list: Optional[List["_models.ImportInfo"]] = rest_field(name="failedImportInfoList") + """failed importInfoList.""" + success_import_info_list: Optional[List["_models.ImportInfo"]] = rest_field(name="successImportInfoList") + """successful importInfoList.""" + + @overload + def __init__( + self, + *, + failed_import_info_list: Optional[List["_models.ImportInfo"]] = None, + success_import_info_list: Optional[List["_models.ImportInfo"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class BusinessMetadataOptions(_model_base.Model): + """Business metadata to send to the service. + + All required parameters must be populated in order to send to server. + + :ivar file: InputStream of file. Required. + :vartype file: bytes + """ + + file: FileType = rest_field(is_multipart_file_input=True) + """InputStream of file. Required.""" + + @overload + def __init__( + self, + *, + file: FileType, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ClassificationAssociateOptions(_model_base.Model): + """The request payload for classification association. + + :ivar classification: An instance of a classification; it doesn't have an identity, this object + exists only when associated with an entity. + :vartype classification: ~azure.purview.datamap.models.AtlasClassification + :ivar entity_guids: The GUID of the entity. + :vartype entity_guids: list[str] + """ + + classification: Optional["_models.AtlasClassification"] = rest_field() + """An instance of a classification; it doesn't have an identity, this object + exists only when associated with an entity.""" + entity_guids: Optional[List[str]] = rest_field(name="entityGuids") + """The GUID of the entity.""" + + @overload + def __init__( + self, + *, + classification: Optional["_models.AtlasClassification"] = None, + entity_guids: Optional[List[str]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ContactInfo(_model_base.Model): + """ContactInfo. + + :ivar id: Azure Active Directory object Id. + :vartype id: str + :ivar info: additional information to describe this contact. + :vartype info: str + """ + + id: Optional[str] = rest_field() + """Azure Active Directory object Id.""" + info: Optional[str] = rest_field() + """additional information to describe this contact.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + info: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ContactSearchResultValue(_model_base.Model): + """The contact in the search and suggest result. + + :ivar id: The GUID of the contact. + :vartype id: str + :ivar info: The description of the contact. + :vartype info: str + :ivar contact_type: The type of the contact. It can be Expert or Owner for an entity. It can be + Expert or Steward for a glossary term. + :vartype contact_type: str + """ + + id: Optional[str] = rest_field() + """The GUID of the contact.""" + info: Optional[str] = rest_field() + """The description of the contact.""" + contact_type: Optional[str] = rest_field(name="contactType") + """The type of the contact. It can be Expert or Owner for an entity. It can be + Expert or Steward for a glossary term.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + info: Optional[str] = None, + contact_type: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class DateFormat(_model_base.Model): + """The date format. + + :ivar available_locales: An array of available locales. + :vartype available_locales: list[str] + :ivar calendar: Calendar. + :vartype calendar: float + :ivar date_instance: The date format. + :vartype date_instance: ~azure.purview.datamap.models.DateFormat + :ivar date_time_instance: The date format. + :vartype date_time_instance: ~azure.purview.datamap.models.DateFormat + :ivar instance: The date format. + :vartype instance: ~azure.purview.datamap.models.DateFormat + :ivar lenient: Determines the leniency of the date format. + :vartype lenient: bool + :ivar number_format: The number format. + :vartype number_format: ~azure.purview.datamap.models.NumberFormat + :ivar time_instance: The date format. + :vartype time_instance: ~azure.purview.datamap.models.DateFormat + :ivar time_zone: The timezone information. + :vartype time_zone: ~azure.purview.datamap.models.TimeZone + """ + + available_locales: Optional[List[str]] = rest_field(name="availableLocales") + """An array of available locales.""" + calendar: Optional[float] = rest_field() + """Calendar.""" + date_instance: Optional["_models.DateFormat"] = rest_field(name="dateInstance") + """The date format.""" + date_time_instance: Optional["_models.DateFormat"] = rest_field(name="dateTimeInstance") + """The date format.""" + instance: Optional["_models.DateFormat"] = rest_field() + """The date format.""" + lenient: Optional[bool] = rest_field() + """Determines the leniency of the date format.""" + number_format: Optional["_models.NumberFormat"] = rest_field(name="numberFormat") + """The number format.""" + time_instance: Optional["_models.DateFormat"] = rest_field(name="timeInstance") + """The date format.""" + time_zone: Optional["_models.TimeZone"] = rest_field(name="timeZone") + """The timezone information.""" + + @overload + def __init__( + self, + *, + available_locales: Optional[List[str]] = None, + calendar: Optional[float] = None, + date_instance: Optional["_models.DateFormat"] = None, + date_time_instance: Optional["_models.DateFormat"] = None, + instance: Optional["_models.DateFormat"] = None, + lenient: Optional[bool] = None, + number_format: Optional["_models.NumberFormat"] = None, + time_instance: Optional["_models.DateFormat"] = None, + time_zone: Optional["_models.TimeZone"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class EntityMutationResult(_model_base.Model): + """The mutation response result of entity. + + :ivar guid_assignments: A map of GUID assignments with entities. + :vartype guid_assignments: dict[str, str] + :ivar mutated_entities: The entity headers of mutated entities. + :vartype mutated_entities: dict[str, list[~azure.purview.datamap.models.AtlasEntityHeader]] + :ivar partial_updated_entities: An array of entity headers that partially updated. + :vartype partial_updated_entities: list[~azure.purview.datamap.models.AtlasEntityHeader] + """ + + guid_assignments: Optional[Dict[str, str]] = rest_field(name="guidAssignments") + """A map of GUID assignments with entities.""" + mutated_entities: Optional[Dict[str, List["_models.AtlasEntityHeader"]]] = rest_field(name="mutatedEntities") + """The entity headers of mutated entities.""" + partial_updated_entities: Optional[List["_models.AtlasEntityHeader"]] = rest_field(name="partialUpdatedEntities") + """An array of entity headers that partially updated.""" + + @overload + def __init__( + self, + *, + guid_assignments: Optional[Dict[str, str]] = None, + mutated_entities: Optional[Dict[str, List["_models.AtlasEntityHeader"]]] = None, + partial_updated_entities: Optional[List["_models.AtlasEntityHeader"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ImportInfo(_model_base.Model): + """ImportInfo. + + :ivar child_object_name: childObjectName. + :vartype child_object_name: str + :ivar import_status: importStatus. Known values are: "SUCCESS" and "FAILED". + :vartype import_status: str or ~azure.purview.datamap.models.ImportStatus + :ivar parent_object_name: parentObjectName. + :vartype parent_object_name: str + :ivar remarks: remarks. + :vartype remarks: str + """ + + child_object_name: Optional[str] = rest_field(name="childObjectName") + """childObjectName.""" + import_status: Optional[Union[str, "_models.ImportStatus"]] = rest_field(name="importStatus") + """importStatus. Known values are: \"SUCCESS\" and \"FAILED\".""" + parent_object_name: Optional[str] = rest_field(name="parentObjectName") + """parentObjectName.""" + remarks: Optional[str] = rest_field() + """remarks.""" + + @overload + def __init__( + self, + *, + child_object_name: Optional[str] = None, + import_status: Optional[Union[str, "_models.ImportStatus"]] = None, + parent_object_name: Optional[str] = None, + remarks: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class LineageRelation(_model_base.Model): + """The lineage relation with GUID of the from and to entity. + + :ivar from_entity_id: The GUID of from-entity. + :vartype from_entity_id: str + :ivar relationship_id: The GUID of relationship. + :vartype relationship_id: str + :ivar to_entity_id: The GUID of to-entity. + :vartype to_entity_id: str + """ + + from_entity_id: Optional[str] = rest_field(name="fromEntityId") + """The GUID of from-entity.""" + relationship_id: Optional[str] = rest_field(name="relationshipId") + """The GUID of relationship.""" + to_entity_id: Optional[str] = rest_field(name="toEntityId") + """The GUID of to-entity.""" + + @overload + def __init__( + self, + *, + from_entity_id: Optional[str] = None, + relationship_id: Optional[str] = None, + to_entity_id: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class MoveEntitiesOptions(_model_base.Model): + """MoveEntitiesOptions. + + :ivar entity_guids: An array of entity guids to be moved to target collection. + :vartype entity_guids: list[str] + """ + + entity_guids: Optional[List[str]] = rest_field(name="entityGuids") + """An array of entity guids to be moved to target collection.""" + + @overload + def __init__( + self, + *, + entity_guids: Optional[List[str]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class NumberFormat(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The number format. + + :ivar available_locales: The number format. + :vartype available_locales: list[str] + :ivar currency: The currency. + :vartype currency: str + :ivar currency_instance: The number format. + :vartype currency_instance: ~azure.purview.datamap.models.NumberFormat + :ivar grouping_used: Determines if grouping is used. + :vartype grouping_used: bool + :ivar instance: The number format. + :vartype instance: ~azure.purview.datamap.models.NumberFormat + :ivar integer_instance: The number format. + :vartype integer_instance: ~azure.purview.datamap.models.NumberFormat + :ivar maximum_fraction_digits: The maximum of fraction digits. + :vartype maximum_fraction_digits: int + :ivar maximum_integer_digits: The maximum of integer digits. + :vartype maximum_integer_digits: int + :ivar minimum_fraction_digits: The minimum of fraction digits. + :vartype minimum_fraction_digits: int + :ivar minimum_integer_digits: The minimum of integer digits. + :vartype minimum_integer_digits: int + :ivar number_instance: The number format. + :vartype number_instance: ~azure.purview.datamap.models.NumberFormat + :ivar parse_integer_only: Determines if only integer is parsed. + :vartype parse_integer_only: bool + :ivar percent_instance: The number format. + :vartype percent_instance: ~azure.purview.datamap.models.NumberFormat + :ivar rounding_mode: The enum of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + :vartype rounding_mode: str or ~azure.purview.datamap.models.RoundingMode + """ + + available_locales: Optional[List[str]] = rest_field(name="availableLocales") + """The number format.""" + currency: Optional[str] = rest_field() + """The currency.""" + currency_instance: Optional["_models.NumberFormat"] = rest_field(name="currencyInstance") + """The number format.""" + grouping_used: Optional[bool] = rest_field(name="groupingUsed") + """Determines if grouping is used.""" + instance: Optional["_models.NumberFormat"] = rest_field() + """The number format.""" + integer_instance: Optional["_models.NumberFormat"] = rest_field(name="integerInstance") + """The number format.""" + maximum_fraction_digits: Optional[int] = rest_field(name="maximumFractionDigits") + """The maximum of fraction digits.""" + maximum_integer_digits: Optional[int] = rest_field(name="maximumIntegerDigits") + """The maximum of integer digits.""" + minimum_fraction_digits: Optional[int] = rest_field(name="minimumFractionDigits") + """The minimum of fraction digits.""" + minimum_integer_digits: Optional[int] = rest_field(name="minimumIntegerDigits") + """The minimum of integer digits.""" + number_instance: Optional["_models.NumberFormat"] = rest_field(name="numberInstance") + """The number format.""" + parse_integer_only: Optional[bool] = rest_field(name="parseIntegerOnly") + """Determines if only integer is parsed.""" + percent_instance: Optional["_models.NumberFormat"] = rest_field(name="percentInstance") + """The number format.""" + rounding_mode: Optional[Union[str, "_models.RoundingMode"]] = rest_field(name="roundingMode") + """The enum of rounding mode. Known values are: \"UP\", \"DOWN\", \"CEILING\", \"FLOOR\", + \"HALF_UP\", \"HALF_DOWN\", \"HALF_EVEN\", and \"UNNECESSARY\".""" + + @overload + def __init__( + self, + *, + available_locales: Optional[List[str]] = None, + currency: Optional[str] = None, + currency_instance: Optional["_models.NumberFormat"] = None, + grouping_used: Optional[bool] = None, + instance: Optional["_models.NumberFormat"] = None, + integer_instance: Optional["_models.NumberFormat"] = None, + maximum_fraction_digits: Optional[int] = None, + maximum_integer_digits: Optional[int] = None, + minimum_fraction_digits: Optional[int] = None, + minimum_integer_digits: Optional[int] = None, + number_instance: Optional["_models.NumberFormat"] = None, + parse_integer_only: Optional[bool] = None, + percent_instance: Optional["_models.NumberFormat"] = None, + rounding_mode: Optional[Union[str, "_models.RoundingMode"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ParentRelation(_model_base.Model): + """The lineage parents relation with GUID of the parent entity and to child entity. + + :ivar child_entity_id: The GUID of child entity. + :vartype child_entity_id: str + :ivar relationship_id: The GUID of relationship. + :vartype relationship_id: str + :ivar parent_entity_id: The GUID of parent entity. + :vartype parent_entity_id: str + """ + + child_entity_id: Optional[str] = rest_field(name="childEntityId") + """The GUID of child entity.""" + relationship_id: Optional[str] = rest_field(name="relationshipId") + """The GUID of relationship.""" + parent_entity_id: Optional[str] = rest_field(name="parentEntityId") + """The GUID of parent entity.""" + + @overload + def __init__( + self, + *, + child_entity_id: Optional[str] = None, + relationship_id: Optional[str] = None, + parent_entity_id: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class PurviewObjectId(_model_base.Model): + """PurviewObjectId. + + :ivar guid: The GUID of the object. + :vartype guid: str + :ivar type_name: The name of the type. + :vartype type_name: str + :ivar unique_attributes: The unique attributes of the object. + :vartype unique_attributes: dict[str, any] + :ivar name: Name. + :vartype name: str + :ivar display_text: Display text. + :vartype display_text: str + :ivar item_path: Item path. + :vartype item_path: str + :ivar resource_id: Resource Id. + :vartype resource_id: str + :ivar properties: Dictionary of :code:``. + :vartype properties: dict[str, any] + """ + + guid: Optional[str] = rest_field() + """The GUID of the object.""" + type_name: Optional[str] = rest_field(name="typeName") + """The name of the type.""" + unique_attributes: Optional[Dict[str, Any]] = rest_field(name="uniqueAttributes") + """The unique attributes of the object.""" + name: Optional[str] = rest_field() + """Name.""" + display_text: Optional[str] = rest_field(name="displayText") + """Display text.""" + item_path: Optional[str] = rest_field(name="itemPath") + """Item path.""" + resource_id: Optional[str] = rest_field(name="resourceId") + """Resource Id.""" + properties: Optional[Dict[str, Any]] = rest_field() + """Dictionary of :code:``.""" + + @overload + def __init__( + self, + *, + guid: Optional[str] = None, + type_name: Optional[str] = None, + unique_attributes: Optional[Dict[str, Any]] = None, + name: Optional[str] = None, + display_text: Optional[str] = None, + item_path: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional[Dict[str, Any]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class QueryOptions(_model_base.Model): + """The search query of advanced search request. + + :ivar keywords: The keywords applied to all searchable fields. + :vartype keywords: str + :ivar limit: The limit of the number of the search result. default value is 50; maximum + value is 1000. + :vartype limit: int + :ivar continuation_token: The token used to get next batch of data. Default 'Null' to get the + first + batch, and will return new token in each response unless there's no more data. + :vartype continuation_token: str + :ivar orderby: The sort order of search results, can specify multiple fields. + :vartype orderby: list[any] + :ivar filter: The filter for the search. See examples for the usage of supported filters. + :vartype filter: any + :ivar facets: The facets for search. See examples for the usage of supported facets. + :vartype facets: list[~azure.purview.datamap.models.SearchFacetItem] + :ivar taxonomy_setting: The taxonomy setting for search. + :vartype taxonomy_setting: ~azure.purview.datamap.models.SearchTaxonomySetting + """ + + keywords: Optional[str] = rest_field() + """The keywords applied to all searchable fields.""" + limit: Optional[int] = rest_field() + """The limit of the number of the search result. default value is 50; maximum + value is 1000.""" + continuation_token: Optional[str] = rest_field(name="continuationToken") + """The token used to get next batch of data. Default 'Null' to get the first + batch, and will return new token in each response unless there's no more data.""" + orderby: Optional[List[Any]] = rest_field() + """The sort order of search results, can specify multiple fields.""" + filter: Optional[Any] = rest_field() + """The filter for the search. See examples for the usage of supported filters.""" + facets: Optional[List["_models.SearchFacetItem"]] = rest_field() + """The facets for search. See examples for the usage of supported facets.""" + taxonomy_setting: Optional["_models.SearchTaxonomySetting"] = rest_field(name="taxonomySetting") + """The taxonomy setting for search.""" + + @overload + def __init__( + self, + *, + keywords: Optional[str] = None, + limit: Optional[int] = None, + continuation_token: Optional[str] = None, + orderby: Optional[List[Any]] = None, + filter: Optional[Any] = None, # pylint: disable=redefined-builtin + facets: Optional[List["_models.SearchFacetItem"]] = None, + taxonomy_setting: Optional["_models.SearchTaxonomySetting"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class QueryResult(_model_base.Model): + """The result of the search result. + + :ivar search_count: The total number of search results (not the number of documents in a single + page). + :vartype search_count: int + :ivar search_count_approximate: 'True' if the '@search.count' is an approximate value and vise + versa. + :vartype search_count_approximate: bool + :ivar continuation_token: The token used to get next batch of data. Absent if there's no more + data. + :vartype continuation_token: str + :ivar search_facets: A facet list that consists of index fields assetType ,classification, + contactId, and label. When the facet is specified in the request, the value of + the facet is returned as an element of @search.facets. + :vartype search_facets: ~azure.purview.datamap.models.SearchFacetResultValue + :ivar value: Search result value. + :vartype value: list[~azure.purview.datamap.models.SearchResultValue] + """ + + search_count: Optional[int] = rest_field(name="@search.count") + """The total number of search results (not the number of documents in a single + page).""" + search_count_approximate: Optional[bool] = rest_field(name="@search.count.approximate") + """'True' if the '@search.count' is an approximate value and vise versa.""" + continuation_token: Optional[str] = rest_field(name="continuationToken") + """The token used to get next batch of data. Absent if there's no more data.""" + search_facets: Optional["_models.SearchFacetResultValue"] = rest_field(name="@search.facets") + """A facet list that consists of index fields assetType ,classification, + contactId, and label. When the facet is specified in the request, the value of + the facet is returned as an element of @search.facets.""" + value: Optional[List["_models.SearchResultValue"]] = rest_field() + """Search result value.""" + + @overload + def __init__( + self, + *, + search_count: Optional[int] = None, + search_count_approximate: Optional[bool] = None, + continuation_token: Optional[str] = None, + search_facets: Optional["_models.SearchFacetResultValue"] = None, + value: Optional[List["_models.SearchResultValue"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class ResourceLink(_model_base.Model): + """ResourceLink. + + :ivar display_name: Display name for url. + :vartype display_name: str + :ivar url: web url. http or https. + :vartype url: str + """ + + display_name: Optional[str] = rest_field(name="displayName") + """Display name for url.""" + url: Optional[str] = rest_field() + """web url. http or https.""" + + @overload + def __init__( + self, + *, + display_name: Optional[str] = None, + url: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchFacetItem(_model_base.Model): + """The content of a search facet result item. + + :ivar count: The count of the facet item. + :vartype count: int + :ivar facet: The name of the facet item. + :vartype facet: str + :ivar sort: Define the sorting criteria for items. + :vartype sort: ~azure.purview.datamap.models.SearchFacetSort + """ + + count: Optional[int] = rest_field() + """The count of the facet item.""" + facet: Optional[str] = rest_field() + """The name of the facet item.""" + sort: Optional["_models.SearchFacetSort"] = rest_field() + """Define the sorting criteria for items.""" + + @overload + def __init__( + self, + *, + count: Optional[int] = None, + facet: Optional[str] = None, + sort: Optional["_models.SearchFacetSort"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchFacetItemValue(_model_base.Model): + """The content of a search facet result item. + + :ivar count: The count of the facet item. + :vartype count: int + :ivar value: The name of the facet item. + :vartype value: str + """ + + count: Optional[int] = rest_field() + """The count of the facet item.""" + value: Optional[str] = rest_field() + """The name of the facet item.""" + + @overload + def __init__( + self, + *, + count: Optional[int] = None, + value: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchFacetResultValue(_model_base.Model): + """A facet list that consists of index fields assetType ,classification, + contactId, and label. When the facet is specified in the request, the value of + the facet is returned as an element of @search.facets. + + :ivar entity_type: Entity type. + :vartype entity_type: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar asset_type: Asset type. + :vartype asset_type: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar classification: Classification. + :vartype classification: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar term: Term. + :vartype term: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar contact_id: Contact id. + :vartype contact_id: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar contact_type: Contact type. + :vartype contact_type: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar label: Label. + :vartype label: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar glossary_type: Glossary type. + :vartype glossary_type: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar term_status: Term status. + :vartype term_status: list[~azure.purview.datamap.models.SearchFacetItemValue] + :ivar term_template: Term template. + :vartype term_template: list[~azure.purview.datamap.models.SearchFacetItemValue] + """ + + entity_type: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="entityType") + """Entity type.""" + asset_type: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="assetType") + """Asset type.""" + classification: Optional[List["_models.SearchFacetItemValue"]] = rest_field() + """Classification.""" + term: Optional[List["_models.SearchFacetItemValue"]] = rest_field() + """Term.""" + contact_id: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="contactId") + """Contact id.""" + contact_type: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="contactType") + """Contact type.""" + label: Optional[List["_models.SearchFacetItemValue"]] = rest_field() + """Label.""" + glossary_type: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="glossaryType") + """Glossary type.""" + term_status: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="termStatus") + """Term status.""" + term_template: Optional[List["_models.SearchFacetItemValue"]] = rest_field(name="termTemplate") + """Term template.""" + + @overload + def __init__( + self, + *, + entity_type: Optional[List["_models.SearchFacetItemValue"]] = None, + asset_type: Optional[List["_models.SearchFacetItemValue"]] = None, + classification: Optional[List["_models.SearchFacetItemValue"]] = None, + term: Optional[List["_models.SearchFacetItemValue"]] = None, + contact_id: Optional[List["_models.SearchFacetItemValue"]] = None, + contact_type: Optional[List["_models.SearchFacetItemValue"]] = None, + label: Optional[List["_models.SearchFacetItemValue"]] = None, + glossary_type: Optional[List["_models.SearchFacetItemValue"]] = None, + term_status: Optional[List["_models.SearchFacetItemValue"]] = None, + term_template: Optional[List["_models.SearchFacetItemValue"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchFacetSort(_model_base.Model): + """The sorting criteria. + + :ivar count: Order by count. Known values are: "asc" and "desc". + :vartype count: str or ~azure.purview.datamap.models.SearchSortOrder + :ivar value: Order by value. Known values are: "asc" and "desc". + :vartype value: str or ~azure.purview.datamap.models.SearchSortOrder + """ + + count: Optional[Union[str, "_models.SearchSortOrder"]] = rest_field() + """Order by count. Known values are: \"asc\" and \"desc\".""" + value: Optional[Union[str, "_models.SearchSortOrder"]] = rest_field() + """Order by value. Known values are: \"asc\" and \"desc\".""" + + @overload + def __init__( + self, + *, + count: Optional[Union[str, "_models.SearchSortOrder"]] = None, + value: Optional[Union[str, "_models.SearchSortOrder"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchHighlights(_model_base.Model): + """A highlight list that consists of index fields id ,qualifiedName, name, + description, entityType. When the keyword appears in those fields, the value of + the field, attached with emphasis mark, is returned as an element of + @search.highlights. + + :ivar id: Id. + :vartype id: list[str] + :ivar qualified_name: Qualified name. + :vartype qualified_name: list[str] + :ivar name: Name. + :vartype name: list[str] + :ivar description: Description. + :vartype description: list[str] + :ivar entity_type: Entity type. + :vartype entity_type: list[str] + """ + + id: Optional[List[str]] = rest_field() + """Id.""" + qualified_name: Optional[List[str]] = rest_field(name="qualifiedName") + """Qualified name.""" + name: Optional[List[str]] = rest_field() + """Name.""" + description: Optional[List[str]] = rest_field() + """Description.""" + entity_type: Optional[List[str]] = rest_field(name="entityType") + """Entity type.""" + + @overload + def __init__( + self, + *, + id: Optional[List[str]] = None, # pylint: disable=redefined-builtin + qualified_name: Optional[List[str]] = None, + name: Optional[List[str]] = None, + description: Optional[List[str]] = None, + entity_type: Optional[List[str]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchResultValue(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The value item of the search result. + + :ivar search_score: The search score calculated by the search engine. The results are ordered + by + search score by default. + :vartype search_score: float + :ivar search_highlights: A highlight list that consists of index fields id ,qualifiedName, + name, + description, entityType. When the keyword appears in those fields, the value of + the field, attached with emphasis mark, is returned as an element of + @search.highlights. + :vartype search_highlights: ~azure.purview.datamap.models.SearchHighlights + :ivar object_type: The object type of the record. Object type is the top-level property to + distinguish whether a record is an asset or a term. + :vartype object_type: str + :ivar create_time: The create time of the record. The Unix epoch format. + :vartype create_time: int + :ivar update_time: The last update time of the record. The Unix epoch format. + :vartype update_time: int + :ivar id: The GUID of the record. + :vartype id: str + :ivar name: The name of the record. + :vartype name: str + :ivar qualified_name: The qualified name of the record. + :vartype qualified_name: str + :ivar entity_type: The type name of the asset. + :vartype entity_type: str + :ivar description: The description of the asset. + :vartype description: str + :ivar endorsement: The endorsement of the asset. + :vartype endorsement: str + :ivar owner: The owner of the record. + :vartype owner: str + :ivar classification: The classifications of the record. + :vartype classification: list[str] + :ivar label: The labels of the asset. + :vartype label: list[str] + :ivar term: The terms assigned to the asset. + :vartype term: list[~azure.purview.datamap.models.TermSearchResultValue] + :ivar contact: The contacts of the asset. + :vartype contact: list[~azure.purview.datamap.models.ContactSearchResultValue] + :ivar asset_type: The asset types of the asset. + :vartype asset_type: list[str] + :ivar glossary_type: The type name of the term. Could be AtlasGlossary, AtlasGlossaryTerm or + AtlasGlossaryCategory. + :vartype glossary_type: str + :ivar glossary: The glossary name of the term. + :vartype glossary: str + :ivar term_status: The status of the term. + :vartype term_status: str + :ivar term_template: The term template names used by the term. + :vartype term_template: list[str] + :ivar long_description: The definition of the term. + :vartype long_description: str + """ + + search_score: Optional[float] = rest_field(name="@search.score") + """The search score calculated by the search engine. The results are ordered by + search score by default.""" + search_highlights: Optional["_models.SearchHighlights"] = rest_field(name="@search.highlights") + """A highlight list that consists of index fields id ,qualifiedName, name, + description, entityType. When the keyword appears in those fields, the value of + the field, attached with emphasis mark, is returned as an element of + @search.highlights.""" + object_type: Optional[str] = rest_field(name="objectType") + """The object type of the record. Object type is the top-level property to + distinguish whether a record is an asset or a term.""" + create_time: Optional[int] = rest_field(name="createTime") + """The create time of the record. The Unix epoch format.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The last update time of the record. The Unix epoch format.""" + id: Optional[str] = rest_field() + """The GUID of the record.""" + name: Optional[str] = rest_field() + """The name of the record.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the record.""" + entity_type: Optional[str] = rest_field(name="entityType") + """The type name of the asset.""" + description: Optional[str] = rest_field() + """The description of the asset.""" + endorsement: Optional[str] = rest_field() + """The endorsement of the asset.""" + owner: Optional[str] = rest_field() + """The owner of the record.""" + classification: Optional[List[str]] = rest_field() + """The classifications of the record.""" + label: Optional[List[str]] = rest_field() + """The labels of the asset.""" + term: Optional[List["_models.TermSearchResultValue"]] = rest_field() + """The terms assigned to the asset.""" + contact: Optional[List["_models.ContactSearchResultValue"]] = rest_field() + """The contacts of the asset.""" + asset_type: Optional[List[str]] = rest_field(name="assetType") + """The asset types of the asset.""" + glossary_type: Optional[str] = rest_field(name="glossaryType") + """The type name of the term. Could be AtlasGlossary, AtlasGlossaryTerm or + AtlasGlossaryCategory.""" + glossary: Optional[str] = rest_field() + """The glossary name of the term.""" + term_status: Optional[str] = rest_field(name="termStatus") + """The status of the term.""" + term_template: Optional[List[str]] = rest_field(name="termTemplate") + """The term template names used by the term.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The definition of the term.""" + + @overload + def __init__( + self, + *, + search_score: Optional[float] = None, + search_highlights: Optional["_models.SearchHighlights"] = None, + object_type: Optional[str] = None, + create_time: Optional[int] = None, + update_time: Optional[int] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + qualified_name: Optional[str] = None, + entity_type: Optional[str] = None, + description: Optional[str] = None, + endorsement: Optional[str] = None, + owner: Optional[str] = None, + classification: Optional[List[str]] = None, + label: Optional[List[str]] = None, + term: Optional[List["_models.TermSearchResultValue"]] = None, + contact: Optional[List["_models.ContactSearchResultValue"]] = None, + asset_type: Optional[List[str]] = None, + glossary_type: Optional[str] = None, + glossary: Optional[str] = None, + term_status: Optional[str] = None, + term_template: Optional[List[str]] = None, + long_description: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SearchTaxonomySetting(_model_base.Model): + """Taxonomy setting for search request. + + :ivar asset_types: Asset types. + :vartype asset_types: list[str] + :ivar facet: The content of a search facet result item. + :vartype facet: ~azure.purview.datamap.models.SearchFacetItem + """ + + asset_types: Optional[List[str]] = rest_field(name="assetTypes") + """Asset types.""" + facet: Optional["_models.SearchFacetItem"] = rest_field() + """The content of a search facet result item.""" + + @overload + def __init__( + self, + *, + asset_types: Optional[List[str]] = None, + facet: Optional["_models.SearchFacetItem"] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SuggestOptions(_model_base.Model): + """The payload of suggest request. + + :ivar keywords: The keywords applied to all fields that support suggest operation. It must be + at least 1 character, and no more than 100 characters. In the index schema we + defined a default suggester which lists all the supported fields and specifies + a search mode. + :vartype keywords: str + :ivar limit: The number of suggestions we hope to return. The default value is 5. The value + must be a number between 1 and 100. + :vartype limit: int + :ivar filter: The filter for the search. + :vartype filter: any + """ + + keywords: Optional[str] = rest_field() + """The keywords applied to all fields that support suggest operation. It must be + at least 1 character, and no more than 100 characters. In the index schema we + defined a default suggester which lists all the supported fields and specifies + a search mode.""" + limit: Optional[int] = rest_field() + """The number of suggestions we hope to return. The default value is 5. The value + must be a number between 1 and 100.""" + filter: Optional[Any] = rest_field() + """The filter for the search.""" + + @overload + def __init__( + self, + *, + keywords: Optional[str] = None, + limit: Optional[int] = None, + filter: Optional[Any] = None, # pylint: disable=redefined-builtin + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SuggestResult(_model_base.Model): + """The result item of the search suggest. + + :ivar value: The result value. + :vartype value: list[~azure.purview.datamap.models.SuggestResultValue] + """ + + value: Optional[List["_models.SuggestResultValue"]] = rest_field() + """The result value.""" + + @overload + def __init__( + self, + *, + value: Optional[List["_models.SuggestResultValue"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SuggestResultValue(_model_base.Model): # pylint: disable=too-many-instance-attributes + """The value item of the search suggest. + + :ivar search_score: The search score calculated by the search engine. The results are ordered + by + search score by default. + :vartype search_score: float + :ivar search_text: The target text that contains the keyword as prefix. The keyword is wrapped + with emphasis mark. + :vartype search_text: str + :ivar object_type: The object type of the record. Object type is the top-level property to + distinguish whether a record is an asset or a term. + :vartype object_type: str + :ivar create_time: The create time of the record. The Unix epoch format. + :vartype create_time: int + :ivar update_time: The last update time of the record. The Unix epoch format. + :vartype update_time: int + :ivar id: The GUID of the record. + :vartype id: str + :ivar name: The name of the record. + :vartype name: str + :ivar qualified_name: The qualified name of the record. + :vartype qualified_name: str + :ivar entity_type: The type name of the asset. + :vartype entity_type: str + :ivar description: The description of the asset. + :vartype description: str + :ivar endorsement: The endorsement of the asset. + :vartype endorsement: str + :ivar owner: The owner of the record. + :vartype owner: str + :ivar classification: The classifications of the record. + :vartype classification: list[str] + :ivar label: The labels of the asset. + :vartype label: list[str] + :ivar term: The terms assigned to the asset. + :vartype term: list[~azure.purview.datamap.models.TermSearchResultValue] + :ivar contact: The contacts of the asset. + :vartype contact: list[~azure.purview.datamap.models.ContactSearchResultValue] + :ivar asset_type: The asset types of the asset. + :vartype asset_type: list[str] + :ivar glossary_type: The type name of the term. Could be AtlasGlossary, AtlasGlossaryTerm or + AtlasGlossaryCategory. + :vartype glossary_type: str + :ivar glossary: The glossary name of the term. + :vartype glossary: str + :ivar term_status: The status of the term. + :vartype term_status: str + :ivar term_template: The term template names used by the term. + :vartype term_template: list[str] + :ivar long_description: The definition of the term. + :vartype long_description: str + """ + + search_score: Optional[float] = rest_field(name="@search.score") + """The search score calculated by the search engine. The results are ordered by + search score by default.""" + search_text: Optional[str] = rest_field(name="@search.text") + """The target text that contains the keyword as prefix. The keyword is wrapped + with emphasis mark.""" + object_type: Optional[str] = rest_field(name="objectType") + """The object type of the record. Object type is the top-level property to + distinguish whether a record is an asset or a term.""" + create_time: Optional[int] = rest_field(name="createTime") + """The create time of the record. The Unix epoch format.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The last update time of the record. The Unix epoch format.""" + id: Optional[str] = rest_field() + """The GUID of the record.""" + name: Optional[str] = rest_field() + """The name of the record.""" + qualified_name: Optional[str] = rest_field(name="qualifiedName") + """The qualified name of the record.""" + entity_type: Optional[str] = rest_field(name="entityType") + """The type name of the asset.""" + description: Optional[str] = rest_field() + """The description of the asset.""" + endorsement: Optional[str] = rest_field() + """The endorsement of the asset.""" + owner: Optional[str] = rest_field() + """The owner of the record.""" + classification: Optional[List[str]] = rest_field() + """The classifications of the record.""" + label: Optional[List[str]] = rest_field() + """The labels of the asset.""" + term: Optional[List["_models.TermSearchResultValue"]] = rest_field() + """The terms assigned to the asset.""" + contact: Optional[List["_models.ContactSearchResultValue"]] = rest_field() + """The contacts of the asset.""" + asset_type: Optional[List[str]] = rest_field(name="assetType") + """The asset types of the asset.""" + glossary_type: Optional[str] = rest_field(name="glossaryType") + """The type name of the term. Could be AtlasGlossary, AtlasGlossaryTerm or + AtlasGlossaryCategory.""" + glossary: Optional[str] = rest_field() + """The glossary name of the term.""" + term_status: Optional[str] = rest_field(name="termStatus") + """The status of the term.""" + term_template: Optional[List[str]] = rest_field(name="termTemplate") + """The term template names used by the term.""" + long_description: Optional[str] = rest_field(name="longDescription") + """The definition of the term.""" + + @overload + def __init__( + self, + *, + search_score: Optional[float] = None, + search_text: Optional[str] = None, + object_type: Optional[str] = None, + create_time: Optional[int] = None, + update_time: Optional[int] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + qualified_name: Optional[str] = None, + entity_type: Optional[str] = None, + description: Optional[str] = None, + endorsement: Optional[str] = None, + owner: Optional[str] = None, + classification: Optional[List[str]] = None, + label: Optional[List[str]] = None, + term: Optional[List["_models.TermSearchResultValue"]] = None, + contact: Optional[List["_models.ContactSearchResultValue"]] = None, + asset_type: Optional[List[str]] = None, + glossary_type: Optional[str] = None, + glossary: Optional[str] = None, + term_status: Optional[str] = None, + term_template: Optional[List[str]] = None, + long_description: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class TermSearchResultValue(_model_base.Model): + """The context. + + :ivar name: The name of the term. + :vartype name: str + :ivar glossary_name: The name of the glossary which contains the term. + :vartype glossary_name: str + :ivar guid: The GUID of the term. + :vartype guid: str + """ + + name: Optional[str] = rest_field() + """The name of the term.""" + glossary_name: Optional[str] = rest_field(name="glossaryName") + """The name of the glossary which contains the term.""" + guid: Optional[str] = rest_field() + """The GUID of the term.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + glossary_name: Optional[str] = None, + guid: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class TermTemplateDef(_model_base.Model): # pylint: disable=too-many-instance-attributes + """Term template definition for glossary term. + + :ivar category: The enum of type category. Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", + "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + :vartype category: str or ~azure.purview.datamap.models.TypeCategory + :ivar create_time: The created time of the record. + :vartype create_time: int + :ivar created_by: The user who created the record. + :vartype created_by: str + :ivar date_formatter: The date format. + :vartype date_formatter: ~azure.purview.datamap.models.DateFormat + :ivar description: The description of the type definition. + :vartype description: str + :ivar guid: The GUID of the type definition. + :vartype guid: str + :ivar name: The name of the type definition. + :vartype name: str + :ivar options: The options for the type definition. + :vartype options: dict[str, str] + :ivar service_type: The service type. + :vartype service_type: str + :ivar type_version: The version of the type. + :vartype type_version: str + :ivar update_time: The update time of the record. + :vartype update_time: int + :ivar updated_by: The user who updated the record. + :vartype updated_by: str + :ivar version: The version of the record. + :vartype version: int + :ivar last_modified_t_s: ETag for concurrency control. + :vartype last_modified_t_s: str + :ivar attribute_defs: An array of attribute definitions. + :vartype attribute_defs: list[~azure.purview.datamap.models.AtlasAttributeDef] + """ + + category: Optional[Union[str, "_models.TypeCategory"]] = rest_field() + """The enum of type category. Known values are: \"PRIMITIVE\", \"OBJECT_ID_TYPE\", \"ENUM\", + \"STRUCT\", \"CLASSIFICATION\", \"ENTITY\", \"ARRAY\", \"MAP\", \"RELATIONSHIP\", and + \"TERM_TEMPLATE\".""" + create_time: Optional[int] = rest_field(name="createTime") + """The created time of the record.""" + created_by: Optional[str] = rest_field(name="createdBy") + """The user who created the record.""" + date_formatter: Optional["_models.DateFormat"] = rest_field(name="dateFormatter") + """The date format.""" + description: Optional[str] = rest_field() + """The description of the type definition.""" + guid: Optional[str] = rest_field() + """The GUID of the type definition.""" + name: Optional[str] = rest_field() + """The name of the type definition.""" + options: Optional[Dict[str, str]] = rest_field() + """The options for the type definition.""" + service_type: Optional[str] = rest_field(name="serviceType") + """The service type.""" + type_version: Optional[str] = rest_field(name="typeVersion") + """The version of the type.""" + update_time: Optional[int] = rest_field(name="updateTime") + """The update time of the record.""" + updated_by: Optional[str] = rest_field(name="updatedBy") + """The user who updated the record.""" + version: Optional[int] = rest_field() + """The version of the record.""" + last_modified_t_s: Optional[str] = rest_field(name="lastModifiedTS") + """ETag for concurrency control.""" + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = rest_field(name="attributeDefs") + """An array of attribute definitions.""" + + @overload + def __init__( + self, + *, + category: Optional[Union[str, "_models.TypeCategory"]] = None, + create_time: Optional[int] = None, + created_by: Optional[str] = None, + date_formatter: Optional["_models.DateFormat"] = None, + description: Optional[str] = None, + guid: Optional[str] = None, + name: Optional[str] = None, + options: Optional[Dict[str, str]] = None, + service_type: Optional[str] = None, + type_version: Optional[str] = None, + update_time: Optional[int] = None, + updated_by: Optional[str] = None, + version: Optional[int] = None, + last_modified_t_s: Optional[str] = None, + attribute_defs: Optional[List["_models.AtlasAttributeDef"]] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class TimeBoundary(_model_base.Model): + """Captures time-boundary details. + + :ivar end_time: The end of the time boundary. + :vartype end_time: str + :ivar start_time: The start of the time boundary. + :vartype start_time: str + :ivar time_zone: The timezone of the time boundary. + :vartype time_zone: str + """ + + end_time: Optional[str] = rest_field(name="endTime") + """The end of the time boundary.""" + start_time: Optional[str] = rest_field(name="startTime") + """The start of the time boundary.""" + time_zone: Optional[str] = rest_field(name="timeZone") + """The timezone of the time boundary.""" + + @overload + def __init__( + self, + *, + end_time: Optional[str] = None, + start_time: Optional[str] = None, + time_zone: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class TimeZone(_model_base.Model): + """The timezone information. + + :ivar dst_savings: The value of the daylight saving time. + :vartype dst_savings: int + :ivar id: The ID of the timezone. + :vartype id: str + :ivar available_ids: An array of available IDs. + :vartype available_ids: list[str] + :ivar default: The timezone information. + :vartype default: ~azure.purview.datamap.models.TimeZone + :ivar display_name: The display name of the timezone. + :vartype display_name: str + :ivar raw_offset: The raw offset of the timezone. + :vartype raw_offset: int + """ + + dst_savings: Optional[int] = rest_field(name="dstSavings") + """The value of the daylight saving time.""" + id: Optional[str] = rest_field() + """The ID of the timezone.""" + available_ids: Optional[List[str]] = rest_field(name="availableIds") + """An array of available IDs.""" + default: Optional["_models.TimeZone"] = rest_field() + """The timezone information.""" + display_name: Optional[str] = rest_field(name="displayName") + """The display name of the timezone.""" + raw_offset: Optional[int] = rest_field(name="rawOffset") + """The raw offset of the timezone.""" + + @overload + def __init__( + self, + *, + dst_savings: Optional[int] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + available_ids: Optional[List[str]] = None, + default: Optional["_models.TimeZone"] = None, + display_name: Optional[str] = None, + raw_offset: Optional[int] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_patch.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/__init__.py new file mode 100644 index 000000000000..f87703413c74 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import EntityOperations +from ._operations import GlossaryOperations +from ._operations import DiscoveryOperations +from ._operations import LineageOperations +from ._operations import RelationshipOperations +from ._operations import TypeDefinitionOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EntityOperations", + "GlossaryOperations", + "DiscoveryOperations", + "LineageOperations", + "RelationshipOperations", + "TypeDefinitionOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py new file mode 100644 index 000000000000..2dbd9c71546a --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py @@ -0,0 +1,47255 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import _model_base, models as _models +from .._model_base import SdkJSONEncoder, _deserialize +from .._serialization import Serializer +from .._vendor import prepare_multipart_form_data + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_entity_create_or_update_request( + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if business_attribute_update_behavior is not None: + _params["businessAttributeUpdateBehavior"] = _SERIALIZER.query( + "business_attribute_update_behavior", business_attribute_update_behavior, "str" + ) + if collection_id is not None: + _params["collectionId"] = _SERIALIZER.query("collection_id", collection_id, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_get_by_ids_request( + *, guid: List[str], min_ext_info: Optional[bool] = None, ignore_relationships: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["guid"] = [_SERIALIZER.query("guid", q, "str") if q is not None else "" for q in guid] + if min_ext_info is not None: + _params["minExtInfo"] = _SERIALIZER.query("min_ext_info", min_ext_info, "bool") + if ignore_relationships is not None: + _params["ignoreRelationships"] = _SERIALIZER.query("ignore_relationships", ignore_relationships, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_batch_create_or_update_request( # pylint: disable=name-too-long + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if collection_id is not None: + _params["collectionId"] = _SERIALIZER.query("collection_id", collection_id, "str") + if business_attribute_update_behavior is not None: + _params["businessAttributeUpdateBehavior"] = _SERIALIZER.query( + "business_attribute_update_behavior", business_attribute_update_behavior, "str" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_batch_delete_request(*, guid: List[str], **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk" + + # Construct parameters + _params["guid"] = [_SERIALIZER.query("guid", q, "str") if q is not None else "" for q in guid] + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_add_classification_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/bulk/classification" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_request( + guid: str, *, min_ext_info: Optional[bool] = None, ignore_relationships: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if min_ext_info is not None: + _params["minExtInfo"] = _SERIALIZER.query("min_ext_info", min_ext_info, "bool") + if ignore_relationships is not None: + _params["ignoreRelationships"] = _SERIALIZER.query("ignore_relationships", ignore_relationships, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_update_attribute_by_id_request( # pylint: disable=name-too-long + guid: str, *, name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_delete_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_classification_request(guid: str, classification_name: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classification/{classificationName}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + "classificationName": _SERIALIZER.url("classification_name", classification_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_entity_remove_classification_request( # pylint: disable=name-too-long + guid: str, classification_name: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classification/{classificationName}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + "classificationName": _SERIALIZER.url("classification_name", classification_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_entity_get_classifications_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classifications" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_entity_add_classifications_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classifications" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_update_classifications_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classifications" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attribute: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if min_ext_info is not None: + _params["minExtInfo"] = _SERIALIZER.query("min_ext_info", min_ext_info, "bool") + if ignore_relationships is not None: + _params["ignoreRelationships"] = _SERIALIZER.query("ignore_relationships", ignore_relationships, "bool") + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_update_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_delete_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_remove_classification_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, classification_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/classification/{classificationName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + "classificationName": _SERIALIZER.url("classification_name", classification_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_entity_add_classifications_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_update_classifications_unique_by_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/classifications" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_batch_set_classifications_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk/setClassifications" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_batch_get_by_unique_attributes_request( # pylint: disable=name-too-long + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attr_n_qualified_name: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if min_ext_info is not None: + _params["minExtInfo"] = _SERIALIZER.query("min_ext_info", min_ext_info, "bool") + if ignore_relationships is not None: + _params["ignoreRelationships"] = _SERIALIZER.query("ignore_relationships", ignore_relationships, "bool") + if attr_n_qualified_name is not None: + _params["attr_N:qualifiedName"] = _SERIALIZER.query("attr_n_qualified_name", attr_n_qualified_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_get_header_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/header" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_entity_remove_business_metadata_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_entity_add_or_update_business_metadata_request( # pylint: disable=name-too-long + guid: str, *, overwrite: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if overwrite is not None: + _params["isOverwrite"] = _SERIALIZER.query("overwrite", overwrite, "bool") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_remove_business_metadata_attributes_request( # pylint: disable=name-too-long + business_metadata_name: str, guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}" + path_format_arguments = { + "businessMetadataName": _SERIALIZER.url("business_metadata_name", business_metadata_name, "str"), + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_entity_add_or_update_business_metadata_attributes_request( # pylint: disable=name-too-long + business_metadata_name: str, guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata/{businessMetadataName}" + path_format_arguments = { + "businessMetadataName": _SERIALIZER.url("business_metadata_name", business_metadata_name, "str"), + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_business_metadata_template_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/octet-stream") + + # Construct URL + _url = "/atlas/v2/entity/businessmetadata/import/template" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_entity_import_business_metadata_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/businessmetadata/import" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_remove_labels_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_entity_set_labels_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_add_label_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_entity_remove_labels_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_set_labels_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_add_labels_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attribute: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/entity/uniqueAttribute/type/{typeName}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_move_entities_to_collection_request( # pylint: disable=name-too-long + *, collection_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/entity/moveTo" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["collectionId"] = _SERIALIZER.query("collection_id", collection_id, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_batch_get_request( + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + if ignore_terms_and_categories is not None: + _params["ignoreTermsAndCategories"] = _SERIALIZER.query( + "ignore_terms_and_categories", ignore_terms_and_categories, "bool" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_create_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_glossary_create_categories_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/categories" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_glossary_create_category_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_glossary_get_category_request(category_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_glossary_update_category_request(category_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_glossary_delete_category_request(category_id: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_glossary_partial_update_category_request( # pylint: disable=name-too-long + category_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}/partial" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_glossary_get_related_categories_request( # pylint: disable=name-too-long + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}/related" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_category_terms_request( # pylint: disable=name-too-long + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryId}/terms" + path_format_arguments = { + "categoryId": _SERIALIZER.url("category_id", category_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_create_term_request(*, include_term_hierarchy: Optional[bool] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term" + + # Construct parameters + if include_term_hierarchy is not None: + _params["includeTermHierarchy"] = _SERIALIZER.query("include_term_hierarchy", include_term_hierarchy, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_term_request(term_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termId}" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_update_term_request( + term_id: str, *, include_term_hierarchy: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termId}" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_term_hierarchy is not None: + _params["includeTermHierarchy"] = _SERIALIZER.query("include_term_hierarchy", include_term_hierarchy, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_delete_term_request(term_id: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/glossary/term/{termId}" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_glossary_partial_update_term_request( # pylint: disable=name-too-long + term_id: str, *, include_term_hierarchy: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termId}/partial" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_term_hierarchy is not None: + _params["includeTermHierarchy"] = _SERIALIZER.query("include_term_hierarchy", include_term_hierarchy, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_create_terms_request(*, include_term_hierarchy: Optional[bool] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_term_hierarchy is not None: + _params["includeTermHierarchy"] = _SERIALIZER.query("include_term_hierarchy", include_term_hierarchy, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_entities_assigned_with_term_request( # pylint: disable=name-too-long + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms/{termId}/assignedEntities" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_assign_term_to_entities_request( # pylint: disable=name-too-long + term_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/glossary/terms/{termId}/assignedEntities" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_glossary_delete_term_assignment_from_entities_request( # pylint: disable=name-too-long + term_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/glossary/terms/{termId}/assignedEntities" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_glossary_get_related_terms_request( + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms/{termId}/related" + path_format_arguments = { + "termId": _SERIALIZER.url("term_id", term_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_request(glossary_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_glossary_update_request( + glossary_id: str, *, ignore_terms_and_categories: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_terms_and_categories is not None: + _params["ignoreTermsAndCategories"] = _SERIALIZER.query( + "ignore_terms_and_categories", ignore_terms_and_categories, "bool" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_delete_request(glossary_id: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_glossary_get_categories_request( + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/categories" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_categories_headers_request( # pylint: disable=name-too-long + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/categories/headers" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_detailed_request(glossary_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/detailed" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_partial_update_request( + glossary_id: str, *, ignore_terms_and_categories: Optional[bool] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/partial" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_terms_and_categories is not None: + _params["ignoreTermsAndCategories"] = _SERIALIZER.query( + "ignore_terms_and_categories", ignore_terms_and_categories, "bool" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_terms_request( + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/terms" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_term_headers_request( + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryId}/terms/headers" + path_format_arguments = { + "glossaryId": _SERIALIZER.url("glossary_id", glossary_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if sort is not None: + _params["sort"] = _SERIALIZER.query("sort", sort, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_discovery_query_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/query" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_discovery_suggest_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/suggest" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_discovery_auto_complete_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/autocomplete" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_lineage_get_request( + guid: str, *, direction: Union[str, _models.LineageDirection], depth: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/lineage/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if depth is not None: + _params["depth"] = _SERIALIZER.query("depth", depth, "int") + _params["direction"] = _SERIALIZER.query("direction", direction, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_lineage_get_next_page_request( + guid: str, + *, + direction: Union[str, _models.LineageDirection], + offset: Optional[int] = None, + limit: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/lineage/{guid}/next" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["direction"] = _SERIALIZER.query("direction", direction, "str") + if offset is not None: + _params["offset"] = _SERIALIZER.query("offset", offset, "int") + if limit is not None: + _params["limit"] = _SERIALIZER.query("limit", limit, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_lineage_get_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, + *, + direction: Union[str, _models.LineageDirection], + depth: Optional[int] = None, + attribute: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/lineage/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if depth is not None: + _params["depth"] = _SERIALIZER.query("depth", depth, "int") + _params["direction"] = _SERIALIZER.query("direction", direction, "str") + if attribute is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attribute", attribute, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_relationship_create_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/relationship" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_relationship_update_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/relationship" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_relationship_get_request(guid: str, *, extended_info: Optional[bool] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/relationship/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if extended_info is not None: + _params["extendedInfo"] = _SERIALIZER.query("extended_info", extended_info, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_relationship_delete_request(guid: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/relationship/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_type_definition_get_business_metadata_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/businessmetadatadef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_business_metadata_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/businessmetadatadef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_classification_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/classificationdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_classification_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/classificationdef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_entity_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/entitydef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_entity_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/entitydef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_enum_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/enumdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_enum_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/enumdef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_relationship_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/relationshipdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_relationship_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/relationshipdef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_struct_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/structdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_struct_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/structdef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_by_id_request(guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_by_name_request(name: str, **kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_delete_request(name: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/atlas/v2/types/typedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_type_definition_get_request( + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_term_template is not None: + _params["includeTermTemplate"] = _SERIALIZER.query("include_term_template", include_term_template, "bool") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_type_definition_batch_create_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_batch_update_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_batch_delete_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + # Construct URL + _url = "/atlas/v2/types/typedefs" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_type_definition_get_headers_request( # pylint: disable=name-too-long + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs/headers" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_term_template is not None: + _params["includeTermTemplate"] = _SERIALIZER.query("include_term_template", include_term_template, "bool") + if type is not None: + _params["type"] = _SERIALIZER.query("type", type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_type_definition_get_term_template_by_id_request( # pylint: disable=name-too-long + guid: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/types/termtemplatedef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_type_definition_get_term_template_by_name_request( # pylint: disable=name-too-long + name: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/types/termtemplatedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class EntityOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`entity` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def create_or_update( + self, + body: _models.AtlasEntityWithExtInfo, + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def create_or_update( + self, + body: JSON, + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: JSON + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def create_or_update( + self, + body: IO[bytes], + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Required. + :type body: IO[bytes] + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace + def create_or_update( + self, + body: Union[_models.AtlasEntityWithExtInfo, JSON, IO[bytes]], + *, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + collection_id: Optional[str] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update an entity. + Existing entity is matched using its unique guid if + supplied or by its unique attributes eg: qualifiedName. + Map and array of + collections are not well supported. E.g., array`>, array>. + For each contact type, the maximum number of contacts is 20. + + :param body: Is one of the following types: AtlasEntityWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo or JSON or IO[bytes] + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_create_or_update_request( + business_attribute_update_behavior=business_attribute_update_behavior, + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_ids( + self, + *, + guid: List[str], + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasEntitiesWithExtInfo: + # pylint: disable=line-too-long + """List entities in bulk identified by its GUIDs. + + :keyword guid: An array of GUIDs of entities to list. Required. + :paramtype guid: list[str] + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :return: AtlasEntitiesWithExtInfo. The AtlasEntitiesWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntitiesWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_by_ids_request( + guid=guid, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntitiesWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def batch_create_or_update( + self, + body: _models.AtlasEntitiesWithExtInfo, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def batch_create_or_update( + self, + body: JSON, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: JSON + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def batch_create_or_update( + self, + body: IO[bytes], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Required. + :type body: IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace + def batch_create_or_update( + self, + body: Union[_models.AtlasEntitiesWithExtInfo, JSON, IO[bytes]], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[Union[str, _models.BusinessAttributeUpdateBehavior]] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Create or update entities in bulk. + Existing entity is matched using its unique + guid if supplied or by its unique attributes eg: qualifiedName. + Map and array + of collections are not well supported. E.g., array`>, + array>. + For each contact type, the maximum number of contacts + is 20. + + :param body: Is one of the following types: AtlasEntitiesWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo or JSON or IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Only specify a value if + you + need to move an entity to another collection. Default value is None. + :paramtype collection_id: str + :keyword business_attribute_update_behavior: Used to define the update behavior for business + attributes when updating + entities. Known values are: "ignore", "replace", and "merge". Default value is None. + :paramtype business_attribute_update_behavior: str or + ~azure.purview.datamap.models.BusinessAttributeUpdateBehavior + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_batch_create_or_update_request( + collection_id=collection_id, + business_attribute_update_behavior=business_attribute_update_behavior, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def batch_delete(self, *, guid: List[str], **kwargs: Any) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete a list of entities in bulk identified by their GUIDs or unique + attributes. + + :keyword guid: An array of GUIDs of entities to delete. Required. + :paramtype guid: list[str] + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_batch_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def add_classification( # pylint: disable=inconsistent-return-statements + self, body: _models.ClassificationAssociateOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.ClassificationAssociateOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "classification": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + }, + "entityGuids": [ + "str" # Optional. The GUID of the entity. + ] + } + """ + + @overload + def add_classification( # pylint: disable=inconsistent-return-statements + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def add_classification( # pylint: disable=inconsistent-return-statements + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_classification( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ClassificationAssociateOptions, JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param body: Is one of the following types: ClassificationAssociateOptions, JSON, IO[bytes] + Required. + :type body: ~azure.purview.datamap.models.ClassificationAssociateOptions or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "classification": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + }, + "entityGuids": [ + "str" # Optional. The GUID of the entity. + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classification_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get( + self, + guid: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasEntityWithExtInfo: + # pylint: disable=line-too-long + """Get complete definition of an entity given its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :return: AtlasEntityWithExtInfo. The AtlasEntityWithExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_request( + guid=guid, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def update_attribute_by_id(self, guid: str, body: Any, *, name: str, **kwargs: Any) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - create or update entity attribute identified by its + GUID. + Supports only primitive attribute type and entity references. + It does not support updating complex types like arrays, and maps. + Null updates are not possible. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: The value of the attribute. Required. + :type body: any + :keyword name: The name of the attribute. Required. + :paramtype name: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_attribute_by_id_request( + guid=guid, + name=name, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, guid: str, **kwargs: Any) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete an entity identified by its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_classification(self, guid: str, classification_name: str, **kwargs: Any) -> _models.AtlasClassification: + # pylint: disable=line-too-long + """Get classification for a given entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :return: AtlasClassification. The AtlasClassification is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassification + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time boundary. + "startTime": "str", # Optional. The start of the time + boundary. + "timeZone": "str" # Optional. The timezone of the time + boundary. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassification] = kwargs.pop("cls", None) + + _request = build_entity_get_classification_request( + guid=guid, + classification_name=classification_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassification, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def remove_classification( # pylint: disable=inconsistent-return-statements + self, guid: str, classification_name: str, **kwargs: Any + ) -> None: + """Delete a given classification from an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_entity_remove_classification_request( + guid=guid, + classification_name=classification_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_classifications(self, guid: str, **kwargs: Any) -> _models.AtlasClassifications: + # pylint: disable=line-too-long + """List classifications for a given entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasClassifications. The AtlasClassifications is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassifications + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "list": [ + {} # Optional. An array of objects. + ], + "pageSize": 0, # Optional. The size of the page. + "sortBy": "str", # Optional. The sorted by field. + "sortType": "str", # Optional. to specify whether the result should be + sorted? If yes, whether asc or desc. Known values are: "NONE", "ASC", and "DESC". + "startIndex": 0, # Optional. The start index of the page. + "totalCount": 0 # Optional. The total count of items. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassifications] = kwargs.pop("cls", None) + + _request = build_entity_get_classifications_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassifications, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def add_classifications( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: List[_models.AtlasClassification], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[List[_models.AtlasClassification], IO[bytes]], **kwargs: Any + ) -> None: + """Add classifications to an existing entity represented by a GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be added. Is either a [AtlasClassification] type or + a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classifications_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def update_classifications( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: List[_models.AtlasClassification], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[List[_models.AtlasClassification], IO[bytes]], **kwargs: Any + ) -> None: + """Update classifications to an existing entity represented by a guid. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: An array of classifications to be updated. Is either a [AtlasClassification] type + or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_classifications_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_by_unique_attribute( + self, + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasEntityWithExtInfo: + # pylint: disable=line-too-long + """Get complete definition of an entity given its type and unique attribute. + + In + addition to the typeName path parameter, attribute key-value pair(s) can be + provided in the following format: + attr:\:code:``=:code:``. + + NOTE: The + attrName and attrValue should be unique across entities, eg. + qualifiedName. + + The REST request would look something like this: + GET + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: AtlasEntityWithExtInfo. The AtlasEntityWithExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_get_by_unique_attribute_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_by_unique_attribute( + self, + type_name: str, + body: _models.AtlasEntityWithExtInfo, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def update_by_unique_attribute( + self, + type_name: str, + body: JSON, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: JSON + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def update_by_unique_attribute( + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace + def update_by_unique_attribute( + self, + type_name: str, + body: Union[_models.AtlasEntityWithExtInfo, JSON, IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Update entity partially - Allow a subset of attributes to be updated on an + entity which is identified by its type and unique attribute eg: + Referenceable.qualifiedName. Null updates are not possible. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + + attr::code:``=:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: Is one of the following types: AtlasEntityWithExtInfo, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityWithExtInfo or JSON or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entity": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the + term assignment. + "createdBy": "str", # Optional. The user who created + the record. + "description": "str", # Optional. The description of + the term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms + assignment. Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", + "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of relationship. + }, + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the entity. + }, + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_by_unique_attribute( + self, type_name: str, *, attribute: Optional[str] = None, **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Delete an entity identified by its type and unique attributes. + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: + attr:\:code:``=\:code:``. + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: + DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + _request = build_entity_delete_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def remove_classification_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, type_name: str, classification_name: str, *, attribute: Optional[str] = None, **kwargs: Any + ) -> None: + """Delete a given classification from an entity identified by its type and unique + attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param classification_name: The name of the classification. Required. + :type classification_name: str + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_entity_remove_classification_by_unique_attribute_request( + type_name=type_name, + classification_name=classification_name, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: List[_models.AtlasClassification], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Union[List[_models.AtlasClassification], IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Add classification to the entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be added. Is either a [AtlasClassification] type or + a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_classifications_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: List[_models.AtlasClassification], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the time + boundary. + "startTime": "str", # Optional. The start of the + time boundary. + "timeZone": "str" # Optional. The timezone of the + time boundary. + } + ] + } + ] + """ + + @overload + def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: IO[bytes], + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Required. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_classifications_unique_by_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + body: Union[List[_models.AtlasClassification], IO[bytes]], + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Update classification on an entity identified by its type and unique attributes. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: An array of classification to be updated. Is either a [AtlasClassification] type + or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasClassification] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_update_classifications_unique_by_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def batch_set_classifications( + self, body: _models.AtlasEntityHeaders, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasEntityHeaders + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "guidHeaderMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + } + } + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @overload + def batch_set_classifications( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @overload + def batch_set_classifications( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + + @distributed_trace + def batch_set_classifications( + self, body: Union[_models.AtlasEntityHeaders, JSON, IO[bytes]], **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param body: Is one of the following types: AtlasEntityHeaders, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasEntityHeaders or JSON or IO[bytes] + :return: list of str + :rtype: list[str] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "guidHeaderMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + } + } + + # response body for status code(s): 200 + response == [ + "str" # Optional. + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[str]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_batch_set_classifications_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[str], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def batch_get_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: Optional[bool] = None, + ignore_relationships: Optional[bool] = None, + attr_n_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasEntitiesWithExtInfo: + # pylint: disable=line-too-long + """Bulk API to retrieve list of entities identified by its unique attributes. + In + addition to the typeName path parameter, attribute key-value pair(s) can be + provided in the following + format + + typeName=\:code:``&attr_1:\:code:``=\:code:``&attr_2:\:code:``=\:code:``&attr_3:\:code:``=\:code:`` + + NOTE: + The attrName should be an unique attribute for the given entity-type. + The REST + request would look something like this + + GET + /v2/entity/bulk/uniqueAttribute/type/hive_db?attr_1:qualifiedName=db1@cl1&attr_2:qualifiedName=db2@cl1 + + Note: + at least one unique attribute must be provided. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is None. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + None. + :paramtype ignore_relationships: bool + :keyword attr_n_qualified_name: Qualified name of an entity. E.g. to find 2 entities you can + set + attrs_1:qualifiedName=db1@cl1&attrs_2:qualifiedName=db2@cl1. (This is only an + example. qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_n_qualified_name: str + :return: AtlasEntitiesWithExtInfo. The AtlasEntitiesWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntitiesWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "entities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + ], + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "businessAttributes": { + "str": {} # Optional. Business attributes. + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "collectionId": "str", # Optional. The collection ID of the + entity. + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "customAttributes": { + "str": "str" # Optional. Custom Attribute. + }, + "guid": "str", # Optional. The GUID of the entity. + "homeId": "str", # Optional. The home ID of the entity. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "provenanceType": 0, # Optional. Used to record the + provenance of an instance of an entity or relationship. + "proxy": bool, # Optional. Determines if there's a proxy. + "relationshipAttributes": { + "str": {} # Optional. The attributes of + relationship. + }, + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the entity. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntitiesWithExtInfo] = kwargs.pop("cls", None) + + _request = build_entity_batch_get_by_unique_attributes_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attr_n_qualified_name=attr_n_qualified_name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntitiesWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_header(self, guid: str, **kwargs: Any) -> _models.AtlasEntityHeader: + # pylint: disable=line-too-long + """Get entity header given its GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasEntityHeader. The AtlasEntityHeader is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityHeader + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence of the term + assignment. + "createdBy": "str", # Optional. The user who created the + record. + "description": "str", # Optional. The description of the + term assignment. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term + assignment. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of terms assignment. + Known values are: "DISCOVERED", "PROPOSED", "IMPORTED", "VALIDATED", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - can be active or + deleted. Deleted entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "typeName": "str" # Optional. The name of the type. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityHeader] = kwargs.pop("cls", None) + + _request = build_entity_get_header_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityHeader, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Dict[str, Dict[str, Any]], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Required. + :type body: dict[str, dict[str, any]] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": { + "str": {} # Optional. + } + } + """ + + @overload + def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Union[Dict[str, Dict[str, Any]], IO[bytes]], **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata payload. Is either a {str: {str: Any}} type or a IO[bytes] type. + Required. + :type body: dict[str, dict[str, any]] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_remove_business_metadata_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: Dict[str, Dict[str, Any]], + *, + overwrite: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Required. + :type body: dict[str, dict[str, any]] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": { + "str": {} # Optional. + } + } + """ + + @overload + def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: IO[bytes], + *, + overwrite: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Required. + :type body: IO[bytes] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + body: Union[Dict[str, Dict[str, Any]], IO[bytes]], + *, + overwrite: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Add business metadata to an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: BusinessMetadata payload. Is either a {str: {str: Any}} type or a IO[bytes] type. + Required. + :type body: dict[str, dict[str, any]] or IO[bytes] + :keyword overwrite: Whether to overwrite the existing business metadata on the entity or not, + default is false. Default value is None. + :paramtype overwrite: bool + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_or_update_business_metadata_request( + guid=guid, + overwrite=overwrite, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + business_metadata_name: str, + guid: str, + body: Dict[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": {} # Optional. + } + """ + + @overload + def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + business_metadata_name: str, + guid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, business_metadata_name: str, guid: str, body: Union[Dict[str, Any], IO[bytes]], **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Is either a {str: Any} type or a IO[bytes] + type. Required. + :type body: dict[str, any] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_remove_business_metadata_attributes_request( + business_metadata_name=business_metadata_name, + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + business_metadata_name: str, + guid: str, + body: Dict[str, Any], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: dict[str, any] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": {} # Optional. + } + """ + + @overload + def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + business_metadata_name: str, + guid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, business_metadata_name: str, guid: str, body: Union[Dict[str, Any], IO[bytes]], **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param business_metadata_name: BusinessMetadata name. Required. + :type business_metadata_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: Business metadata attribute payload. Is either a {str: Any} type or a IO[bytes] + type. Required. + :type body: dict[str, any] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_add_or_update_business_metadata_attributes_request( + business_metadata_name=business_metadata_name, + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_business_metadata_template(self, **kwargs: Any) -> bytes: + """Get the sample Template for uploading/creating bulk BusinessMetaData. + + :return: bytes + :rtype: bytes + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[bytes] = kwargs.pop("cls", None) + + _request = build_entity_get_business_metadata_template_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", True) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = response.read() + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def import_business_metadata( + self, body: _models.BusinessMetadataOptions, **kwargs: Any + ) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Required. + :type body: ~azure.purview.datamap.models.BusinessMetadataOptions + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file": filetype + } + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + + @overload + def import_business_metadata(self, body: JSON, **kwargs: Any) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Required. + :type body: JSON + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + + @distributed_trace + def import_business_metadata( + self, body: Union[_models.BusinessMetadataOptions, JSON], **kwargs: Any + ) -> _models.BulkImportResult: + """Upload the file for creating Business Metadata in BULK. + + :param body: Is either a BusinessMetadataOptions type or a JSON type. Required. + :type body: ~azure.purview.datamap.models.BusinessMetadataOptions or JSON + :return: BulkImportResult. The BulkImportResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.BulkImportResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "file": filetype + } + + # response body for status code(s): 200 + response == { + "failedImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ], + "successImportInfoList": [ + { + "childObjectName": "str", # Optional. childObjectName. + "importStatus": "str", # Optional. importStatus. Known + values are: "SUCCESS" and "FAILED". + "parentObjectName": "str", # Optional. parentObjectName. + "remarks": "str" # Optional. remarks. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.BulkImportResult] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["file"] + _data_fields: List[str] = [] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_entity_import_business_metadata_request( + files=_files, + data=_data, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.BulkImportResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def remove_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Delete given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be deleted. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_remove_labels_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def set_labels( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Set labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be set to the entity. Is either a [str] type or a IO[bytes] type. + Default value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_set_labels_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[List[str]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Default value is None. + :type body: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_label( # pylint: disable=inconsistent-return-statements + self, guid: str, body: Optional[Union[List[str], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Add given labels to a given entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param body: set of labels to be added. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_add_label_request( + guid=guid, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def remove_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Delete given labels to a given entity identified by its type and unique + attribute. + + If labels is null/empty, no labels will be removed. + + If any labels + in labels set are non-existing labels, they will be ignored, only existing + labels will be removed. In addition to the typeName path parameter, attribute + key-value pair(s) can be provided in the following format: + attr::code:``=:code:``. NOTE: The attrName and attrValue should be unique + across entities, eg. qualifiedName. The REST request would look something like + this: DELETE + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be deleted. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_remove_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def set_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Set labels to a given entity identified by its type and unique attributes. + + If + labels is null/empty, existing labels will all be removed. + + In addition to the + typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: POST + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be set. Is either a [str] type or a IO[bytes] type. Default value + is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_set_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[List[str]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Default value is None. + :type body: list[str] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + "str" # Optional. + ] + """ + + @overload + def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[IO[bytes]] = None, + *, + attribute: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Default value is None. + :type body: IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_labels_by_unique_attribute( # pylint: disable=inconsistent-return-statements + self, + type_name: str, + body: Optional[Union[List[str], IO[bytes]]] = None, + *, + attribute: Optional[str] = None, + **kwargs: Any + ) -> None: + """Add given labels to a given entity identified by its type and unique + attributes. + + If labels is null/empty, no labels will be added. + + In addition to + the typeName path parameter, attribute key-value pair(s) can be provided in the + following format: attr::code:``=:code:``. + + NOTE: The attrName and + attrValue should be unique across entities, eg. qualifiedName. + + The REST + request would look something like this: PUT + /v2/entity/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :param body: set of labels to be added. Is either a [str] type or a IO[bytes] type. Default + value is None. + :type body: list[str] or IO[bytes] + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_entity_add_labels_by_unique_attribute_request( + type_name=type_name, + attribute=attribute, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def move_entities_to_collection( + self, + body: _models.MoveEntitiesOptions, + *, + collection_id: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: ~azure.purview.datamap.models.MoveEntitiesOptions + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entityGuids": [ + "str" # Optional. An array of entity guids to be moved to target + collection. + ] + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def move_entities_to_collection( + self, body: JSON, *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: JSON + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @overload + def move_entities_to_collection( + self, body: IO[bytes], *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Required. + :type body: IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + + @distributed_trace + def move_entities_to_collection( + self, body: Union[_models.MoveEntitiesOptions, JSON, IO[bytes]], *, collection_id: str, **kwargs: Any + ) -> _models.EntityMutationResult: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param body: Is one of the following types: MoveEntitiesOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.MoveEntitiesOptions or JSON or IO[bytes] + :keyword collection_id: The collection where entities will be moved to. Required. + :paramtype collection_id: str + :return: EntityMutationResult. The EntityMutationResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.EntityMutationResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "entityGuids": [ + "str" # Optional. An array of entity guids to be moved to target + collection. + ] + } + + # response body for status code(s): 200 + response == { + "guidAssignments": { + "str": "str" # Optional. A map of GUID assignments with entities. + }, + "mutatedEntities": { + "str": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification + names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "entityGuid": "str", # Optional. The + GUID of the entity. + "entityStatus": "str", # Optional. + Status of the entity - can be active or deleted. Deleted + entities are not removed. Known values are: "ACTIVE" and + "DELETED". + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "removePropagationsOnEntityDelete": + bool, # Optional. Determines if propagations will be removed + on entity deletion. + "typeName": "str", # Optional. The + name of the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", + # Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a + shell entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The + confidence of the term assignment. + "createdBy": "str", # Optional. The + user who created the record. + "description": "str", # Optional. + The description of the term assignment. + "displayText": "str", # Optional. + The display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. + The GUID of the relationship. + "status": "str", # Optional. The + status of terms assignment. Known values are: "DISCOVERED", + "PROPOSED", "IMPORTED", "VALIDATED", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The + steward of the term. + "termGuid": "str" # Optional. The + GUID of the term. + } + ], + "status": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + }, + "partialUpdatedEntities": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EntityMutationResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_entity_move_entities_to_collection_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EntityMutationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GlossaryOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`glossary` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def batch_get( + self, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossary]: + # pylint: disable=line-too-long + """Get all glossaries. Recommend using limit/offset to get pagination result. + Recommend using 'ignoreTermsAndCategories=true' and fetch terms/categories + separately using + + 'GET /datamap/api/atlas/v2/glossary/{glossaryId}/terms' + and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryId}/categories'. + + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: list of AtlasGlossary + :rtype: list[~azure.purview.datamap.models.AtlasGlossary] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossary]] = kwargs.pop("cls", None) + + _request = build_glossary_batch_get_request( + limit=limit, + offset=offset, + sort=sort, + ignore_terms_and_categories=ignore_terms_and_categories, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossary], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, body: _models.AtlasGlossary, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace + def create(self, body: Union[_models.AtlasGlossary, JSON, IO[bytes]], **kwargs: Any) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Create a glossary. + + :param body: Is one of the following types: AtlasGlossary, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary or JSON or IO[bytes] + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_categories( + self, body: List[_models.AtlasGlossaryCategory], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + + @overload + def create_categories( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + + @distributed_trace + def create_categories( + self, body: Union[List[_models.AtlasGlossaryCategory], IO[bytes]], **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param body: An array of glossary category definitions to be created. Is either a + [AtlasGlossaryCategory] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryCategory] or IO[bytes] + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.AtlasGlossaryCategory]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_categories_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryCategory], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_category( + self, body: _models.AtlasGlossaryCategory, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + def create_category( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + def create_category( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace + def create_category( + self, body: Union[_models.AtlasGlossaryCategory, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Create a glossary category. + + :param body: Is one of the following types: AtlasGlossaryCategory, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory or JSON or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_category_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_category(self, category_id: str, **kwargs: Any) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Get specific glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_request( + category_id=category_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_category( + self, + category_id: str, + body: _models.AtlasGlossaryCategory, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + def update_category( + self, category_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + def update_category( + self, category_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace + def update_category( + self, category_id: str, body: Union[_models.AtlasGlossaryCategory, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: Is one of the following types: AtlasGlossaryCategory, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryCategory or JSON or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_category_request( + category_id=category_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_category( # pylint: disable=inconsistent-return-statements + self, category_id: str, **kwargs: Any + ) -> None: + """Delete a glossary category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_category_request( + category_id=category_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def partial_update_category( + self, category_id: str, body: Dict[str, str], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Required. + :type body: dict[str, str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @overload + def partial_update_category( + self, category_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + + @distributed_trace + def partial_update_category( + self, category_id: str, body: Union[Dict[str, str], IO[bytes]], **kwargs: Any + ) -> _models.AtlasGlossaryCategory: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial + updating shortDescription and longDescription for category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values for partial update. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :return: AtlasGlossaryCategory. The AtlasGlossaryCategory is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryCategory + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryCategory] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_category_request( + category_id=category_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryCategory, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_related_categories( + self, + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> Dict[str, List[_models.AtlasRelatedCategoryHeader]]: + """Get all related categories (parent and children). Limit, offset, and sort + parameters are currently not being enabled and won't work even they are passed. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: dict mapping str to list of AtlasRelatedCategoryHeader + :rtype: dict[str, list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader]] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "str": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Dict[str, List[_models.AtlasRelatedCategoryHeader]]] = kwargs.pop("cls", None) + + _request = build_glossary_get_related_categories_request( + category_id=category_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(Dict[str, List[_models.AtlasRelatedCategoryHeader]], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_category_terms( + self, + category_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedTermHeader]: + # pylint: disable=line-too-long + """Get all terms associated with the specific category. + + :param category_id: The globally unique identifier of the category. Required. + :type category_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedTermHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "description": "str", # Optional. The description of the related + term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the relationship. + "status": "str", # Optional. The status of term relationship. Known + values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedTermHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_terms_request( + category_id=category_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedTermHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_term( + self, + body: _models.AtlasGlossaryTerm, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + def create_term( + self, + body: JSON, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + def create_term( + self, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace + def create_term( + self, + body: Union[_models.AtlasGlossaryTerm, JSON, IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Create a glossary term. + + :param body: Is one of the following types: AtlasGlossaryTerm, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm or JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_term_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_term(self, term_id: str, **kwargs: Any) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Get a specific glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_request( + term_id=term_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_term( + self, + term_id: str, + body: _models.AtlasGlossaryTerm, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + def update_term( + self, + term_id: str, + body: JSON, + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + def update_term( + self, + term_id: str, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace + def update_term( + self, + term_id: str, + body: Union[_models.AtlasGlossaryTerm, JSON, IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: Is one of the following types: AtlasGlossaryTerm, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossaryTerm or JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_term_request( + term_id=term_id, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_term(self, term_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a glossary term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_term_request( + term_id=term_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def partial_update_term( + self, + term_id: str, + body: Dict[str, str], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Required. + :type body: dict[str, str] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @overload + def partial_update_term( + self, + term_id: str, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + + @distributed_trace + def partial_update_term( + self, + term_id: str, + body: Union[Dict[str, str], IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossaryTerm: + # pylint: disable=line-too-long + """Update the glossary term partially. So far we only supports partial updating + shortDescription, longDescription, abbreviation, usage and status for term. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values to be updated. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: AtlasGlossaryTerm. The AtlasGlossaryTerm is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryTerm + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the + relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the term, + which is map>. The key of the first layer map + is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term relationship. + Known values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and + "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active Directory + object Id. + "info": "str" # Optional. additional information to + describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "replacedBy": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known values + are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossaryTerm] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_term_request( + term_id=term_id, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryTerm, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_terms( + self, + body: List[_models.AtlasGlossaryTerm], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + + @overload + def create_terms( + self, + body: IO[bytes], + *, + include_term_hierarchy: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Required. + :type body: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + + @distributed_trace + def create_terms( + self, + body: Union[List[_models.AtlasGlossaryTerm], IO[bytes]], + *, + include_term_hierarchy: Optional[bool] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param body: An array of glossary term definitions to be created in bulk. Is either a + [AtlasGlossaryTerm] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasGlossaryTerm] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is None. + :paramtype include_term_hierarchy: bool + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.AtlasGlossaryTerm]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_create_terms_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryTerm], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_entities_assigned_with_term( + self, + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedObjectId]: + # pylint: disable=line-too-long + """List all related objects assigned with the specified term. Recommend using + limit/offset to get pagination result. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedObjectId + :rtype: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedObjectId]] = kwargs.pop("cls", None) + + _request = build_glossary_get_entities_assigned_with_term_request( + term_id=term_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedObjectId], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, + term_id: str, + body: List[_models.AtlasRelatedObjectId], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + + @overload + def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: Union[List[_models.AtlasRelatedObjectId], IO[bytes]], **kwargs: Any + ) -> None: + """Assign the given term to the provided list of related objects. Recommend using + small batches with multiple API calls. + + `Entities Create Or Update + operation + `_ + is an alternative to assign a term to multiple entities. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs to which the term has to be associated. Is either a + [AtlasRelatedObjectId] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_assign_term_to_entities_request( + term_id=term_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, + term_id: str, + body: List[_models.AtlasRelatedObjectId], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. + Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "typeName": "str" # Optional. The name of the type. + }, + "relationshipGuid": "str", # Optional. The GUID of the relationship. + "relationshipStatus": "str", # Optional. The enum of relationship + status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + } + ] + """ + + @overload + def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. + Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_id: str, body: Union[List[_models.AtlasRelatedObjectId], IO[bytes]], **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :param body: An array of related object IDs from which the term has to be dissociated. Is + either a [AtlasRelatedObjectId] type or a IO[bytes] type. Required. + :type body: list[~azure.purview.datamap.models.AtlasRelatedObjectId] or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_delete_term_assignment_from_entities_request( + term_id=term_id, + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_related_terms( + self, + term_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> Dict[str, List[_models.AtlasRelatedTermHeader]]: + # pylint: disable=line-too-long + """Get all related terms for a specific term by its GUID. Limit, offset, and sort + parameters are currently not being enabled and won't work even they are passed. + + :param term_id: The globally unique identifier for glossary term. Required. + :type term_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: dict mapping str to list of AtlasRelatedTermHeader + :rtype: dict[str, list[~azure.purview.datamap.models.AtlasRelatedTermHeader]] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "str": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Dict[str, List[_models.AtlasRelatedTermHeader]]] = kwargs.pop("cls", None) + + _request = build_glossary_get_related_terms_request( + term_id=term_id, + limit=limit, + offset=offset, + sort=sort, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(Dict[str, List[_models.AtlasRelatedTermHeader]], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, glossary_id: str, **kwargs: Any) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Get a specific Glossary by its GUID. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + _request = build_glossary_get_request( + glossary_id=glossary_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + glossary_id: str, + body: _models.AtlasGlossary, + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + def update( + self, + glossary_id: str, + body: JSON, + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + def update( + self, + glossary_id: str, + body: IO[bytes], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Required. + :type body: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace + def update( + self, + glossary_id: str, + body: Union[_models.AtlasGlossary, JSON, IO[bytes]], + *, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: Is one of the following types: AtlasGlossary, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasGlossary or JSON or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_update_request( + glossary_id=glossary_id, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, glossary_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a glossary. Will delete underlying terms/categories together. Recommend + separate delete terms and categories. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_glossary_delete_request( + glossary_id=glossary_id, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_categories( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryCategory]: + # pylint: disable=line-too-long + """Get the categories belonging to a specific glossary. Recommend using + limit/offset to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasGlossaryCategory + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryCategory] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the record. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossaryCategory]] = kwargs.pop("cls", None) + + _request = build_glossary_get_categories_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryCategory], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_categories_headers( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedCategoryHeader]: + """Get the category headers belonging to a specific glossary. Recommend using + limit/offset to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedCategoryHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedCategoryHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the category + header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the parent + category. + "relationGuid": "str" # Optional. The GUID of the relationship. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedCategoryHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_categories_headers_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedCategoryHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_detailed(self, glossary_id: str, **kwargs: Any) -> _models.AtlasGlossaryExtInfo: + # pylint: disable=line-too-long + """Get a specific glossary with detailed information. This API is not + recommend. + + Recommend to fetch terms/categories details separately using + + GET /datamap/api/atlas/v2/glossary/{glossaryId}/terms and + + GET /datamap/api/atlas/v2/glossary/{glossaryId}/categories. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :return: AtlasGlossaryExtInfo. The AtlasGlossaryExtInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossaryExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "categoryInfo": { + "str": { + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the + glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "childrenCategories": [ + { + "categoryGuid": "str", # Optional. The GUID + of the category. + "description": "str", # Optional. The + description of the category header. + "displayText": "str", # Optional. The + display text. + "parentCategoryGuid": "str", # Optional. The + GUID of the parent category. + "relationGuid": "str" # Optional. The GUID + of the relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "guid": "str", # Optional. The GUID of the object. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "longDescription": "str", # Optional. The long version + description. + "name": "str", # Optional. The name of the glossary object. + "parentCategory": { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of + the parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "qualifiedName": "str", # Optional. The qualified name of + the glossary object. + "shortDescription": "str", # Optional. The short version of + description. + "terms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str" # Optional. The user who updated the + record. + } + }, + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "termInfo": { + "str": { + "abbreviation": "str", # Optional. The abbreviation of the + term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the + glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The + display text. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the + object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The + attributes of the struct. + }, + "lastModifiedTS": "str", # Optional. + ETag for concurrency control. + "typeName": "str" # Optional. The + name of the type. + }, + "relationshipGuid": "str", # Optional. The + GUID of the relationship. + "relationshipStatus": "str", # Optional. The + enum of relationship status. Known values are: "ACTIVE" and + "DELETED". + "relationshipType": "str", # Optional. + Relationship type. + "typeName": "str", # Optional. The name of + the type. + "uniqueAttributes": { + "str": {} # Optional. The unique + attributes of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes + of the term, which is map>. The key of + the first layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID + of the category. + "description": "str", # Optional. The + description of the record. + "displayText": "str", # Optional. The + display text. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str" # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure + Active Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display + text. + "guid": "str", # Optional. The GUID of the + object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource + Id. + "typeName": "str", # Optional. The name of + the type. + "uniqueAttributes": { + "str": {} # Optional. The unique + attributes of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "longDescription": "str", # Optional. The long version + description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of + the glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display + name for url. + "url": "str" # Optional. web url. http or + https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the + AtlasGlossaryTerm. Known values are: "Draft", "Approved", "Alert", and + "Expired". + "synonyms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The + description of the related term. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + term relationship. Known values are: "DRAFT", "ACTIVE", + "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ] + } + }, + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasGlossaryExtInfo] = kwargs.pop("cls", None) + + _request = build_glossary_get_detailed_request( + glossary_id=glossary_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossaryExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def partial_update( + self, + glossary_id: str, + body: Dict[str, str], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Required. + :type body: dict[str, str] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "str": "str" # Optional. + } + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @overload + def partial_update( + self, + glossary_id: str, + body: IO[bytes], + *, + ignore_terms_and_categories: Optional[bool] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Required. + :type body: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + + @distributed_trace + def partial_update( + self, + glossary_id: str, + body: Union[Dict[str, str], IO[bytes]], + *, + ignore_terms_and_categories: Optional[bool] = None, + **kwargs: Any + ) -> _models.AtlasGlossary: + # pylint: disable=line-too-long + """Update the glossary partially. Some properties such as qualifiedName are not + allowed to be updated. + + So far we only supports partial updating + shortDescription, longDescription, language and usage for glossary. + + Recommend + using 'ignoreTermsAndCategories=true' to reduce response body size. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :param body: A map containing keys as attribute names and values as corresponding attribute + values. Is either a {str: str} type or a IO[bytes] type. Required. + :type body: dict[str, str] or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + None. + :paramtype ignore_terms_and_categories: bool + :return: AtlasGlossary. The AtlasGlossary is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasGlossary + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the category. + "description": "str", # Optional. The description of the + category header. + "displayText": "str", # Optional. The display text. + "parentCategoryGuid": "str", # Optional. The GUID of the + parent category. + "relationGuid": "str" # Optional. The GUID of the + relationship. + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - + can be active or deleted. Deleted entities are not removed. Known values + are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "removePropagationsOnEntityDelete": bool, # Optional. + Determines if propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The end of the + time boundary. + "startTime": "str", # Optional. The start of + the time boundary. + "timeZone": "str" # Optional. The timezone + of the time boundary. + } + ] + } + ], + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "guid": "str", # Optional. The GUID of the object. + "language": "str", # Optional. The language of the glossary. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "qualifiedName": "str", # Optional. The qualified name of the glossary + object. + "shortDescription": "str", # Optional. The short version of description. + "terms": [ + { + "description": "str", # Optional. The description of the + related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str" # Optional. The usage of the glossary. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasGlossary] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_glossary_partial_update_request( + glossary_id=glossary_id, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasGlossary, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_terms( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasGlossaryTerm]: + # pylint: disable=line-too-long + """Get terms belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasGlossaryTerm + :rtype: list[~azure.purview.datamap.models.AtlasGlossaryTerm] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "abbreviation": "str", # Optional. The abbreviation of the term. + "anchor": { + "displayText": "str", # Optional. The display text. + "glossaryGuid": "str", # Optional. The GUID of the glossary. + "relationGuid": "str" # Optional. The GUID of the + relationship. + }, + "antonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "assignedEntities": [ + { + "displayText": "str", # Optional. The display text. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "guid": "str", # Optional. The GUID of the object. + "relationshipAttributes": { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "typeName": "str" # Optional. The name of + the type. + }, + "relationshipGuid": "str", # Optional. The GUID of + the relationship. + "relationshipStatus": "str", # Optional. The enum of + relationship status. Known values are: "ACTIVE" and "DELETED". + "relationshipType": "str", # Optional. Relationship + type. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "attributes": { + "str": { + "str": {} # Optional. The custom attributes of the + term, which is map>. The key of the first + layer map is term template name. + } + }, + "categories": [ + { + "categoryGuid": "str", # Optional. The GUID of the + category. + "description": "str", # Optional. The description of + the record. + "displayText": "str", # Optional. The display text. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str" # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + } + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes of the + struct. + }, + "entityGuid": "str", # Optional. The GUID of the + entity. + "entityStatus": "str", # Optional. Status of the + entity - can be active or deleted. Deleted entities are not removed. + Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for + concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. The + end of the time boundary. + "startTime": "str", # Optional. The + start of the time boundary. + "timeZone": "str" # Optional. The + timezone of the time boundary. + } + ] + } + ], + "classifies": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "contacts": { + "str": [ + { + "id": "str", # Optional. Azure Active + Directory object Id. + "info": "str" # Optional. additional + information to describe this contact. + } + ] + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "examples": [ + "str" # Optional. An array of examples. + ], + "guid": "str", # Optional. The GUID of the object. + "hierarchyInfo": [ + { + "displayText": "str", # Optional. Display text. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. Item path. + "name": "str", # Optional. Name. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. Resource Id. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes + of the object. + } + } + ], + "isA": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "longDescription": "str", # Optional. The long version description. + "name": "str", # Optional. The name of the glossary object. + "nickName": "str", # Optional. The nick name of the term. + "preferredTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "preferredToTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "qualifiedName": "str", # Optional. The qualified name of the + glossary object. + "replacedBy": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "replacementTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "resources": [ + { + "displayName": "str", # Optional. Display name for + url. + "url": "str" # Optional. web url. http or https. + } + ], + "seeAlso": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "shortDescription": "str", # Optional. The short version of + description. + "status": "str", # Optional. Status of the AtlasGlossaryTerm. Known + values are: "Draft", "Approved", "Alert", and "Expired". + "synonyms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "templateName": [ + {} # Optional. The name of the template. + ], + "translatedTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "translationTerms": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "usage": "str", # Optional. The usage of the term. + "validValues": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ], + "validValuesFor": [ + { + "description": "str", # Optional. The description of + the related term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of + the term. + "relationGuid": "str", # Optional. The GUID of the + relationship. + "status": "str", # Optional. The status of term + relationship. Known values are: "DRAFT", "ACTIVE", "DEPRECATED", + "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the + term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasGlossaryTerm]] = kwargs.pop("cls", None) + + _request = build_glossary_get_terms_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasGlossaryTerm], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_term_headers( + self, + glossary_id: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[str] = None, + **kwargs: Any + ) -> List[_models.AtlasRelatedTermHeader]: + # pylint: disable=line-too-long + """Get term headers belonging to a specific glossary. Recommend using limit/offset + to get pagination result. + + :param glossary_id: The globally unique identifier for glossary. Required. + :type glossary_id: str + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword sort: The sort order, ASC (default) or DESC. Default value is None. + :paramtype sort: str + :return: list of AtlasRelatedTermHeader + :rtype: list[~azure.purview.datamap.models.AtlasRelatedTermHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "description": "str", # Optional. The description of the related + term. + "displayText": "str", # Optional. The display text. + "expression": "str", # Optional. The expression of the term. + "relationGuid": "str", # Optional. The GUID of the relationship. + "status": "str", # Optional. The status of term relationship. Known + values are: "DRAFT", "ACTIVE", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of the term. + "termGuid": "str" # Optional. The GUID of the term. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasRelatedTermHeader]] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_headers_request( + glossary_id=glossary_id, + limit=limit, + offset=offset, + sort=sort, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasRelatedTermHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DiscoveryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`discovery` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def query( + self, body: _models.QueryOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: ~azure.purview.datamap.models.QueryOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "continuationToken": "str", # Optional. The token used to get next batch of + data. Default 'Null' to get the first batch, and will return new token in each + response unless there's no more data. + "facets": [ + { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + ], + "filter": {}, # Optional. The filter for the search. See examples for the + usage of supported filters. + "keywords": "str", # Optional. The keywords applied to all searchable + fields. + "limit": 0, # Optional. The limit of the number of the search result. + default value is 50; maximum value is 1000. + "orderby": [ + {} # Optional. The sort order of search results, can specify + multiple fields. + ], + "taxonomySetting": { + "assetTypes": [ + "str" # Optional. Asset types. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + } + } + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + def query(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + def query(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @distributed_trace + def query(self, body: Union[_models.QueryOptions, JSON, IO[bytes]], **kwargs: Any) -> _models.QueryResult: + # pylint: disable=line-too-long + """Get data using search. + + :param body: Is one of the following types: QueryOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.QueryOptions or JSON or IO[bytes] + :return: QueryResult. The QueryResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.QueryResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "continuationToken": "str", # Optional. The token used to get next batch of + data. Default 'Null' to get the first batch, and will return new token in each + response unless there's no more data. + "facets": [ + { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + ], + "filter": {}, # Optional. The filter for the search. See examples for the + usage of supported filters. + "keywords": "str", # Optional. The keywords applied to all searchable + fields. + "limit": 0, # Optional. The limit of the number of the search result. + default value is 50; maximum value is 1000. + "orderby": [ + {} # Optional. The sort order of search results, can specify + multiple fields. + ], + "taxonomySetting": { + "assetTypes": [ + "str" # Optional. Asset types. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": { + "count": "str", # Optional. Order by count. Known + values are: "asc" and "desc". + "value": "str" # Optional. Order by value. Known + values are: "asc" and "desc". + } + } + } + } + + # response body for status code(s): 200 + response == { + "@search.count": 0, # Optional. The total number of search results (not the + number of documents in a single page). + "@search.count.approximate": bool, # Optional. 'True' if the '@search.count' + is an approximate value and vise versa. + "@search.facets": { + "assetType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "classification": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactId": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "contactType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "entityType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "glossaryType": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "label": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "term": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termStatus": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ], + "termTemplate": [ + { + "count": 0, # Optional. The count of the facet item. + "value": "str" # Optional. The name of the facet + item. + } + ] + }, + "continuationToken": "str", # Optional. The token used to get next batch of + data. Absent if there's no more data. + "value": [ + { + "@search.highlights": { + "description": [ + "str" # Optional. Description. + ], + "entityType": [ + "str" # Optional. Entity type. + ], + "id": [ + "str" # Optional. Id. + ], + "name": [ + "str" # Optional. Name. + ], + "qualifiedName": [ + "str" # Optional. Qualified name. + ] + }, + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QueryResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_query_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.QueryResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def suggest( + self, body: _models.SuggestOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: ~azure.purview.datamap.models.SuggestOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the search. + "keywords": "str", # Optional. The keywords applied to all fields that + support suggest operation. It must be at least 1 character, and no more than 100 + characters. In the index schema we defined a default suggester which lists all + the supported fields and specifies a search mode. + "limit": 0 # Optional. The number of suggestions we hope to return. The + default value is 5. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + def suggest(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @overload + def suggest( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + + @distributed_trace + def suggest(self, body: Union[_models.SuggestOptions, JSON, IO[bytes]], **kwargs: Any) -> _models.SuggestResult: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param body: Is one of the following types: SuggestOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.SuggestOptions or JSON or IO[bytes] + :return: SuggestResult. The SuggestResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.SuggestResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the search. + "keywords": "str", # Optional. The keywords applied to all fields that + support suggest operation. It must be at least 1 character, and no more than 100 + characters. In the index schema we defined a default suggester which lists all + the supported fields and specifies a search mode. + "limit": 0 # Optional. The number of suggestions we hope to return. The + default value is 5. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "@search.score": 0.0, # Optional. The search score + calculated by the search engine. The results are ordered by search score + by default. + "@search.text": "str", # Optional. The target text that + contains the keyword as prefix. The keyword is wrapped with emphasis + mark. + "assetType": [ + "str" # Optional. The asset types of the asset. + ], + "classification": [ + "str" # Optional. The classifications of the record. + ], + "contact": [ + { + "contactType": "str", # Optional. The type + of the contact. It can be Expert or Owner for an entity. It can + be Expert or Steward for a glossary term. + "id": "str", # Optional. The GUID of the + contact. + "info": "str" # Optional. The description of + the contact. + } + ], + "createTime": 0, # Optional. The create time of the record. + The Unix epoch format. + "description": "str", # Optional. The description of the + asset. + "endorsement": "str", # Optional. The endorsement of the + asset. + "entityType": "str", # Optional. The type name of the asset. + "glossary": "str", # Optional. The glossary name of the + term. + "glossaryType": "str", # Optional. The type name of the + term. Could be AtlasGlossary, AtlasGlossaryTerm or AtlasGlossaryCategory. + "id": "str", # Optional. The GUID of the record. + "label": [ + "str" # Optional. The labels of the asset. + ], + "longDescription": "str", # Optional. The definition of the + term. + "name": "str", # Optional. The name of the record. + "objectType": "str", # Optional. The object type of the + record. Object type is the top-level property to distinguish whether a + record is an asset or a term. + "owner": "str", # Optional. The owner of the record. + "qualifiedName": "str", # Optional. The qualified name of + the record. + "term": [ + { + "glossaryName": "str", # Optional. The name + of the glossary which contains the term. + "guid": "str", # Optional. The GUID of the + term. + "name": "str" # Optional. The name of the + term. + } + ], + "termStatus": "str", # Optional. The status of the term. + "termTemplate": [ + "str" # Optional. The term template names used by + the term. + ], + "updateTime": 0 # Optional. The last update time of the + record. The Unix epoch format. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SuggestResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_suggest_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SuggestResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def auto_complete( + self, body: _models.AutoCompleteOptions, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + # pylint: disable=line-too-long + """Get auto complete options. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AutoCompleteOptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the autocomplete request. + "keywords": "str", # Optional. The keywords applied to all fields that + support autocomplete operation. It must be at least 1 character, and no more than + 100 characters. + "limit": 0 # Optional. The number of autocomplete results we hope to return. + The default value is 50. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @overload + def auto_complete( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + """Get auto complete options. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @overload + def auto_complete( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AutoCompleteResult: + """Get auto complete options. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + + @distributed_trace + def auto_complete( + self, body: Union[_models.AutoCompleteOptions, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AutoCompleteResult: + # pylint: disable=line-too-long + """Get auto complete options. + + :param body: Is one of the following types: AutoCompleteOptions, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AutoCompleteOptions or JSON or IO[bytes] + :return: AutoCompleteResult. The AutoCompleteResult is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AutoCompleteResult + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "filter": {}, # Optional. The filter for the autocomplete request. + "keywords": "str", # Optional. The keywords applied to all fields that + support autocomplete operation. It must be at least 1 character, and no more than + 100 characters. + "limit": 0 # Optional. The number of autocomplete results we hope to return. + The default value is 50. The value must be a number between 1 and 100. + } + + # response body for status code(s): 200 + response == { + "value": [ + { + "queryPlusText": "str", # Optional. The completed search + query text. + "text": "str" # Optional. The completed term or phrase. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutoCompleteResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_discovery_auto_complete_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutoCompleteResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class LineageOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`lineage` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, guid: str, *, direction: Union[str, _models.LineageDirection], depth: Optional[int] = None, **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Get lineage info of the entity specified by GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword depth: The number of hops for lineage. Default value is None. + :paramtype depth: int + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_request( + guid=guid, + direction=direction, + depth=depth, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_next_page( + self, + guid: str, + *, + direction: Union[str, _models.LineageDirection], + offset: Optional[int] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Return immediate next page lineage info about entity with pagination. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword offset: The offset for pagination purpose. Default value is None. + :paramtype offset: int + :keyword limit: The page size - by default there is no paging. Default value is None. + :paramtype limit: int + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_next_page_request( + guid=guid, + direction=direction, + offset=offset, + limit=limit, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_unique_attribute( + self, + type_name: str, + *, + direction: Union[str, _models.LineageDirection], + depth: Optional[int] = None, + attribute: Optional[str] = None, + **kwargs: Any + ) -> _models.AtlasLineageInfo: + # pylint: disable=line-too-long + """Return lineage info about entity. + + In addition to the typeName path parameter, + attribute key-value pair(s) can be provided in the following + format + + attr:[attrName]=[attrValue] + + NOTE: The attrName and attrValue should be + unique across entities, eg. qualifiedName. + + The REST request would look + something like this: + + GET + /v2/lineage/uniqueAttribute/type/aType?attr:aTypeAttribute=someValue. + + :param type_name: The name of the type. Required. + :type type_name: str + :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH. Known + values are: "INPUT", "OUTPUT", and "BOTH". Required. + :paramtype direction: str or ~azure.purview.datamap.models.LineageDirection + :keyword depth: The number of hops for lineage. Default value is None. + :paramtype depth: int + :keyword attribute: The qualified name of the entity. (This is only an example. qualifiedName + can + be changed to other unique attributes). Default value is None. + :paramtype attribute: str + :return: AtlasLineageInfo. The AtlasLineageInfo is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasLineageInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "baseEntityGuid": "str", # Optional. The GUID of the base entity. + "childrenCount": 0, # Optional. The number of children node. + "guidEntityMap": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "lineageDepth": 0, # Optional. The depth of lineage. + "lineageDirection": "str", # Optional. The enum of lineage direction. Known + values are: "INPUT", "OUTPUT", and "BOTH". + "lineageWidth": 0, # Optional. The width of lineage. + "parentRelations": [ + { + "childEntityId": "str", # Optional. The GUID of child + entity. + "parentEntityId": "str", # Optional. The GUID of parent + entity. + "relationshipId": "str" # Optional. The GUID of + relationship. + } + ], + "relations": [ + { + "fromEntityId": "str", # Optional. The GUID of from-entity. + "relationshipId": "str", # Optional. The GUID of + relationship. + "toEntityId": "str" # Optional. The GUID of to-entity. + } + ], + "widthCounts": { + "str": { + "str": {} # Optional. The entity count in specific + direction. + } + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasLineageInfo] = kwargs.pop("cls", None) + + _request = build_lineage_get_by_unique_attribute_request( + type_name=type_name, + direction=direction, + depth=depth, + attribute=attribute, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasLineageInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class RelationshipOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`relationship` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def create( + self, body: _models.AtlasRelationship, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + def create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @distributed_trace + def create( + self, body: Union[_models.AtlasRelationship, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasRelationship: + """Create a new relationship between entities. + + :param body: Is one of the following types: AtlasRelationship, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship or JSON or IO[bytes] + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasRelationship] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_relationship_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationship, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, body: _models.AtlasRelationship, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + def update(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @overload + def update( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + + @distributed_trace + def update( + self, body: Union[_models.AtlasRelationship, JSON, IO[bytes]], **kwargs: Any + ) -> _models.AtlasRelationship: + """Update an existing relationship between entities. + + :param body: Is one of the following types: AtlasRelationship, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasRelationship or JSON or IO[bytes] + :return: AtlasRelationship. The AtlasRelationship is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationship + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + + # response body for status code(s): 200 + response == { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known values + are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasRelationship] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_relationship_update_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationship, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, guid: str, *, extended_info: Optional[bool] = None, **kwargs: Any + ) -> _models.AtlasRelationshipWithExtInfo: + # pylint: disable=line-too-long + """Get relationship information between entities by its GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :keyword extended_info: Limits whether includes extended information. Default value is None. + :paramtype extended_info: bool + :return: AtlasRelationshipWithExtInfo. The AtlasRelationshipWithExtInfo is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipWithExtInfo + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "referredEntities": { + "str": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "classificationNames": [ + "str" # Optional. An array of classification names. + ], + "classifications": [ + { + "attributes": { + "str": {} # Optional. The attributes + of the struct. + }, + "entityGuid": "str", # Optional. The GUID of + the entity. + "entityStatus": "str", # Optional. Status of + the entity - can be active or deleted. Deleted entities are not + removed. Known values are: "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag + for concurrency control. + "removePropagationsOnEntityDelete": bool, # + Optional. Determines if propagations will be removed on entity + deletion. + "typeName": "str", # Optional. The name of + the type. + "validityPeriods": [ + { + "endTime": "str", # + Optional. The end of the time boundary. + "startTime": "str", # + Optional. The start of the time boundary. + "timeZone": "str" # + Optional. The timezone of the time boundary. + } + ] + } + ], + "displayText": "str", # Optional. The display text. + "guid": "str", # Optional. The GUID of the record. + "isIncomplete": bool, # Optional. Whether it is a shell + entity. + "labels": [ + "str" # Optional. labels. + ], + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "meaningNames": [ + "str" # Optional. An array of meanings. + ], + "meanings": [ + { + "confidence": 0, # Optional. The confidence + of the term assignment. + "createdBy": "str", # Optional. The user who + created the record. + "description": "str", # Optional. The + description of the term assignment. + "displayText": "str", # Optional. The + display text. + "expression": "str", # Optional. The + expression of the term assignment. + "relationGuid": "str", # Optional. The GUID + of the relationship. + "status": "str", # Optional. The status of + terms assignment. Known values are: "DISCOVERED", "PROPOSED", + "IMPORTED", "VALIDATED", "DEPRECATED", "OBSOLETE", and "OTHER". + "steward": "str", # Optional. The steward of + the term. + "termGuid": "str" # Optional. The GUID of + the term. + } + ], + "status": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "typeName": "str" # Optional. The name of the type. + } + }, + "relationship": { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "end1": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + }, + "end2": { + "guid": "str", # Optional. The GUID of the object. + "typeName": "str", # Optional. The name of the type. + "uniqueAttributes": { + "str": {} # Optional. The unique attributes of the + object. + } + }, + "guid": "str", # Optional. The GUID of the relationship. + "homeId": "str", # Optional. The home ID of the relationship. + "label": "str", # Optional. The label of the relationship. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "provenanceType": 0, # Optional. Used to record the provenance of an + instance of an entity or relationship. + "status": "str", # Optional. The enum of relationship status. Known + values are: "ACTIVE" and "DELETED". + "typeName": "str", # Optional. The name of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the relationship. + } + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipWithExtInfo] = kwargs.pop("cls", None) + + _request = build_relationship_get_request( + guid=guid, + extended_info=extended_info, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipWithExtInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, guid: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a relationship between entities by its GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_relationship_delete_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TypeDefinitionOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.DataMapClient`'s + :attr:`type_definition` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_business_metadata_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasBusinessMetadataDef: + # pylint: disable=line-too-long + """Get the businessMetadata definition for the given guid. + + :param guid: businessMetadata guid. Required. + :type guid: str + :return: AtlasBusinessMetadataDef. The AtlasBusinessMetadataDef is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasBusinessMetadataDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasBusinessMetadataDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_business_metadata_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasBusinessMetadataDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_business_metadata_by_name(self, name: str, **kwargs: Any) -> _models.AtlasBusinessMetadataDef: + # pylint: disable=line-too-long + """Get the businessMetadata definition by it's name (unique). + + :param name: businessMetadata name. Required. + :type name: str + :return: AtlasBusinessMetadataDef. The AtlasBusinessMetadataDef is compatible with + MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasBusinessMetadataDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasBusinessMetadataDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_business_metadata_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasBusinessMetadataDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_classification_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasClassificationDef: + # pylint: disable=line-too-long + """Get the classification definition for the given GUID. + + :param guid: The globally unique identifier of the classification. Required. + :type guid: str + :return: AtlasClassificationDef. The AtlasClassificationDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassificationDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassificationDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_classification_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassificationDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_classification_by_name(self, name: str, **kwargs: Any) -> _models.AtlasClassificationDef: + # pylint: disable=line-too-long + """Get the classification definition by its name (unique). + + :param name: The name of the classification. Required. + :type name: str + :return: AtlasClassificationDef. The AtlasClassificationDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasClassificationDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasClassificationDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_classification_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasClassificationDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_entity_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasEntityDef: + # pylint: disable=line-too-long + """Get the Entity definition for the given GUID. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :return: AtlasEntityDef. The AtlasEntityDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_entity_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_entity_by_name(self, name: str, **kwargs: Any) -> _models.AtlasEntityDef: + # pylint: disable=line-too-long + """Get the entity definition by its name (unique). + + :param name: The name of the entity. Required. + :type name: str + :return: AtlasEntityDef. The AtlasEntityDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEntityDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEntityDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_entity_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEntityDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_enum_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasEnumDef: + # pylint: disable=line-too-long + """Get the enum definition for the given GUID. + + :param guid: The globally unique identifier of the enum. Required. + :type guid: str + :return: AtlasEnumDef. The AtlasEnumDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEnumDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEnumDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_enum_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEnumDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_enum_by_name(self, name: str, **kwargs: Any) -> _models.AtlasEnumDef: + # pylint: disable=line-too-long + """Get the enum definition by its name (unique). + + :param name: The name of the enum. Required. + :type name: str + :return: AtlasEnumDef. The AtlasEnumDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasEnumDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasEnumDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_enum_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasEnumDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_relationship_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasRelationshipDef: + # pylint: disable=line-too-long + """Get the relationship definition for the given GUID. + + :param guid: The globally unique identifier of the relationship. Required. + :type guid: str + :return: AtlasRelationshipDef. The AtlasRelationshipDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_relationship_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_relationship_by_name(self, name: str, **kwargs: Any) -> _models.AtlasRelationshipDef: + # pylint: disable=line-too-long + """Get the relationship definition by its name (unique). + + :param name: The name of the relationship. Required. + :type name: str + :return: AtlasRelationshipDef. The AtlasRelationshipDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasRelationshipDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasRelationshipDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_relationship_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasRelationshipDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_struct_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasStructDef: + # pylint: disable=line-too-long + """Get the struct definition for the given GUID. + + :param guid: The globally unique identifier of the struct. Required. + :type guid: str + :return: AtlasStructDef. The AtlasStructDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasStructDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasStructDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_struct_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasStructDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_struct_by_name(self, name: str, **kwargs: Any) -> _models.AtlasStructDef: + # pylint: disable=line-too-long + """Get the struct definition by its name (unique). + + :param name: The name of the struct. Required. + :type name: str + :return: AtlasStructDef. The AtlasStructDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasStructDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasStructDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_struct_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasStructDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_id(self, guid: str, **kwargs: Any) -> _models.AtlasTypeDef: + # pylint: disable=line-too-long + """Get the type definition for the given GUID. + + :param guid: The globally unique identifier of the type. Required. + :type guid: str + :return: AtlasTypeDef. The AtlasTypeDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypeDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypeDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_by_id_request( + guid=guid, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypeDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_name(self, name: str, **kwargs: Any) -> _models.AtlasTypeDef: + # pylint: disable=line-too-long + """Get the type definition by its name (unique). + + :param name: The name of the type. Required. + :type name: str + :return: AtlasTypeDef. The AtlasTypeDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypeDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the type definition. + "elementDefs": [ + { + "description": "str", # Optional. The description of the + enum element definition. + "ordinal": 0, # Optional. The ordinal of the enum element + definition. + "value": "str" # Optional. The value of the enum element + definition. + } + ], + "endDef1": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "description": "str", # Optional. The description of the + relationship end definition. + "isContainer": bool, # Optional. Determines if it is container. + "isLegacyAttribute": bool, # Optional. Determines if it is a legacy + attribute. + "name": "str", # Optional. The name of the relationship end + definition. + "type": "str" # Optional. The type of the relationship end. + }, + "entityTypes": [ + "str" # Optional. Specifying a list of entityType names in the + classificationDef, ensures that classifications can only be applied to those + entityTypes. Any subtypes of the entity types inherit the restriction. Any + classificationDef subtypes inherit the parents entityTypes restrictions. Any + classificationDef subtypes can further restrict the parents entityTypes + restrictions by specifying a subset of the entityTypes. An empty entityTypes + list when there are no parent restrictions means there are no restrictions. + An empty entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes are + supplied, where one inherits from another, this will be rejected. This should + encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isLegacyAttribute": bool, # Optional. Determines if it is a + legacy attribute. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "relationshipTypeName": "str", # Optional. The name of the + relationship type. + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "relationshipCategory": "str", # Optional. The Relationship category + determines the style of relationship around containment and lifecycle. UML + terminology is used for the values. ASSOCIATION is a relationship with no + containment. COMPOSITION and AGGREGATION are containment relationships. The + difference being in the lifecycles of the container and its children. In the + COMPOSITION case, the children cannot exist without the container. For + AGGREGATION, the life cycles of the container and children are totally + independent. Known values are: "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the relationship. + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypeDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_by_name_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypeDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete API for type identified by its name. + + :param name: The name of the type. Required. + :type name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_type_definition_delete_request( + name=name, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get( + self, + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """List all type definitions in bulk. + + :keyword include_term_template: Whether include termtemplatedef when return all typedefs. + This is always true + when search filter type=term_template. Default value is None. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "PRIMITIVE", + "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", + and "TERM_TEMPLATE". Default value is None. + :paramtype type: str or ~azure.purview.datamap.models.TypeCategory + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_request( + include_term_template=include_term_template, + type=type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def batch_create( + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def batch_create( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def batch_create( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace + def batch_create(self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Create all atlas type definitions in bulk, only new definitions will be + created. + Any changes to the existing definitions will be discarded. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_create_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def batch_update( + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def batch_update( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def batch_update( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace + def batch_update(self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any) -> _models.AtlasTypesDef: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be + persisted. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: AtlasTypesDef. The AtlasTypesDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.AtlasTypesDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + + # response body for status code(s): 200 + response == { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AtlasTypesDef] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_update_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AtlasTypesDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: _models.AtlasTypesDef, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param body: Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def batch_delete( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.AtlasTypesDef, JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param body: Is one of the following types: AtlasTypesDef, JSON, IO[bytes] Required. + :type body: ~azure.purview.datamap.models.AtlasTypesDef or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "businessMetadataDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "classificationDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "entityTypes": [ + "str" # Optional. Specifying a list of entityType + names in the classificationDef, ensures that classifications can only + be applied to those entityTypes. Any subtypes of the entity types + inherit the restriction. Any classificationDef subtypes inherit the + parents entityTypes restrictions. Any classificationDef subtypes can + further restrict the parents entityTypes restrictions by specifying a + subset of the entityTypes. An empty entityTypes list when there are + no parent restrictions means there are no restrictions. An empty + entityTypes list when there are parent restrictions means that the + subtype picks up the parents restrictions. If a list of entityTypes + are supplied, where one inherits from another, this will be rejected. + This should encourage cleaner classificationsDefs. + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "entityDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipAttributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isLegacyAttribute": bool, # Optional. + Determines if it is a legacy attribute. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "relationshipTypeName": "str", # Optional. + The name of the relationship type. + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "serviceType": "str", # Optional. The service type. + "subTypes": [ + "str" # Optional. An array of sub types. + ], + "superTypes": [ + "str" # Optional. An array of super types. + ], + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "enumDefs": [ + { + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "defaultValue": "str", # Optional. The default value. + "description": "str", # Optional. The description of the + type definition. + "elementDefs": [ + { + "description": "str", # Optional. The + description of the enum element definition. + "ordinal": 0, # Optional. The ordinal of the + enum element definition. + "value": "str" # Optional. The value of the + enum element definition. + } + ], + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "relationshipDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "endDef1": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "endDef2": { + "cardinality": "str", # Optional. single-valued + attribute or multi-valued attribute. Known values are: "SINGLE", + "LIST", and "SET". + "description": "str", # Optional. The description of + the relationship end definition. + "isContainer": bool, # Optional. Determines if it is + container. + "isLegacyAttribute": bool, # Optional. Determines if + it is a legacy attribute. + "name": "str", # Optional. The name of the + relationship end definition. + "type": "str" # Optional. The type of the + relationship end. + }, + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "relationshipCategory": "str", # Optional. The Relationship + category determines the style of relationship around containment and + lifecycle. UML terminology is used for the values. ASSOCIATION is a + relationship with no containment. COMPOSITION and AGGREGATION are + containment relationships. The difference being in the lifecycles of the + container and its children. In the COMPOSITION case, the children cannot + exist without the container. For AGGREGATION, the life cycles of the + container and children are totally independent. Known values are: + "ASSOCIATION", "AGGREGATION", and "COMPOSITION". + "relationshipLabel": "str", # Optional. The label of the + relationship. + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "structDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ], + "termTemplateDefs": [ + { + "attributeDefs": [ + { + "cardinality": "str", # Optional. + single-valued attribute or multi-valued attribute. Known values + are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # + Optional. The parameters of the constraint + definition. + }, + "type": "str" # Optional. + The type of the constraint. + } + ], + "defaultValue": "str", # Optional. The + default value of the attribute. + "description": "str", # Optional. The + description of the attribute. + "includeInNotification": bool, # Optional. + Determines if it is included in notification. + "isIndexable": bool, # Optional. Determines + if it is indexable. + "isOptional": bool, # Optional. Determines + if it is optional. + "isUnique": bool, # Optional. Determines if + it unique. + "name": "str", # Optional. The name of the + attribute. + "options": { + "str": "str" # Optional. The options + for the attribute. + }, + "typeName": "str", # Optional. The name of + the type. + "valuesMaxCount": 0, # Optional. The maximum + count of the values. + "valuesMinCount": 0 # Optional. The minimum + count of the values. + } + ], + "category": "str", # Optional. The enum of type category. + Known values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the + record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available + locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency + of the date format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines + if grouping is used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The + maximum of fraction digits. + "maximumIntegerDigits": 0, # Optional. The + maximum of integer digits. + "minimumFractionDigits": 0, # Optional. The + minimum of fraction digits. + "minimumIntegerDigits": 0, # Optional. The + minimum of integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. + Determines if only integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum + of rounding mode. Known values are: "UP", "DOWN", "CEILING", + "FLOOR", "HALF_UP", "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of + available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The + display name of the timezone. + "dstSavings": 0, # Optional. The value of + the daylight saving time. + "id": "str", # Optional. The ID of the + timezone. + "rawOffset": 0 # Optional. The raw offset of + the timezone. + } + }, + "description": "str", # Optional. The description of the + type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency + control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type + definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the + record. + "version": 0 # Optional. The version of the record. + } + ] + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_type_definition_batch_delete_request( + content_type=content_type, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_headers( + self, + *, + include_term_template: Optional[bool] = None, + type: Optional[Union[str, _models.TypeCategory]] = None, + **kwargs: Any + ) -> List[_models.AtlasTypeDefHeader]: + # pylint: disable=line-too-long + """List all type definitions returned as a list of minimal information header. + + :keyword include_term_template: Whether include termtemplatedef when return all typedefs. + This is always true + when search filter type=term_template. Default value is None. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "PRIMITIVE", + "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", + and "TERM_TEMPLATE". Default value is None. + :paramtype type: str or ~azure.purview.datamap.models.TypeCategory + :return: list of AtlasTypeDefHeader + :rtype: list[~azure.purview.datamap.models.AtlasTypeDefHeader] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == [ + { + "category": "str", # Optional. The enum of type category. Known + values are: "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", + "CLASSIFICATION", "ENTITY", "ARRAY", "MAP", "RELATIONSHIP", and + "TERM_TEMPLATE". + "guid": "str", # Optional. The GUID of the type definition. + "name": "str" # Optional. The name of the type definition. + } + ] + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AtlasTypeDefHeader]] = kwargs.pop("cls", None) + + _request = build_type_definition_get_headers_request( + include_term_template=include_term_template, + type=type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.AtlasTypeDefHeader], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_term_template_by_id(self, guid: str, **kwargs: Any) -> _models.TermTemplateDef: + # pylint: disable=line-too-long + """Get the term template definition for the given GUID. + + :param guid: The globally unique identifier of the term template. Required. + :type guid: str + :return: TermTemplateDef. The TermTemplateDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.TermTemplateDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TermTemplateDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_term_template_by_id_request( + guid=guid, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TermTemplateDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_term_template_by_name(self, name: str, **kwargs: Any) -> _models.TermTemplateDef: + # pylint: disable=line-too-long + """Get the term template definition by its name (unique). + + :param name: The unique name of the term template. Required. + :type name: str + :return: TermTemplateDef. The TermTemplateDef is compatible with MutableMapping + :rtype: ~azure.purview.datamap.models.TermTemplateDef + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "attributeDefs": [ + { + "cardinality": "str", # Optional. single-valued attribute or + multi-valued attribute. Known values are: "SINGLE", "LIST", and "SET". + "constraints": [ + { + "params": { + "str": {} # Optional. The parameters + of the constraint definition. + }, + "type": "str" # Optional. The type of the + constraint. + } + ], + "defaultValue": "str", # Optional. The default value of the + attribute. + "description": "str", # Optional. The description of the + attribute. + "includeInNotification": bool, # Optional. Determines if it + is included in notification. + "isIndexable": bool, # Optional. Determines if it is + indexable. + "isOptional": bool, # Optional. Determines if it is + optional. + "isUnique": bool, # Optional. Determines if it unique. + "name": "str", # Optional. The name of the attribute. + "options": { + "str": "str" # Optional. The options for the + attribute. + }, + "typeName": "str", # Optional. The name of the type. + "valuesMaxCount": 0, # Optional. The maximum count of the + values. + "valuesMinCount": 0 # Optional. The minimum count of the + values. + } + ], + "category": "str", # Optional. The enum of type category. Known values are: + "PRIMITIVE", "OBJECT_ID_TYPE", "ENUM", "STRUCT", "CLASSIFICATION", "ENTITY", + "ARRAY", "MAP", "RELATIONSHIP", and "TERM_TEMPLATE". + "createTime": 0, # Optional. The created time of the record. + "createdBy": "str", # Optional. The user who created the record. + "dateFormatter": { + "availableLocales": [ + "str" # Optional. An array of available locales. + ], + "calendar": 0.0, # Optional. Calendar. + "dateInstance": ..., + "dateTimeInstance": ..., + "instance": ..., + "lenient": bool, # Optional. Determines the leniency of the date + format. + "numberFormat": { + "availableLocales": [ + "str" # Optional. The number format. + ], + "currency": "str", # Optional. The currency. + "currencyInstance": ..., + "groupingUsed": bool, # Optional. Determines if grouping is + used. + "instance": ..., + "integerInstance": ..., + "maximumFractionDigits": 0, # Optional. The maximum of + fraction digits. + "maximumIntegerDigits": 0, # Optional. The maximum of + integer digits. + "minimumFractionDigits": 0, # Optional. The minimum of + fraction digits. + "minimumIntegerDigits": 0, # Optional. The minimum of + integer digits. + "numberInstance": ..., + "parseIntegerOnly": bool, # Optional. Determines if only + integer is parsed. + "percentInstance": ..., + "roundingMode": "str" # Optional. The enum of rounding mode. + Known values are: "UP", "DOWN", "CEILING", "FLOOR", "HALF_UP", + "HALF_DOWN", "HALF_EVEN", and "UNNECESSARY". + }, + "timeInstance": ..., + "timeZone": { + "availableIds": [ + "str" # Optional. An array of available IDs. + ], + "default": ..., + "displayName": "str", # Optional. The display name of the + timezone. + "dstSavings": 0, # Optional. The value of the daylight + saving time. + "id": "str", # Optional. The ID of the timezone. + "rawOffset": 0 # Optional. The raw offset of the timezone. + } + }, + "description": "str", # Optional. The description of the type definition. + "guid": "str", # Optional. The GUID of the type definition. + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "name": "str", # Optional. The name of the type definition. + "options": { + "str": "str" # Optional. The options for the type definition. + }, + "serviceType": "str", # Optional. The service type. + "typeVersion": "str", # Optional. The version of the type. + "updateTime": 0, # Optional. The update time of the record. + "updatedBy": "str", # Optional. The user who updated the record. + "version": 0 # Optional. The version of the record. + } + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TermTemplateDef] = kwargs.pop("cls", None) + + _request = build_type_definition_get_term_template_by_name_request( + name=name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.AtlasErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.TermTemplateDef, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_patch.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/purview/azure-purview-datamap/azure/purview/datamap/py.typed b/sdk/purview/azure-purview-datamap/azure/purview/datamap/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/dev_requirements.txt b/sdk/purview/azure-purview-datamap/dev_requirements.txt new file mode 100644 index 000000000000..c4e89ba26d71 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/dev_requirements.txt @@ -0,0 +1,5 @@ +-e ../../../tools/azure-devtools +-e ../../../tools/azure-sdk-tools +../../core/azure-core +../../identity/azure-identity +aiohttp \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/pyproject.toml b/sdk/purview/azure-purview-datamap/pyproject.toml new file mode 100644 index 000000000000..0891ce3392f5 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/pyproject.toml @@ -0,0 +1,2 @@ +[tool.azure-sdk-build] +pylint = false diff --git a/sdk/purview/azure-purview-datamap/samples/README.md b/sdk/purview/azure-purview-datamap/samples/README.md new file mode 100644 index 000000000000..bc16107dc987 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/samples/README.md @@ -0,0 +1,42 @@ +--- +page_type: sample +languages: + - python +products: + - azure +urlFragment: azure-purview-datamap-samples +--- + +# Azure Purview DataMap service client library for Python Samples + +These are code samples that show common scenario operations with the Azure DataMap client library. +The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations. + +## Prerequisites + +* Python 3.8 or later is required to use this package +* You must have an [Azure subscription][azure_subscription] and a [Purview][purview_resource] to use this package. + +## Setup + +1. Install the Azure Web PubSub service client library for Python with [pip](https://pypi.org/project/pip/): + +```bash +pip install azure-purview-datamap +``` + +2. Clone or download this sample repository +3. Open the sample folder in Visual Studio Code or your IDE of choice. + +## Running the samples + +1. Open a terminal window and `cd` to the directory that the samples are saved in. +2. Set the environment variables specified in the sample file you wish to run. +3. Follow the usage described in the file, e.g. `python get_types.py` + + + + +[product_documentation]: https://azure.microsoft.com/services/purview/ +[azure_subscription]: https://azure.microsoft.com/free/ +[purview_resource]: https://docs.microsoft.com/azure/purview/create-catalog-portal \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/samples/get_types.py b/sdk/purview/azure-purview-datamap/samples/get_types.py new file mode 100644 index 000000000000..61d41f716315 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/samples/get_types.py @@ -0,0 +1,26 @@ +import logging +import os +from azure.identity import ClientSecretCredential +from azure.purview.datamap import DataMapClient + +logging.basicConfig(level=logging.DEBUG) +LOG = logging.getLogger() + +# Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +# PURVIEW_CLIENT_ID, PURVIEW_TENANT_ID, PURVIEW_CLIENT_SECRET +try: + endpoint = os.environ["PURVIEW_ENDPOINT"] + tenantId = os.environ["PURVIEW_TENANT_ID"] + clientId = os.environ["PURVIEW_CLIENT_ID"] + clientSecret = os.environ["PURVIEW_CLIENT_SECRET"] + authority = os.environ["AUTHORITY_HOST"] #e.g"https://login.microsoftonline.com/" +except KeyError: + LOG.error("Missing environment variable - please set if before running the example") + exit() + +credential = ClientSecretCredential(tenantId, clientId, clientSecret,authority = authority) +client = DataMapClient(endpoint=endpoint, credential=credential) +response = client.type_definition.get() + + + diff --git a/sdk/purview/azure-purview-datamap/setup.py b/sdk/purview/azure-purview-datamap/setup.py new file mode 100644 index 000000000000..2f897189a3b7 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/setup.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "azure-purview-datamap" +PACKAGE_PPRINT_NAME = "Azure Purview Datamap" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError("Cannot find version information") + + +setup( + name=PACKAGE_NAME, + version=version, + description="Microsoft {} Client Library for Python".format(PACKAGE_PPRINT_NAME), + long_description=open("README.md", "r").read(), + long_description_content_type="text/markdown", + license="MIT License", + author="Microsoft Corporation", + author_email="azpysdkhelp@microsoft.com", + url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk", + keywords="azure, azure sdk", + classifiers=[ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", + ], + zip_safe=False, + packages=find_packages( + exclude=[ + "tests", + # Exclude packages that will be covered by PEP420 or nspkg + "azure", + "azure.purview", + ] + ), + include_package_data=True, + package_data={ + "azure.purview.datamap": ["py.typed"], + }, + install_requires=[ + "isodate<1.0.0,>=0.6.1", + "azure-core<2.0.0,>=1.30.0", + "typing-extensions>=4.6.0", + ], + python_requires=">=3.8", +) diff --git a/sdk/purview/azure-purview-datamap/tests/conftest.py b/sdk/purview/azure-purview-datamap/tests/conftest.py new file mode 100644 index 000000000000..d7bbeda5fc54 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/tests/conftest.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- +import os +import platform +import pytest +import sys + +from dotenv import load_dotenv + +from devtools_testutils import test_proxy, add_general_regex_sanitizer, add_body_key_sanitizer, add_header_regex_sanitizer + +load_dotenv() + +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + subscription_id = os.environ.get("PURVIEWDATAMAP_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + tenant_id = os.environ.get("PURVIEWDATAMAP_TENANT_ID", "00000000-0000-0000-0000-000000000000") + client_id = os.environ.get("PURVIEWDATAMAP_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + client_secret = os.environ.get("PURVIEWDATAMAP_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000") + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") + add_body_key_sanitizer(json_path="$..atlasKafkaPrimaryEndpoint", value="000") + add_body_key_sanitizer(json_path="$..atlasKafkaSecondaryEndpoint", value="000") + add_body_key_sanitizer(json_path="$..systemData.createdBy", value="000") diff --git a/sdk/purview/azure-purview-datamap/tests/test_smoke.py b/sdk/purview/azure-purview-datamap/tests/test_smoke.py new file mode 100644 index 000000000000..fa19f82bdf1b --- /dev/null +++ b/sdk/purview/azure-purview-datamap/tests/test_smoke.py @@ -0,0 +1,21 @@ +# coding: utf-8 +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from testcase import DataMapTest, DataMapPowerShellPreparer +from urllib.parse import urlparse +from devtools_testutils import recorded_by_proxy + +class TestDataMapSmoke(DataMapTest): + @DataMapPowerShellPreparer() + @recorded_by_proxy + def test_basic_smoke_test(self, purviewdatamap_endpoint): + client = self.create_client(endpoint=purviewdatamap_endpoint) + assert client is not None + response = client.type_definition.get() + # cspell: disable-next-line + assert set(response.keys()) == set(['enumDefs', 'structDefs', 'classificationDefs', 'entityDefs', 'relationshipDefs','businessMetadataDefs','termTemplateDefs']) + + diff --git a/sdk/purview/azure-purview-datamap/tests/testcase.py b/sdk/purview/azure-purview-datamap/tests/testcase.py new file mode 100644 index 000000000000..dcbc1f89069a --- /dev/null +++ b/sdk/purview/azure-purview-datamap/tests/testcase.py @@ -0,0 +1,27 @@ +# coding: utf-8 +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import functools +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +from azure.purview.datamap import DataMapClient + + +class DataMapTest(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(DataMapClient) + return self.create_client_from_credential( + DataMapClient, + credential=credential, + endpoint=endpoint, + ) + + +DataMapPowerShellPreparer = functools.partial( + PowerShellPreparer, + "purviewdatamap", + purviewdatamap_endpoint="https://fakeaccount.purview.azure.com" +) diff --git a/sdk/purview/azure-purview-datamap/tsp-location.yaml b/sdk/purview/azure-purview-datamap/tsp-location.yaml new file mode 100644 index 000000000000..6a76c87decef --- /dev/null +++ b/sdk/purview/azure-purview-datamap/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/purview/Azure.Analytics.Purview.DataMap +commit: e4dd3e7e4d0402a81b2bef7dd754d3e46e8a8ab5 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/purview/ci.yml b/sdk/purview/ci.yml index 7f450e452a84..be3391c09967 100644 --- a/sdk/purview/ci.yml +++ b/sdk/purview/ci.yml @@ -36,6 +36,8 @@ extends: safeName: azurepurviewscanning - name: azure-purview-catalog safeName: azurepurviewcatalog + - name: azure-purview-datamap + safeName: azurepurviewdatamap - name: azure-purview-administration safeName: azurepurviewadministration - name: azure-purview-workflow