From 3fb20952b3d78ac5a96fedadd3edfdc77642a535 Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:23:51 -0700 Subject: [PATCH 1/6] Create datamap swagger config --- .../azure-purview-datamap/swagger/README.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/swagger/README.md diff --git a/sdk/purview/azure-purview-datamap/swagger/README.md b/sdk/purview/azure-purview-datamap/swagger/README.md new file mode 100644 index 000000000000..b07a3213870a --- /dev/null +++ b/sdk/purview/azure-purview-datamap/swagger/README.md @@ -0,0 +1,37 @@ +# Azure Purview for Python + +> see https://aka.ms/autorest + +### Setup + +Install Autorest v3 + +```ps +npm install -g autorest +``` + +### Generation + +```ps +cd +autorest +``` + +### Settings + +```yaml +input-file: https://github.com/Azure/azure-rest-api-specs/blob/28c5aaa5810448fce57da7e47427259a0c8850bf/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/stable/2023-09-01/purviewdatamap.json +output-folder: ../azure/purview/datamap +namespace: azure.purview.datamap +package-name: azure-purview-datamap +license-header: MICROSOFT_MIT_NO_VERSION +clear-output-folder: true +no-namespace-folders: true +python: true +title: PurviewDataMapClient +package-version: 1.0.0b1 +add-credential: true +credential-scopes: https://purview.azure.net/.default +only-path-params-positional: true +version-tolerant: true +``` From e20e2b74bf47602f2abea42520cbad34aaad7564 Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:25:09 -0700 Subject: [PATCH 2/6] Generate module code files with autorest --- .../azure-purview-datamap/azure/__init__.py | 0 .../azure/purview/__init__.py | 0 .../azure/purview/datamap/__init__.py | 26 + .../azure/purview/datamap/_client.py | 126 + .../azure/purview/datamap/_configuration.py | 65 + .../azure/purview/datamap/_patch.py | 20 + .../azure/purview/datamap/_serialization.py | 2005 + .../azure/purview/datamap/_vendor.py | 17 + .../azure/purview/datamap/_version.py | 9 + .../azure/purview/datamap/aio/__init__.py | 23 + .../azure/purview/datamap/aio/_client.py | 128 + .../purview/datamap/aio/_configuration.py | 65 + .../azure/purview/datamap/aio/_patch.py | 20 + .../azure/purview/datamap/aio/_vendor.py | 17 + .../datamap/aio/operations/__init__.py | 29 + .../datamap/aio/operations/_operations.py | 39460 +++++++++++++++ .../purview/datamap/aio/operations/_patch.py | 20 + .../purview/datamap/operations/__init__.py | 29 + .../purview/datamap/operations/_operations.py | 41653 ++++++++++++++++ .../azure/purview/datamap/py.typed | 1 + 20 files changed, 83713 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/azure/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_client.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_configuration.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_patch.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_serialization.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_vendor.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/_version.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_client.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_configuration.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_patch.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_vendor.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_patch.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/__init__.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/py.typed 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..e69de29bb2d1 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..e69de29bb2d1 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..c32ce6931411 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import PurviewDataMapClient +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__ = [ + "PurviewDataMapClient", +] +__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..b3b7c47ad393 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_client.py @@ -0,0 +1,126 @@ +# 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) AutoRest 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 PurviewDataMapClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import ( + DiscoveryOperations, + EntityOperations, + GlossaryOperations, + LineageOperations, + RelationshipOperations, + TypeOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class PurviewDataMapClient: # pylint: disable=client-accepts-api-version-keyword + """Purview Data Map Service is a fully managed cloud service whose users can discover the data + sources they need and understand the data sources they find. At the same time, Data Map helps + organizations get more value from their existing investments. This spec defines REST API of + Purview Data Map Service. + + :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: TypeOperations operations + :vartype type: azure.purview.datamap.operations.TypeOperations + :param endpoint: The datamap endpoint of your Purview account. Example: + https://{accountName}.purview.azure.com. 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: Api Version. Known values are "2023-09-01" and None. Default value is + None. 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 = PurviewDataMapClientConfiguration(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 = TypeOperations(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) -> "PurviewDataMapClient": + 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..9356b57e3875 --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, 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 PurviewDataMapClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for PurviewDataMapClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: The datamap endpoint of your Purview account. Example: + https://{accountName}.purview.azure.com. 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: Api Version. Known values are "2023-09-01" and None. Default value is + None. 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: Optional[str] = kwargs.pop("api_version", None) + + 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/_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..baa661cb82d2 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_serialization.py @@ -0,0 +1,2005 @@ +# -------------------------------------------------------------------------- +# +# 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 + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str + unicode_str = str + +_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[ModelType]]] = 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[ModelType]] = 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 = unicode_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 unicode_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[ModelType]]] = 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[ModelType]] = 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, basestring): + 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, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + 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, (basestring, 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, basestring): + 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, basestring): + 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..3e21ea6effcb --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/_vendor.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + + +def raise_if_not_implemented(cls, abstract_methods): + not_implemented = [f for f in abstract_methods if not callable(getattr(cls, f, None))] + if not_implemented: + raise NotImplementedError( + "The following methods on operation group '{}' are not implemented: '{}'." + " Please refer to https://aka.ms/azsdk/python/dpcodegen/python/customize to learn how to customize.".format( + cls.__name__, "', '".join(not_implemented) + ) + ) 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..e5754a47ce68 --- /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) AutoRest 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..f62e570f5b6e --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import PurviewDataMapClient + +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__ = [ + "PurviewDataMapClient", +] +__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..2dc3de15a0db --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_client.py @@ -0,0 +1,128 @@ +# 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) AutoRest 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 PurviewDataMapClientConfiguration +from .operations import ( + DiscoveryOperations, + EntityOperations, + GlossaryOperations, + LineageOperations, + RelationshipOperations, + TypeOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class PurviewDataMapClient: # pylint: disable=client-accepts-api-version-keyword + """Purview Data Map Service is a fully managed cloud service whose users can discover the data + sources they need and understand the data sources they find. At the same time, Data Map helps + organizations get more value from their existing investments. This spec defines REST API of + Purview Data Map Service. + + :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: TypeOperations operations + :vartype type: azure.purview.datamap.aio.operations.TypeOperations + :param endpoint: The datamap endpoint of your Purview account. Example: + https://{accountName}.purview.azure.com. 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: Api Version. Known values are "2023-09-01" and None. Default value is + None. 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 = PurviewDataMapClientConfiguration(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 = TypeOperations(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) -> "PurviewDataMapClient": + 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..1384e2453abf --- /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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, 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 PurviewDataMapClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for PurviewDataMapClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: The datamap endpoint of your Purview account. Example: + https://{accountName}.purview.azure.com. 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: Api Version. Known values are "2023-09-01" and None. Default value is + None. 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: Optional[str] = kwargs.pop("api_version", None) + + 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/_vendor.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_vendor.py new file mode 100644 index 000000000000..3e21ea6effcb --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/_vendor.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + + +def raise_if_not_implemented(cls, abstract_methods): + not_implemented = [f for f in abstract_methods if not callable(getattr(cls, f, None))] + if not_implemented: + raise NotImplementedError( + "The following methods on operation group '{}' are not implemented: '{}'." + " Please refer to https://aka.ms/azsdk/python/dpcodegen/python/customize to learn how to customize.".format( + cls.__name__, "', '".join(not_implemented) + ) + ) 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..7ac6c86750ea --- /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) AutoRest 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 TypeOperations + +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", + "TypeOperations", +] +__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..6f024d085957 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/aio/operations/_operations.py @@ -0,0 +1,39460 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, 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 ...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_bulk_create_or_update_request, + build_entity_bulk_delete_request, + build_entity_bulk_set_classifications_request, + build_entity_create_or_update_request, + build_entity_delete_by_unique_attribute_request, + build_entity_delete_request, + build_entity_get_by_unique_attributes_request, + build_entity_get_classification_request, + build_entity_get_classifications_request, + build_entity_get_header_request, + build_entity_get_request, + build_entity_get_sample_business_metadata_template_request, + build_entity_list_by_guids_request, + build_entity_list_by_unique_attributes_request, + build_entity_move_entities_to_collection_request, + build_entity_partial_update_attribute_by_guid_request, + build_entity_partial_update_by_unique_attributes_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_classifications_by_unique_attribute_request, + build_entity_update_classifications_request, + build_glossary_assign_term_to_entities_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_category_request, + build_glossary_get_detailed_request, + build_glossary_get_request, + build_glossary_get_term_request, + build_glossary_list_categories_headers_request, + build_glossary_list_categories_request, + build_glossary_list_category_terms_request, + build_glossary_list_entities_assigned_with_term_request, + build_glossary_list_related_categories_request, + build_glossary_list_related_terms_request, + build_glossary_list_request, + build_glossary_list_term_headers_request, + build_glossary_list_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_bulk_create_request, + build_type_bulk_delete_request, + build_type_bulk_update_request, + build_type_delete_request, + build_type_get_business_metadata_def_by_guid_request, + build_type_get_business_metadata_def_by_name_request, + build_type_get_by_guid_request, + build_type_get_by_name_request, + build_type_get_classification_def_by_guid_request, + build_type_get_classification_def_by_name_request, + build_type_get_entity_def_by_guid_request, + build_type_get_entity_def_by_name_request, + build_type_get_enum_def_by_guid_request, + build_type_get_enum_def_by_name_request, + build_type_get_relationship_def_by_guid_request, + build_type_get_relationship_def_by_name_request, + build_type_get_struct_def_by_guid_request, + build_type_get_struct_def_by_name_request, + build_type_get_term_template_def_by_guid_request, + build_type_get_term_template_def_by_name_request, + build_type_list_headers_request, + build_type_list_request, +) +from .._vendor import raise_if_not_implemented + +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=abstract-class-instantiated,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.aio.PurviewDataMapClient`'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") + + raise_if_not_implemented( + self.__class__, + [ + "import_business_metadata", + ], + ) + + @overload + async def create_or_update( + self, + entity: JSON, + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 entity: Atlas entity with extended information. Required. + :type entity: 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 + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entity = { + "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.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.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.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.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, + entity: IO[bytes], + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 entity: Atlas entity with extended information. Required. + :type entity: 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 + :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: JSON object + :rtype: JSON + :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, + entity: Union[JSON, IO[bytes]], + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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 entity: Atlas entity with extended information. Is either a JSON type or a IO[bytes] + type. Required. + :type entity: 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 + :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. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entity = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(entity, (IOBase, bytes)): + _content = entity + else: + _json = entity + + _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, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_by_guids( + self, *, guids: List[str], min_ext_info: bool = False, ignore_relationships: bool = False, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List entities in bulk identified by its GUIDs. + + :keyword guids: An array of GUIDs of entities to list. Required. + :paramtype guids: list[str] + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_list_by_guids_request( + guids=guids, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def bulk_create_or_update( + self, + entities: JSON, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 entities: An array of entities to create or update. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entities = { + "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.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.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.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.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 bulk_create_or_update( + self, + entities: IO[bytes], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 entities: An array of entities to create or update. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :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 bulk_create_or_update( + self, + entities: Union[JSON, IO[bytes]], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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 entities: An array of entities to create or update. Is either a JSON type or a IO[bytes] + type. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entities = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(entities, (IOBase, bytes)): + _content = entities + else: + _json = entities + + _request = build_entity_bulk_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, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def bulk_delete(self, *, guids: List[str], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a list of entities in bulk identified by their GUIDs or unique attributes. + + :keyword guids: An array of GUIDs of entities to delete. Required. + :paramtype guids: list[str] + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_bulk_delete_request( + guids=guids, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def add_classification( # pylint: disable=inconsistent-return-statements + self, request: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Required. + :type request: 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + request = { + "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, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Required. + :type request: 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, request: Union[JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Is either a + JSON type or a IO[bytes] type. Required. + :type request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + request = { + "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" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = request + + _request = build_entity_add_classification_request( + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get( + self, guid: str, *, min_ext_info: bool = False, ignore_relationships: bool = False, **kwargs: Any + ) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def partial_update_attribute_by_guid(self, guid: str, body: JSON, *, name: str, **kwargs: Any) -> JSON: + # 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: JSON + :keyword name: The name of the attribute. Required. + :paramtype name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _json = body + + _request = build_entity_partial_update_attribute_by_guid_request( + guid=guid, + name=name, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_classification(self, guid: str, classification_name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_classifications(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, classifications: List[JSON], *, 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 classifications: An array of classifications to be added. Required. + :type classifications: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + classifications = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, classifications: 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 classifications: An array of classifications to be added. Required. + :type classifications: 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, classifications: Union[List[JSON], 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 classifications: An array of classifications to be added. Is either a [JSON] type or a + IO[bytes] type. Required. + :type classifications: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(classifications, (IOBase, bytes)): + _content = classifications + else: + _json = classifications + + _request = build_entity_add_classifications_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, classifications: List[JSON], *, 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 classifications: An array of classifications to be updated. Required. + :type classifications: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + classifications = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, classifications: 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 classifications: An array of classifications to be updated. Required. + :type classifications: 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, classifications: Union[List[JSON], 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 classifications: An array of classifications to be updated. Is either a [JSON] type or a + IO[bytes] type. Required. + :type classifications: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(classifications, (IOBase, bytes)): + _content = classifications + else: + _json = classifications + + _request = build_entity_update_classifications_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + attr_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_get_by_unique_attributes_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: JSON, + *, + attr_qualified_name: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Required. + :type atlas_entity_with_ext_info: JSON + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_entity_with_ext_info = { + "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.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.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.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.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 partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: IO[bytes], + *, + attr_qualified_name: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Required. + :type atlas_entity_with_ext_info: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :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 partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: Union[JSON, IO[bytes]], + *, + attr_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Is either a JSON + type or a IO[bytes] type. Required. + :type atlas_entity_with_ext_info: JSON or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_entity_with_ext_info = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(atlas_entity_with_ext_info, (IOBase, bytes)): + _content = atlas_entity_with_ext_info + else: + _json = atlas_entity_with_ext_info + + _request = build_entity_partial_update_by_unique_attributes_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_by_unique_attribute( + self, type_name: str, *, attr_qualified_name: Optional[str] = None, **kwargs: Any + ) -> JSON: + # 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_delete_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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, *, attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_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_by_unique_attribute_request( + type_name=type_name, + classification_name=classification_name, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + 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, + atlas_classification_array: List[JSON], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Required. + :type atlas_classification_array: list[JSON] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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. + atlas_classification_array = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, + atlas_classification_array: IO[bytes], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Required. + :type atlas_classification_array: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + atlas_classification_array: Union[List[JSON], IO[bytes]], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Is either a [JSON] + type or a IO[bytes] type. Required. + :type atlas_classification_array: list[JSON] or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(atlas_classification_array, (IOBase, bytes)): + _content = atlas_classification_array + else: + _json = atlas_classification_array + + _request = build_entity_add_classifications_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def update_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: List[JSON], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Required. + :type atlas_classification_array: list[JSON] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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. + atlas_classification_array = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: IO[bytes], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Required. + :type atlas_classification_array: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: Union[List[JSON], IO[bytes]], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Is either a [JSON] + type or a IO[bytes] type. Required. + :type atlas_classification_array: list[JSON] or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(atlas_classification_array, (IOBase, bytes)): + _content = atlas_classification_array + else: + _json = atlas_classification_array + + _request = build_entity_update_classifications_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def bulk_set_classifications( + self, entity_headers: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Required. + :type entity_headers: 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 + + # JSON input template you can fill out and use as your body input. + entity_headers = { + "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 bulk_set_classifications( + self, entity_headers: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Required. + :type entity_headers: 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 bulk_set_classifications(self, entity_headers: Union[JSON, IO[bytes]], **kwargs: Any) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Is either a JSON type or a IO[bytes] type. + Required. + :type entity_headers: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + entity_headers = { + "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" + _json = None + _content = None + if isinstance(entity_headers, (IOBase, bytes)): + _content = entity_headers + else: + _json = entity_headers + + _request = build_entity_bulk_set_classifications_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[str], deserialized), {}) # type: ignore + + return cast(List[str], deserialized) # type: ignore + + @distributed_trace_async + async def list_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + attr_n_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :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: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_header(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[Dict[str, JSON]] = None, + *, + 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 business_metadata: Default value is None. + :type business_metadata: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata = { + "str": {} # Optional. + } + """ + + @overload + async def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[IO[bytes]] = None, + *, + 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 business_metadata: Default value is None. + :type business_metadata: 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, business_metadata: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata: Is either a {str: JSON} type or a IO[bytes] type. Default value is + None. + :type business_metadata: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata, (IOBase, bytes)): + _content = business_metadata + else: + if business_metadata is not None: + _json = business_metadata + else: + _json = None + + _request = build_entity_remove_business_metadata_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + business_metadata: Optional[Dict[str, JSON]] = None, + *, + is_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 business_metadata: Default value is None. + :type business_metadata: dict[str, JSON] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_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. + business_metadata = { + "str": {} # Optional. + } + """ + + @overload + async def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[IO[bytes]] = None, + *, + is_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 business_metadata: Default value is None. + :type business_metadata: IO[bytes] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_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, + business_metadata: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + *, + is_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 business_metadata: Is either a {str: JSON} type or a IO[bytes] type. Default value is + None. + :type business_metadata: dict[str, JSON] or IO[bytes] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_overwrite: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata, (IOBase, bytes)): + _content = business_metadata + else: + if business_metadata is not None: + _json = business_metadata + else: + _json = None + + _request = build_entity_add_or_update_business_metadata_request( + guid=guid, + is_overwrite=is_overwrite, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Dict[str, JSON]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata_attributes = { + "str": {} # Optional. + } + """ + + @overload + async def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + **kwargs: Any + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Is either a {str: JSON} type or a IO[bytes] type. Default + value is None. + :type business_metadata_attributes: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata_attributes, (IOBase, bytes)): + _content = business_metadata_attributes + else: + if business_metadata_attributes is not None: + _json = business_metadata_attributes + else: + _json = None + + _request = build_entity_remove_business_metadata_attributes_request( + bm_name=bm_name, + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Dict[str, JSON]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata_attributes = { + "str": {} # Optional. + } + """ + + @overload + async def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + **kwargs: Any + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Is either a {str: JSON} type or a IO[bytes] type. Default + value is None. + :type business_metadata_attributes: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata_attributes, (IOBase, bytes)): + _content = business_metadata_attributes + else: + if business_metadata_attributes is not None: + _json = business_metadata_attributes + else: + _json = None + + _request = build_entity_add_or_update_business_metadata_attributes_request( + bm_name=bm_name, + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def get_sample_business_metadata_template(self, **kwargs: Any) -> AsyncIterator[bytes]: + """Get the sample Template for uploading/creating bulk BusinessMetaData. + + :return: Async iterator of the response bytes + :rtype: AsyncIterator[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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_entity_get_sample_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 = 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) + raise HttpResponseError(response=response) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), {}) # type: ignore + + return cast(AsyncIterator[bytes], 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_remove_labels_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_set_labels_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_add_label_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_remove_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_set_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_add_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def move_entities_to_collection( + self, move_entities_request: JSON, *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Required. + :type move_entities_request: 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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + move_entities_request = { + "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, + move_entities_request: IO[bytes], + *, + collection_id: str, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Required. + :type move_entities_request: 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: JSON object + :rtype: JSON + :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, move_entities_request: Union[JSON, IO[bytes]], *, collection_id: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Is either a JSON + type or a IO[bytes] type. Required. + :type move_entities_request: JSON or 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. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + move_entities_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move_entities_request, (IOBase, bytes)): + _content = move_entities_request + else: + _json = move_entities_request + + _request = build_entity_move_entities_to_collection_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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.PurviewDataMapClient`'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 list( + self, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + ignore_terms_and_categories: bool = False, + **kwargs: Any + ) -> List[JSON]: + # 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/{glossaryGuid}/terms' and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryGuid}/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 "ASC". + :paramtype sort: str + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + async def create(self, atlas_glossary: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Required. + :type atlas_glossary: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_glossary = { + "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, atlas_glossary: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Required. + :type atlas_glossary: 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: JSON object + :rtype: JSON + :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, atlas_glossary: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Is either a JSON type or a + IO[bytes] type. Required. + :type atlas_glossary: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_glossary = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(atlas_glossary, (IOBase, bytes)): + _content = atlas_glossary + else: + _json = atlas_glossary + + _request = build_glossary_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def create_categories( + self, glossary_category: List[JSON], *, content_type: str = "application/json", **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Required. + :type glossary_category: list[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 JSON object + :rtype: list[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = [ + { + "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, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Required. + :type glossary_category: 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 JSON object + :rtype: list[JSON] + :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, glossary_category: Union[List[JSON], IO[bytes]], **kwargs: Any) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Is either a + [JSON] type or a IO[bytes] type. Required. + :type glossary_category: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_create_categories_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + async def create_category( + self, glossary_category: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Required. + :type glossary_category: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Required. + :type glossary_category: 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: JSON object + :rtype: JSON + :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, glossary_category: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Is either a JSON type or a IO[bytes] type. Required. + :type glossary_category: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_create_category_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_category(self, category_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get specific glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_request( + category_guid=category_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update_category( + self, category_guid: str, glossary_category: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Required. + :type glossary_category: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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_guid: str, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Required. + :type glossary_category: 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: JSON object + :rtype: JSON + :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_guid: str, glossary_category: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Is either a JSON type or a + IO[bytes] type. Required. + :type glossary_category: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_update_category_request( + category_guid=category_guid, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_category( # pylint: disable=inconsistent-return-statements + self, category_guid: str, **kwargs: Any + ) -> None: + """Delete a glossary category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_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_glossary_delete_category_request( + category_guid=category_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def partial_update_category(self, category_guid: str, partial_updates: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial updating + shortDescription and longDescription for category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values for partial update. Required. + :type partial_updates: JSON + :return: JSON object + :rtype: JSON + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_category_request( + category_guid=category_guid, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_related_categories( + self, + category_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> Dict[str, List[JSON]]: + """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_guid: The globally unique identifier of the category. Required. + :type category_guid: 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 "ASC". + :paramtype sort: str + :return: dict mapping str to list of JSON object + :rtype: dict[str, list[JSON]] + :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[JSON]]] = kwargs.pop("cls", None) + + _request = build_glossary_list_related_categories_request( + category_guid=category_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(Dict[str, List[JSON]], deserialized), {}) # type: ignore + + return cast(Dict[str, List[JSON]], deserialized) # type: ignore + + @distributed_trace_async + async def list_category_terms( + self, + category_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get all terms associated with the specific category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_category_terms_request( + category_guid=category_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + async def create_term( + self, + glossary_term: JSON, + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Required. + :type glossary_term: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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, glossary_term: Union[JSON, IO[bytes]], *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Is either a JSON type or a IO[bytes] type. Required. + :type glossary_term: JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_create_term_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_term(self, term_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get a specific glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :return: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_request( + term_guid=term_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update_term( + self, + term_guid: str, + glossary_term: JSON, + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Required. + :type glossary_term: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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_guid: str, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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_guid: str, + glossary_term: Union[JSON, IO[bytes]], + *, + include_term_hierarchy: bool = False, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Is either a JSON type or a IO[bytes] + type. Required. + :type glossary_term: JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_update_term_request( + term_guid=term_guid, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete_term( # pylint: disable=inconsistent-return-statements + self, term_guid: str, **kwargs: Any + ) -> None: + """Delete a glossary term. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_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_glossary_delete_term_request( + term_guid=term_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def partial_update_term( + self, term_guid: str, partial_updates: JSON, *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> JSON: + # 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values to be updated. Required. + :type partial_updates: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :return: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_term_request( + term_guid=term_guid, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def create_terms( + self, + glossary_term: List[JSON], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Required. + :type glossary_term: list[JSON] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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 JSON object + :rtype: list[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = [ + { + "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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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 JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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, glossary_term: Union[List[JSON], IO[bytes]], *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Is either a + [JSON] type or a IO[bytes] type. Required. + :type glossary_term: list[JSON] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: list of JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_create_terms_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace_async + async def list_entities_assigned_with_term( + self, + term_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """List all related objects assigned with the specified term. Recommend using limit/offset to get + pagination result. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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. + "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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_entities_assigned_with_term_request( + term_guid=term_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + async def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_guid: str, related_object_ids: List[JSON], *, 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Required. + :type related_object_ids: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + related_object_ids = [ + { + "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. + "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_guid: str, related_object_ids: 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Required. + :type related_object_ids: 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_guid: str, related_object_ids: Union[List[JSON], 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Is either a [JSON] type or a IO[bytes] type. Required. + :type related_object_ids: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(related_object_ids, (IOBase, bytes)): + _content = related_object_ids + else: + _json = related_object_ids + + _request = build_glossary_assign_term_to_entities_request( + term_guid=term_guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + async def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_guid: str, related_object_ids: List[JSON], *, 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Required. + :type related_object_ids: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + related_object_ids = [ + { + "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. + "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_guid: str, related_object_ids: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Required. + :type related_object_ids: 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_guid: str, related_object_ids: Union[List[JSON], IO[bytes]], **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Is either a [JSON] type or a IO[bytes] type. Required. + :type related_object_ids: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(related_object_ids, (IOBase, bytes)): + _content = related_object_ids + else: + _json = related_object_ids + + _request = build_glossary_delete_term_assignment_from_entities_request( + term_guid=term_guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def list_related_terms( + self, + term_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> Dict[str, List[JSON]]: + # 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: 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 "ASC". + :paramtype sort: str + :return: dict mapping str to list of JSON object + :rtype: dict[str, list[JSON]] + :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[JSON]]] = kwargs.pop("cls", None) + + _request = build_glossary_list_related_terms_request( + term_guid=term_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(Dict[str, List[JSON]], deserialized), {}) # type: ignore + + return cast(Dict[str, List[JSON]], deserialized) # type: ignore + + @distributed_trace_async + async def get(self, glossary_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get a specific Glossary by its GUID. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_request( + glossary_guid=glossary_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update( + self, + glossary_guid: str, + updated_glossary: JSON, + *, + ignore_terms_and_categories: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Required. + :type updated_glossary: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + updated_glossary = { + "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_guid: str, + updated_glossary: IO[bytes], + *, + ignore_terms_and_categories: bool = False, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Required. + :type updated_glossary: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :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: JSON object + :rtype: JSON + :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_guid: str, + updated_glossary: Union[JSON, IO[bytes]], + *, + ignore_terms_and_categories: bool = False, + **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Is either a JSON type or a + IO[bytes] type. Required. + :type updated_glossary: JSON or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + updated_glossary = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(updated_glossary, (IOBase, bytes)): + _content = updated_glossary + else: + _json = updated_glossary + + _request = build_glossary_update_request( + glossary_guid=glossary_guid, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def delete(self, glossary_guid: 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_guid: The globally unique identifier for glossary. Required. + :type glossary_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_glossary_delete_request( + glossary_guid=glossary_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def list_categories( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get the categories belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_categories_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace_async + async def list_categories_headers( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + """Get the category headers belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_categories_headers_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace_async + async def get_detailed(self, glossary_guid: str, **kwargs: Any) -> JSON: + # 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/{glossaryGuid}/terms' and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryGuid}/categories'. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :return: JSON object + :rtype: JSON + :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. An + array of related object IDs. + "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. The + hierarchy information of the term. + "guid": "str", # Optional. The GUID of the + object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy + information of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The + hierarchy information of the term. + "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 glossary term information. + ], + "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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_detailed_request( + glossary_guid=glossary_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def partial_update( + self, glossary_guid: str, partial_updates: JSON, *, ignore_terms_and_categories: bool = False, **kwargs: Any + ) -> JSON: + # 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_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values. Required. + :type partial_updates: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :return: JSON object + :rtype: JSON + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_request( + glossary_guid=glossary_guid, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_terms( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get terms belonging to a specific glossary. Recommend using limit/offset to get pagination + result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_terms_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace_async + async def list_term_headers( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get term headers belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_term_headers_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], 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.PurviewDataMapClient`'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, search_request: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Required. + :type search_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + search_request = { + "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": {} # Optional. Any object. + } + ], + "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. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": {} # Optional. Any object. + } + } + } + + # 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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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, search_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Required. + :type search_request: 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: JSON object + :rtype: JSON + :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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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, search_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Is either a JSON type or a + IO[bytes] type. Required. + :type search_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + search_request = { + "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": {} # Optional. Any object. + } + ], + "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. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": {} # Optional. Any object. + } + } + } + + # 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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(search_request, (IOBase, bytes)): + _content = search_request + else: + _json = search_request + + _request = build_discovery_query_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def suggest(self, suggest_request: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Required. + :type suggest_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + suggest_request = { + "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, suggest_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Required. + :type suggest_request: 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: JSON object + :rtype: JSON + :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, suggest_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Is either a JSON type or a + IO[bytes] type. Required. + :type suggest_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + suggest_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(suggest_request, (IOBase, bytes)): + _content = suggest_request + else: + _json = suggest_request + + _request = build_discovery_suggest_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def auto_complete( + self, auto_complete_request: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Required. + :type auto_complete_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + auto_complete_request = { + "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, auto_complete_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Required. + :type auto_complete_request: 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: JSON object + :rtype: JSON + :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, auto_complete_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Is either a JSON + type or a IO[bytes] type. Required. + :type auto_complete_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + auto_complete_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(auto_complete_request, (IOBase, bytes)): + _content = auto_complete_request + else: + _json = auto_complete_request + + _request = build_discovery_auto_complete_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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.PurviewDataMapClient`'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: str, depth: int = 3, **kwargs: Any) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :keyword depth: The number of hops for lineage. Default value is 3. + :paramtype depth: int + :return: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_next_page( + self, guid: str, *, direction: str, offset: Optional[int] = None, limit: Optional[int] = None, **kwargs: Any + ) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_by_unique_attribute( + self, + type_name: str, + *, + direction: str, + depth: int = 3, + attr_qualified_name: Optional[str] = None, + **kwargs: Any + ) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :keyword depth: The number of hops for lineage. Default value is 3. + :paramtype depth: int + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_lineage_get_by_unique_attribute_request( + type_name=type_name, + direction=direction, + depth=depth, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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.PurviewDataMapClient`'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, relationship: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.0 # Optional. The version of the relationship. + } + """ + + @overload + async def create(self, relationship: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: 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: JSON object + :rtype: JSON + :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.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.0 # Optional. The version of the relationship. + } + """ + + @distributed_trace_async + async def create(self, relationship: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Is either a JSON type or a IO[bytes] type. Required. + :type relationship: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(relationship, (IOBase, bytes)): + _content = relationship + else: + _json = relationship + + _request = build_relationship_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def update(self, relationship: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.0 # Optional. The version of the relationship. + } + """ + + @overload + async def update(self, relationship: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: 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: JSON object + :rtype: JSON + :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.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.0 # Optional. The version of the relationship. + } + """ + + @distributed_trace_async + async def update(self, relationship: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Is either a JSON type or a IO[bytes] type. Required. + :type relationship: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(relationship, (IOBase, bytes)): + _content = relationship + else: + _json = relationship + + _request = build_relationship_update_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get(self, guid: str, *, extended_info: Optional[bool] = None, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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.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.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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TypeOperations: # 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.PurviewDataMapClient`'s + :attr:`type` 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_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the businessMetadata definition for the given guid. + + :param guid: businessMetadata guid. Required. + :type guid: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_business_metadata_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_business_metadata_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the businessMetadata definition by it's name (unique). + + :param name: businessMetadata name. Required. + :type name: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_business_metadata_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_classification_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. .. raw:: html
  • 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_classification_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_classification_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. .. raw:: html
  • 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_classification_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_entity_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_entity_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_entity_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_entity_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_enum_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_enum_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_enum_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_enum_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_relationship_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_relationship_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_relationship_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_relationship_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_struct_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_struct_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_struct_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_struct_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. .. raw:: html

  • 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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. .. raw:: html

  • 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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def list(self, *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any) -> JSON: + # 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 False. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "enum", + "entity", "classification", "relationship", "struct", and "term_template". Default value is + None. + :paramtype type: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def bulk_create(self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Required. + :type types_def: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def bulk_create(self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Required. + :type types_def: 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace_async + async def bulk_create(self, types_def: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Is either a JSON type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def bulk_update(self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Required. + :type types_def: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def bulk_update(self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Required. + :type types_def: 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace_async + async def bulk_update(self, types_def: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Is either a + JSON type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_update_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + async def bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Required. + :type types_def: 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + async def bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Required. + :type types_def: 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 bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: Union[JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Is either a JSON + type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_delete_request( + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def list_headers( + self, *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any + ) -> List[JSON]: + # 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 False. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "enum", + "entity", "classification", "relationship", "struct", and "term_template". Default value is + None. + :paramtype type: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_type_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace_async + async def get_term_template_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_term_template_def_by_guid_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def get_term_template_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the term template definition by its name (unique). + + :param name: The name of the term template. Required. + :type name: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_term_template_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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/operations/__init__.py b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/__init__.py new file mode 100644 index 000000000000..7ac6c86750ea --- /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) AutoRest 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 TypeOperations + +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", + "TypeOperations", +] +__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..40c562e46338 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_operations.py @@ -0,0 +1,41653 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, 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 .._serialization import Serializer +from .._vendor import raise_if_not_implemented + +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[str] = 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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity" + + # Construct parameters + 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") + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_list_by_guids_request( + *, guids: List[str], min_ext_info: bool = False, ignore_relationships: bool = False, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk" + + # Construct parameters + _params["guid"] = [_SERIALIZER.query("guids", q, "str") if q is not None else "" for q in guids] + 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 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_entity_bulk_create_or_update_request( # pylint: disable=name-too-long + *, collection_id: Optional[str] = None, business_attribute_update_behavior: 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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/bulk" + + # Construct parameters + if collection_id is not None: + _params["collectionId"] = _SERIALIZER.query("collection_id", collection_id, "str") + 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" + ) + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_bulk_delete_request(*, guids: 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("guids", q, "str") if q is not None else "" for q in guids] + + # 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)) + accept = _headers.pop("Accept", "application/json") + + # 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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_request( + guid: str, *, min_ext_info: bool = False, ignore_relationships: bool = False, **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", max_length=4096, min_length=1), + } + + _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_partial_update_attribute_by_guid_request( # pylint: disable=name-too-long + guid: str, *, name: str, json: JSON, **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", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["name"] = _SERIALIZER.query("name", name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, json=json, **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", max_length=4096, min_length=1), + } + + _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", max_length=4096, min_length=1), + "classificationName": _SERIALIZER.url( + "classification_name", classification_name, "str", max_length=4096, min_length=1 + ), + } + + _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: + _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", max_length=4096, min_length=1), + "classificationName": _SERIALIZER.url( + "classification_name", classification_name, "str", max_length=4096, min_length=1 + ), + } + + _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_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", max_length=4096, min_length=1), + } + + _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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classifications" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/classifications" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_by_unique_attributes_request( # pylint: disable=name-too-long + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + attr_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/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _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_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_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_partial_update_by_unique_attributes_request( # pylint: disable=name-too-long + type_name: str, *, attr_qualified_name: 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", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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, *, attr_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/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "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, *, attr_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/uniqueAttribute/type/{typeName}/classification/{classificationName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + "classificationName": _SERIALIZER.url( + "classification_name", classification_name, "str", max_length=4096, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_add_classifications_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attr_qualified_name: 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}/classifications" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_update_classifications_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, attr_qualified_name: 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}/classifications" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_entity_bulk_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_list_by_unique_attributes_request( # pylint: disable=name-too-long + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + 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", max_length=4096, min_length=1), + } + + _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", max_length=4096, min_length=1), + } + + _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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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, *, is_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if is_overwrite is not None: + _params["isOverwrite"] = _SERIALIZER.query("is_overwrite", is_overwrite, "bool") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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 + bm_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata/{bmName}" + path_format_arguments = { + "bmName": _SERIALIZER.url("bm_name", bm_name, "str"), + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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 + bm_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/businessmetadata/{bmName}" + path_format_arguments = { + "bmName": _SERIALIZER.url("bm_name", bm_name, "str"), + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_entity_get_sample_business_metadata_template_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _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_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/entity/guid/{guid}/labels" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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, *, attr_qualified_name: 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}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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, *, attr_qualified_name: 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}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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, *, attr_qualified_name: 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}/labels" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_qualified_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/entity/moveTo" + + # Construct parameters + _params["collectionId"] = _SERIALIZER.query("collection_id", collection_id, "str") + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_list_request( + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + ignore_terms_and_categories: bool = False, + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary" + + # 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") + if ignore_terms_and_categories is not None: + _params["ignoreTermsAndCategories"] = _SERIALIZER.query( + "ignore_terms_and_categories", ignore_terms_and_categories, "bool" + ) + 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_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_glossary_get_category_request(category_guid: 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/{categoryGuid}" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/category/{categoryGuid}" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_glossary_delete_category_request(category_guid: 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/{categoryGuid}" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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_glossary_partial_update_category_request( # pylint: disable=name-too-long + category_guid: str, *, json: JSON, **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/{categoryGuid}/partial" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, json=json, **kwargs) + + +def build_glossary_list_related_categories_request( # pylint: disable=name-too-long + category_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{categoryGuid}/related" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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_list_category_terms_request( # pylint: disable=name-too-long + category_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{categoryGuid}/terms" + path_format_arguments = { + "categoryGuid": _SERIALIZER.url("category_guid", category_guid, "str", max_length=4096, min_length=1), + } + + _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: bool = False, **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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_get_term_request(term_guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termGuid}" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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_guid: str, *, include_term_hierarchy: bool = False, **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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termGuid}" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_delete_term_request(term_guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termGuid}" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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_glossary_partial_update_term_request( # pylint: disable=name-too-long + term_guid: str, *, json: JSON, include_term_hierarchy: bool = False, **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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/term/{termGuid}/partial" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, json=json, **kwargs) + + +def build_glossary_create_terms_request(*, include_term_hierarchy: bool = False, **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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + 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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_list_entities_assigned_with_term_request( # pylint: disable=name-too-long + term_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{termGuid}/assignedEntities" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms/{termGuid}/assignedEntities" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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_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)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms/{termGuid}/assignedEntities" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_glossary_list_related_terms_request( # pylint: disable=name-too-long + term_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/terms/{termGuid}/related" + path_format_arguments = { + "termGuid": _SERIALIZER.url("term_guid", term_guid, "str", max_length=4096, min_length=1), + } + + _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_guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_guid: str, *, ignore_terms_and_categories: bool = False, **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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_glossary_delete_request(glossary_guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_glossary_list_categories_request( + glossary_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{glossaryGuid}/categories" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_list_categories_headers_request( # pylint: disable=name-too-long + glossary_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{glossaryGuid}/categories/headers" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_guid: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}/detailed" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_guid: str, *, json: JSON, ignore_terms_and_categories: bool = False, **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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}/partial" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, json=json, **kwargs) + + +def build_glossary_list_terms_request( + glossary_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/glossary/{glossaryGuid}/terms" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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_list_term_headers_request( + glossary_guid: str, *, limit: Optional[int] = None, offset: Optional[int] = None, sort: str = "ASC", **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/{glossaryGuid}/terms/headers" + path_format_arguments = { + "glossaryGuid": _SERIALIZER.url("glossary_guid", glossary_guid, "str", max_length=4096, min_length=1), + } + + _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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/query" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/suggest" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/search/autocomplete" + + # Construct parameters + if api_version is not None: + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_lineage_get_request(guid: str, *, direction: str, depth: int = 3, **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", max_length=4096, min_length=1), + } + + _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: str, 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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/lineage/{guid}/next/" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _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") + 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_lineage_get_by_unique_attribute_request( # pylint: disable=name-too-long + type_name: str, *, direction: str, depth: int = 3, attr_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/lineage/uniqueAttribute/type/{typeName}" + path_format_arguments = { + "typeName": _SERIALIZER.url("type_name", type_name, "str", max_length=4096, min_length=1), + } + + _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 attr_qualified_name is not None: + _params["attr:qualifiedName"] = _SERIALIZER.query("attr_qualified_name", attr_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_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "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", max_length=4096, min_length=1), + } + + _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: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/relationship/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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_type_get_business_metadata_def_by_guid_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_get_business_metadata_def_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_get_classification_def_by_guid_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", max_length=4096, min_length=1), + } + + _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_get_classification_def_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", max_length=4096, min_length=1), + } + + _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_get_entity_def_by_guid_request(guid: 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/entitydef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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_get_entity_def_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/entitydef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str", max_length=4096, min_length=1), + } + + _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_get_enum_def_by_guid_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/enumdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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_get_enum_def_by_name_request(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", max_length=4096, min_length=1), + } + + _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_get_relationship_def_by_guid_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", max_length=4096, min_length=1), + } + + _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_get_relationship_def_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", max_length=4096, min_length=1), + } + + _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_get_struct_def_by_guid_request(guid: 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/structdef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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_get_struct_def_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/structdef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str", max_length=4096, min_length=1), + } + + _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_get_by_guid_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", max_length=4096, min_length=1), + } + + _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_get_by_name_request(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/typedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str", max_length=4096, min_length=1), + } + + _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_delete_request(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/typedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str", max_length=4096, min_length=1), + } + + _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_type_list_request( + *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs" + + # Construct parameters + 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") + 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_type_bulk_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/types/typedefs" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_type_bulk_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/types/typedefs" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) + + +def build_type_bulk_delete_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/types/typedefs" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) + + +def build_type_list_headers_request( + *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/atlas/v2/types/typedefs/headers" + + # Construct parameters + 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") + 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_type_get_term_template_def_by_guid_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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/types/termtemplatedef/guid/{guid}" + path_format_arguments = { + "guid": _SERIALIZER.url("guid", guid, "str", max_length=4096, min_length=1), + } + + _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_type_get_term_template_def_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: Optional[str] = kwargs.pop("api_version", _params.pop("api-version", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/types/termtemplatedef/name/{name}" + path_format_arguments = { + "name": _SERIALIZER.url("name", name, "str", max_length=4096, min_length=1), + } + + _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) + + +class EntityOperations: # pylint: disable=abstract-class-instantiated,too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.PurviewDataMapClient`'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") + + raise_if_not_implemented( + self.__class__, + [ + "import_business_metadata", + ], + ) + + @overload + def create_or_update( + self, + entity: JSON, + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 entity: Atlas entity with extended information. Required. + :type entity: 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 + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entity = { + "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.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.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.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.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, + entity: IO[bytes], + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 entity: Atlas entity with extended information. Required. + :type entity: 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 + :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: JSON object + :rtype: JSON + :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, + entity: Union[JSON, IO[bytes]], + *, + business_attribute_update_behavior: Optional[str] = None, + collection_id: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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 entity: Atlas entity with extended information. Is either a JSON type or a IO[bytes] + type. Required. + :type entity: 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 + :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. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entity = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(entity, (IOBase, bytes)): + _content = entity + else: + _json = entity + + _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, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_by_guids( + self, *, guids: List[str], min_ext_info: bool = False, ignore_relationships: bool = False, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """List entities in bulk identified by its GUIDs. + + :keyword guids: An array of GUIDs of entities to list. Required. + :paramtype guids: list[str] + :keyword min_ext_info: Whether to return minimal information for referred entities. Default + value is False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_list_by_guids_request( + guids=guids, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def bulk_create_or_update( + self, + entities: JSON, + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 entities: An array of entities to create or update. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entities = { + "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.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.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.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.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 bulk_create_or_update( + self, + entities: IO[bytes], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 entities: An array of entities to create or update. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :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 bulk_create_or_update( + self, + entities: Union[JSON, IO[bytes]], + *, + collection_id: Optional[str] = None, + business_attribute_update_behavior: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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 entities: An array of entities to create or update. Is either a JSON type or a IO[bytes] + type. Required. + :type entities: 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 + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + entities = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(entities, (IOBase, bytes)): + _content = entities + else: + _json = entities + + _request = build_entity_bulk_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, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def bulk_delete(self, *, guids: List[str], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Delete a list of entities in bulk identified by their GUIDs or unique attributes. + + :keyword guids: An array of GUIDs of entities to delete. Required. + :paramtype guids: list[str] + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_bulk_delete_request( + guids=guids, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def add_classification( # pylint: disable=inconsistent-return-statements + self, request: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Required. + :type request: 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + request = { + "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, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Required. + :type request: 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, request: Union[JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Associate a classification to multiple entities in bulk. + + :param request: The request to associate a classification to multiple entities. Is either a + JSON type or a IO[bytes] type. Required. + :type request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + request = { + "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" + _json = None + _content = None + if isinstance(request, (IOBase, bytes)): + _content = request + else: + _json = request + + _request = build_entity_add_classification_request( + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get(self, guid: str, *, min_ext_info: bool = False, ignore_relationships: bool = False, **kwargs: Any) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def partial_update_attribute_by_guid(self, guid: str, body: JSON, *, name: str, **kwargs: Any) -> JSON: + # 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: JSON + :keyword name: The name of the attribute. Required. + :paramtype name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _json = body + + _request = build_entity_partial_update_attribute_by_guid_request( + guid=guid, + name=name, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_classification(self, guid: str, classification_name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_classifications(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def add_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, classifications: List[JSON], *, 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 classifications: An array of classifications to be added. Required. + :type classifications: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + classifications = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, classifications: 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 classifications: An array of classifications to be added. Required. + :type classifications: 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, classifications: Union[List[JSON], 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 classifications: An array of classifications to be added. Is either a [JSON] type or a + IO[bytes] type. Required. + :type classifications: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(classifications, (IOBase, bytes)): + _content = classifications + else: + _json = classifications + + _request = build_entity_add_classifications_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def update_classifications( # pylint: disable=inconsistent-return-statements + self, guid: str, classifications: List[JSON], *, 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 classifications: An array of classifications to be updated. Required. + :type classifications: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + classifications = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, classifications: 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 classifications: An array of classifications to be updated. Required. + :type classifications: 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, classifications: Union[List[JSON], 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 classifications: An array of classifications to be updated. Is either a [JSON] type or a + IO[bytes] type. Required. + :type classifications: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(classifications, (IOBase, bytes)): + _content = classifications + else: + _json = classifications + + _request = build_entity_update_classifications_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + attr_qualified_name: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :paramtype ignore_relationships: bool + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_get_by_unique_attributes_request( + type_name=type_name, + min_ext_info=min_ext_info, + ignore_relationships=ignore_relationships, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: JSON, + *, + attr_qualified_name: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Required. + :type atlas_entity_with_ext_info: JSON + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_entity_with_ext_info = { + "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.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.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.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.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 partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: IO[bytes], + *, + attr_qualified_name: Optional[str] = None, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Required. + :type atlas_entity_with_ext_info: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :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 partial_update_by_unique_attributes( + self, + type_name: str, + atlas_entity_with_ext_info: Union[JSON, IO[bytes]], + *, + attr_qualified_name: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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 atlas_entity_with_ext_info: Atlas entity with extended information. Is either a JSON + type or a IO[bytes] type. Required. + :type atlas_entity_with_ext_info: JSON or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_entity_with_ext_info = { + "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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(atlas_entity_with_ext_info, (IOBase, bytes)): + _content = atlas_entity_with_ext_info + else: + _json = atlas_entity_with_ext_info + + _request = build_entity_partial_update_by_unique_attributes_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_by_unique_attribute( + self, type_name: str, *, attr_qualified_name: Optional[str] = None, **kwargs: Any + ) -> JSON: + # 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_delete_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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, *, attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_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_by_unique_attribute_request( + type_name=type_name, + classification_name=classification_name, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + 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, + atlas_classification_array: List[JSON], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Required. + :type atlas_classification_array: list[JSON] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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. + atlas_classification_array = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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, + atlas_classification_array: IO[bytes], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Required. + :type atlas_classification_array: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + atlas_classification_array: Union[List[JSON], IO[bytes]], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be added. Is either a [JSON] + type or a IO[bytes] type. Required. + :type atlas_classification_array: list[JSON] or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(atlas_classification_array, (IOBase, bytes)): + _content = atlas_classification_array + else: + _json = atlas_classification_array + + _request = build_entity_add_classifications_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def update_classifications_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: List[JSON], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Required. + :type atlas_classification_array: list[JSON] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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. + atlas_classification_array = [ + { + "attributes": { + "str": {} # Optional. The attributes of the struct. + }, + "entityGuid": "str", # Optional. The GUID of the entity. + "entityStatus": "str", # Optional. Status of the entity - can be + active or deleted. Deleted entities are not removed. Known values are: + "ACTIVE" and "DELETED". + "lastModifiedTS": "str", # Optional. ETag for concurrency control. + "removePropagationsOnEntityDelete": bool, # Optional. Determines if + propagations will be removed on entity deletion. + "typeName": "str", # Optional. The name of the type. + "validityPeriods": [ + { + "endTime": "str", # Optional. 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_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: IO[bytes], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Required. + :type atlas_classification_array: IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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_by_unique_attribute( # pylint: disable=inconsistent-return-statements,name-too-long + self, + type_name: str, + atlas_classification_array: Union[List[JSON], IO[bytes]], + *, + attr_qualified_name: 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 atlas_classification_array: An array of classification to be updated. Is either a [JSON] + type or a IO[bytes] type. Required. + :type atlas_classification_array: list[JSON] or IO[bytes] + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(atlas_classification_array, (IOBase, bytes)): + _content = atlas_classification_array + else: + _json = atlas_classification_array + + _request = build_entity_update_classifications_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def bulk_set_classifications( + self, entity_headers: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Required. + :type entity_headers: 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 + + # JSON input template you can fill out and use as your body input. + entity_headers = { + "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 bulk_set_classifications( + self, entity_headers: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[str]: + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Required. + :type entity_headers: 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 bulk_set_classifications(self, entity_headers: Union[JSON, IO[bytes]], **kwargs: Any) -> List[str]: + # pylint: disable=line-too-long + """Set classifications on entities in bulk. + + :param entity_headers: Atlas entity headers. Is either a JSON type or a IO[bytes] type. + Required. + :type entity_headers: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + entity_headers = { + "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" + _json = None + _content = None + if isinstance(entity_headers, (IOBase, bytes)): + _content = entity_headers + else: + _json = entity_headers + + _request = build_entity_bulk_set_classifications_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[str], deserialized), {}) # type: ignore + + return cast(List[str], deserialized) # type: ignore + + @distributed_trace + def list_by_unique_attributes( + self, + type_name: str, + *, + min_ext_info: bool = False, + ignore_relationships: bool = False, + attr_n_qualified_name: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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 False. + :paramtype min_ext_info: bool + :keyword ignore_relationships: Whether to ignore relationship attributes. Default value is + False. + :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: JSON object + :rtype: JSON + :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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_entity_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_header(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[Dict[str, JSON]] = None, + *, + 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 business_metadata: Default value is None. + :type business_metadata: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata = { + "str": {} # Optional. + } + """ + + @overload + def remove_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[IO[bytes]] = None, + *, + 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 business_metadata: Default value is None. + :type business_metadata: 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, business_metadata: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, **kwargs: Any + ) -> None: + """Remove business metadata from an entity. + + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata: Is either a {str: JSON} type or a IO[bytes] type. Default value is + None. + :type business_metadata: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata, (IOBase, bytes)): + _content = business_metadata + else: + if business_metadata is not None: + _json = business_metadata + else: + _json = None + + _request = build_entity_remove_business_metadata_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[Dict[str, JSON]] = None, + *, + is_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 business_metadata: Default value is None. + :type business_metadata: dict[str, JSON] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_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. + business_metadata = { + "str": {} # Optional. + } + """ + + @overload + def add_or_update_business_metadata( # pylint: disable=inconsistent-return-statements + self, + guid: str, + business_metadata: Optional[IO[bytes]] = None, + *, + is_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 business_metadata: Default value is None. + :type business_metadata: IO[bytes] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_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, + business_metadata: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + *, + is_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 business_metadata: Is either a {str: JSON} type or a IO[bytes] type. Default value is + None. + :type business_metadata: dict[str, JSON] or IO[bytes] + :keyword is_overwrite: Whether to overwrite the existing business metadata on the entity or + not, default is false. Default value is None. + :paramtype is_overwrite: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata, (IOBase, bytes)): + _content = business_metadata + else: + if business_metadata is not None: + _json = business_metadata + else: + _json = None + + _request = build_entity_add_or_update_business_metadata_request( + guid=guid, + is_overwrite=is_overwrite, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Dict[str, JSON]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata_attributes = { + "str": {} # Optional. + } + """ + + @overload + def remove_business_metadata_attributes( # pylint: disable=inconsistent-return-statements + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + **kwargs: Any, + ) -> None: + """Delete business metadata attributes from an entity. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Is either a {str: JSON} type or a IO[bytes] type. Default + value is None. + :type business_metadata_attributes: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata_attributes, (IOBase, bytes)): + _content = business_metadata_attributes + else: + if business_metadata_attributes is not None: + _json = business_metadata_attributes + else: + _json = None + + _request = build_entity_remove_business_metadata_attributes_request( + bm_name=bm_name, + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Dict[str, JSON]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: dict[str, 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + business_metadata_attributes = { + "str": {} # Optional. + } + """ + + @overload + def add_or_update_business_metadata_attributes( # pylint: disable=inconsistent-return-statements,name-too-long + self, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any, + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Default value is None. + :type business_metadata_attributes: 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, + bm_name: str, + guid: str, + business_metadata_attributes: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, + **kwargs: Any, + ) -> None: + """Add or update business metadata attributes. + + :param bm_name: BusinessMetadata name. Required. + :type bm_name: str + :param guid: The globally unique identifier of the entity. Required. + :type guid: str + :param business_metadata_attributes: Is either a {str: JSON} type or a IO[bytes] type. Default + value is None. + :type business_metadata_attributes: dict[str, JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(business_metadata_attributes, (IOBase, bytes)): + _content = business_metadata_attributes + else: + if business_metadata_attributes is not None: + _json = business_metadata_attributes + else: + _json = None + + _request = build_entity_add_or_update_business_metadata_attributes_request( + bm_name=bm_name, + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def get_sample_business_metadata_template(self, **kwargs: Any) -> Iterator[bytes]: + """Get the sample Template for uploading/creating bulk BusinessMetaData. + + :return: Iterator of the response bytes + :rtype: Iterator[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[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_entity_get_sample_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 = 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) + raise HttpResponseError(response=response) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, cast(Iterator[bytes], deserialized), {}) # type: ignore + + return cast(Iterator[bytes], 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_remove_labels_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_set_labels_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_add_label_request( + guid=guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_remove_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_set_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: 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, + *, + attr_qualified_name: 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 attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = body + else: + _json = None + + _request = build_entity_add_labels_by_unique_attribute_request( + type_name=type_name, + attr_qualified_name=attr_qualified_name, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def move_entities_to_collection( + self, move_entities_request: JSON, *, collection_id: str, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Required. + :type move_entities_request: 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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + move_entities_request = { + "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, + move_entities_request: IO[bytes], + *, + collection_id: str, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Required. + :type move_entities_request: 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: JSON object + :rtype: JSON + :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, move_entities_request: Union[JSON, IO[bytes]], *, collection_id: str, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Move existing entities to the target collection. + + :param move_entities_request: Entity guids to be moved to target collection. Is either a JSON + type or a IO[bytes] type. Required. + :type move_entities_request: JSON or 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. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + move_entities_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move_entities_request, (IOBase, bytes)): + _content = move_entities_request + else: + _json = move_entities_request + + _request = build_entity_move_entities_to_collection_request( + collection_id=collection_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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.PurviewDataMapClient`'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 list( + self, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + ignore_terms_and_categories: bool = False, + **kwargs: Any, + ) -> List[JSON]: + # 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/{glossaryGuid}/terms' and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryGuid}/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 "ASC". + :paramtype sort: str + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + def create(self, atlas_glossary: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Required. + :type atlas_glossary: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_glossary = { + "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, atlas_glossary: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Required. + :type atlas_glossary: 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: JSON object + :rtype: JSON + :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, atlas_glossary: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary. + + :param atlas_glossary: Glossary definition, terms & categories can be anchored to a glossary. + Using the anchor attribute when creating the Term/Category. Is either a JSON type or a + IO[bytes] type. Required. + :type atlas_glossary: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + atlas_glossary = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(atlas_glossary, (IOBase, bytes)): + _content = atlas_glossary + else: + _json = atlas_glossary + + _request = build_glossary_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def create_categories( + self, glossary_category: List[JSON], *, content_type: str = "application/json", **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Required. + :type glossary_category: list[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 JSON object + :rtype: list[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = [ + { + "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, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Required. + :type glossary_category: 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 JSON object + :rtype: list[JSON] + :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, glossary_category: Union[List[JSON], IO[bytes]], **kwargs: Any) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary category in bulk. + + :param glossary_category: An array of glossary category definitions to be created. Is either a + [JSON] type or a IO[bytes] type. Required. + :type glossary_category: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_create_categories_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + def create_category( + self, glossary_category: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Required. + :type glossary_category: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Required. + :type glossary_category: 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: JSON object + :rtype: JSON + :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, glossary_category: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a glossary category. + + :param glossary_category: The glossary category definition. A category must be anchored to a + Glossary when creating. + Optionally, terms belonging to the category and the hierarchy can also be defined during + creation. Is either a JSON type or a IO[bytes] type. Required. + :type glossary_category: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_create_category_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_category(self, category_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get specific glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_category_request( + category_guid=category_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update_category( + self, category_guid: str, glossary_category: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Required. + :type glossary_category: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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_guid: str, glossary_category: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Required. + :type glossary_category: 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: JSON object + :rtype: JSON + :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_guid: str, glossary_category: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary category by its GUID. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param glossary_category: The glossary category to be updated. Is either a JSON type or a + IO[bytes] type. Required. + :type glossary_category: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_category = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_category, (IOBase, bytes)): + _content = glossary_category + else: + _json = glossary_category + + _request = build_glossary_update_category_request( + category_guid=category_guid, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_category( # pylint: disable=inconsistent-return-statements + self, category_guid: str, **kwargs: Any + ) -> None: + """Delete a glossary category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_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_glossary_delete_category_request( + category_guid=category_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def partial_update_category(self, category_guid: str, partial_updates: JSON, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update the glossary category partially. So far we only supports partial updating + shortDescription and longDescription for category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values for partial update. Required. + :type partial_updates: JSON + :return: JSON object + :rtype: JSON + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_category_request( + category_guid=category_guid, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_related_categories( + self, + category_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> Dict[str, List[JSON]]: + """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_guid: The globally unique identifier of the category. Required. + :type category_guid: 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 "ASC". + :paramtype sort: str + :return: dict mapping str to list of JSON object + :rtype: dict[str, list[JSON]] + :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[JSON]]] = kwargs.pop("cls", None) + + _request = build_glossary_list_related_categories_request( + category_guid=category_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(Dict[str, List[JSON]], deserialized), {}) # type: ignore + + return cast(Dict[str, List[JSON]], deserialized) # type: ignore + + @distributed_trace + def list_category_terms( + self, + category_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get all terms associated with the specific category. + + :param category_guid: The globally unique identifier of the category. Required. + :type category_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_category_terms_request( + category_guid=category_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + def create_term( + self, + glossary_term: JSON, + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Required. + :type glossary_term: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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, glossary_term: Union[JSON, IO[bytes]], *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a glossary term. + + :param glossary_term: The glossary term definition. A term must be anchored to a Glossary at + the time of creation. + Optionally it can be categorized as well. Is either a JSON type or a IO[bytes] type. Required. + :type glossary_term: JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_create_term_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_term(self, term_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get a specific glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :return: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_term_request( + term_guid=term_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update_term( + self, + term_guid: str, + glossary_term: JSON, + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Required. + :type glossary_term: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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_guid: str, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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_guid: str, + glossary_term: Union[JSON, IO[bytes]], + *, + include_term_hierarchy: bool = False, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary term by its GUID. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param glossary_term: The glossary term to be updated. Is either a JSON type or a IO[bytes] + type. Required. + :type glossary_term: JSON or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = { + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_update_term_request( + term_guid=term_guid, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete_term(self, term_guid: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete a glossary term. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_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_glossary_delete_term_request( + term_guid=term_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def partial_update_term( + self, term_guid: str, partial_updates: JSON, *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> JSON: + # 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values to be updated. Required. + :type partial_updates: JSON + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :return: JSON object + :rtype: JSON + :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. An array of related + object IDs. + "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. The hierarchy information + of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy information of + the term. + "name": "str", # Optional. The hierarchy information of the + term. + "properties": { + "str": {} # Optional. Dictionary of :code:``. + }, + "resourceId": "str", # Optional. The hierarchy information + of the term. + "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. + ], + "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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_term_request( + term_guid=term_guid, + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def create_terms( + self, + glossary_term: List[JSON], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Required. + :type glossary_term: list[JSON] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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 JSON object + :rtype: list[JSON] + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + glossary_term = [ + { + "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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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, + glossary_term: IO[bytes], + *, + include_term_hierarchy: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Required. + :type glossary_term: IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :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 JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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, glossary_term: Union[List[JSON], IO[bytes]], *, include_term_hierarchy: bool = False, **kwargs: Any + ) -> List[JSON]: + # pylint: disable=line-too-long + """Create glossary terms in bulk. + + :param glossary_term: An array of glossary term definitions to be created in bulk. Is either a + [JSON] type or a IO[bytes] type. Required. + :type glossary_term: list[JSON] or IO[bytes] + :keyword include_term_hierarchy: Whether include term hierarchy. Default value is False. + :paramtype include_term_hierarchy: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: list of JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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[JSON]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(glossary_term, (IOBase, bytes)): + _content = glossary_term + else: + _json = glossary_term + + _request = build_glossary_create_terms_request( + include_term_hierarchy=include_term_hierarchy, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace + def list_entities_assigned_with_term( + self, + term_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """List all related objects assigned with the specified term. Recommend using limit/offset to get + pagination result. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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. + "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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_entities_assigned_with_term_request( + term_guid=term_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @overload + def assign_term_to_entities( # pylint: disable=inconsistent-return-statements + self, term_guid: str, related_object_ids: List[JSON], *, 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Required. + :type related_object_ids: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + related_object_ids = [ + { + "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. + "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_guid: str, related_object_ids: 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Required. + :type related_object_ids: 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_guid: str, related_object_ids: Union[List[JSON], 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs to which the term has to be + associated. Is either a [JSON] type or a IO[bytes] type. Required. + :type related_object_ids: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(related_object_ids, (IOBase, bytes)): + _content = related_object_ids + else: + _json = related_object_ids + + _request = build_glossary_assign_term_to_entities_request( + term_guid=term_guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @overload + def delete_term_assignment_from_entities( # pylint: disable=inconsistent-return-statements + self, term_guid: str, related_object_ids: List[JSON], *, 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Required. + :type related_object_ids: list[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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + related_object_ids = [ + { + "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. + "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_guid: str, related_object_ids: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Required. + :type related_object_ids: 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_guid: str, related_object_ids: Union[List[JSON], IO[bytes]], **kwargs: Any + ) -> None: + """Delete the term assignment for the given list of related objects. + + :param term_guid: The globally unique identifier for glossary term. Required. + :type term_guid: str + :param related_object_ids: An array of related object IDs from which the term has to be + dissociated. Is either a [JSON] type or a IO[bytes] type. Required. + :type related_object_ids: list[JSON] or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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" + _json = None + _content = None + if isinstance(related_object_ids, (IOBase, bytes)): + _content = related_object_ids + else: + _json = related_object_ids + + _request = build_glossary_delete_term_assignment_from_entities_request( + term_guid=term_guid, + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_related_terms( + self, + term_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> Dict[str, List[JSON]]: + # 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_guid: The globally unique identifier for glossary term. Required. + :type term_guid: 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 "ASC". + :paramtype sort: str + :return: dict mapping str to list of JSON object + :rtype: dict[str, list[JSON]] + :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[JSON]]] = kwargs.pop("cls", None) + + _request = build_glossary_list_related_terms_request( + term_guid=term_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(Dict[str, List[JSON]], deserialized), {}) # type: ignore + + return cast(Dict[str, List[JSON]], deserialized) # type: ignore + + @distributed_trace + def get(self, glossary_guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get a specific Glossary by its GUID. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_request( + glossary_guid=glossary_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update( + self, + glossary_guid: str, + updated_glossary: JSON, + *, + ignore_terms_and_categories: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Required. + :type updated_glossary: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :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: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + updated_glossary = { + "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_guid: str, + updated_glossary: IO[bytes], + *, + ignore_terms_and_categories: bool = False, + content_type: str = "application/json", + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Required. + :type updated_glossary: IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :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: JSON object + :rtype: JSON + :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_guid: str, + updated_glossary: Union[JSON, IO[bytes]], + *, + ignore_terms_and_categories: bool = False, + **kwargs: Any, + ) -> JSON: + # pylint: disable=line-too-long + """Update the given glossary. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param updated_glossary: The glossary definition to be updated. Is either a JSON type or a + IO[bytes] type. Required. + :type updated_glossary: JSON or IO[bytes] + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + updated_glossary = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(updated_glossary, (IOBase, bytes)): + _content = updated_glossary + else: + _json = updated_glossary + + _request = build_glossary_update_request( + glossary_guid=glossary_guid, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def delete(self, glossary_guid: 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_guid: The globally unique identifier for glossary. Required. + :type glossary_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_glossary_delete_request( + glossary_guid=glossary_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_categories( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get the categories belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_categories_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace + def list_categories_headers( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + """Get the category headers belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_categories_headers_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace + def get_detailed(self, glossary_guid: str, **kwargs: Any) -> JSON: + # 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/{glossaryGuid}/terms' and + + 'GET '/datamap/api/atlas/v2/glossary/{glossaryGuid}/categories'. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :return: JSON object + :rtype: JSON + :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. An + array of related object IDs. + "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. The + hierarchy information of the term. + "guid": "str", # Optional. The GUID of the + object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy + information of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The + hierarchy information of the term. + "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 glossary term information. + ], + "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[JSON] = kwargs.pop("cls", None) + + _request = build_glossary_get_detailed_request( + glossary_guid=glossary_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def partial_update( + self, glossary_guid: str, partial_updates: JSON, *, ignore_terms_and_categories: bool = False, **kwargs: Any + ) -> JSON: + # 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_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: str + :param partial_updates: A map containing keys as attribute names and values as corresponding + attribute values. Required. + :type partial_updates: JSON + :keyword ignore_terms_and_categories: Whether ignore terms and categories. Default value is + False. + :paramtype ignore_terms_and_categories: bool + :return: JSON object + :rtype: JSON + :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: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _json = partial_updates + + _request = build_glossary_partial_update_request( + glossary_guid=glossary_guid, + ignore_terms_and_categories=ignore_terms_and_categories, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_terms( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get terms belonging to a specific glossary. Recommend using limit/offset to get pagination + result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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. An array of + related object IDs. + "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. The hierarchy + information of the term. + "guid": "str", # Optional. The GUID of the object. + "itemPath": "str", # Optional. The hierarchy + information of the term. + "name": "str", # Optional. The hierarchy information + of the term. + "properties": { + "str": {} # Optional. Dictionary of + :code:``. + }, + "resourceId": "str", # Optional. The hierarchy + information of the term. + "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. + ], + "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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_terms_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace + def list_term_headers( + self, + glossary_guid: str, + *, + limit: Optional[int] = None, + offset: Optional[int] = None, + sort: str = "ASC", + **kwargs: Any, + ) -> List[JSON]: + # pylint: disable=line-too-long + """Get term headers belonging to a specific glossary. Recommend using limit/offset to get + pagination result. + + :param glossary_guid: The globally unique identifier for glossary. Required. + :type glossary_guid: 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 "ASC". + :paramtype sort: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_glossary_list_term_headers_request( + glossary_guid=glossary_guid, + 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + +class DiscoveryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.PurviewDataMapClient`'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, search_request: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Required. + :type search_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + search_request = { + "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": {} # Optional. Any object. + } + ], + "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. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": {} # Optional. Any object. + } + } + } + + # 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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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, search_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Required. + :type search_request: 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: JSON object + :rtype: JSON + :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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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, search_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get data using search. + + :param search_request: An object specifying the search criteria. Is either a JSON type or a + IO[bytes] type. Required. + :type search_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + search_request = { + "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": {} # Optional. Any object. + } + ], + "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. + ], + "facet": { + "count": 0, # Optional. The count of the facet item. + "facet": "str", # Optional. The name of the facet item. + "sort": {} # Optional. Any object. + } + } + } + + # 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. 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. + ], + "entityType": [ + "str" # Optional. 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. + ], + "id": [ + "str" # Optional. 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. + ], + "name": [ + "str" # Optional. 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. + ], + "qualifiedName": [ + "str" # Optional. 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. + ] + }, + "@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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(search_request, (IOBase, bytes)): + _content = search_request + else: + _json = search_request + + _request = build_discovery_query_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def suggest(self, suggest_request: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Required. + :type suggest_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + suggest_request = { + "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, suggest_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Required. + :type suggest_request: 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: JSON object + :rtype: JSON + :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, suggest_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get search suggestions by query criteria. + + :param suggest_request: An object specifying the suggest criteria. Is either a JSON type or a + IO[bytes] type. Required. + :type suggest_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + suggest_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(suggest_request, (IOBase, bytes)): + _content = suggest_request + else: + _json = suggest_request + + _request = build_discovery_suggest_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def auto_complete( + self, auto_complete_request: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Required. + :type auto_complete_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + auto_complete_request = { + "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, auto_complete_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Required. + :type auto_complete_request: 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: JSON object + :rtype: JSON + :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, auto_complete_request: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get auto complete options. + + :param auto_complete_request: An object specifying the autocomplete criteria. Is either a JSON + type or a IO[bytes] type. Required. + :type auto_complete_request: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + auto_complete_request = { + "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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(auto_complete_request, (IOBase, bytes)): + _content = auto_complete_request + else: + _json = auto_complete_request + + _request = build_discovery_auto_complete_request( + content_type=content_type, + api_version=self._config.api_version, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + +class LineageOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.PurviewDataMapClient`'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: str, depth: int = 3, **kwargs: Any) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :keyword depth: The number of hops for lineage. Default value is 3. + :paramtype depth: int + :return: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_next_page( + self, guid: str, *, direction: str, offset: Optional[int] = None, limit: Optional[int] = None, **kwargs: Any + ) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :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: JSON object + :rtype: JSON + :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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_by_unique_attribute( + self, + type_name: str, + *, + direction: str, + depth: int = 3, + attr_qualified_name: Optional[str] = None, + **kwargs: Any, + ) -> JSON: + # 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: "BOTH", "INPUT", and "OUTPUT". Required. + :paramtype direction: str + :keyword depth: The number of hops for lineage. Default value is 3. + :paramtype depth: int + :keyword attr_qualified_name: The qualified name of the entity. (This is only an example. + qualifiedName can be changed to other unique attributes). Default value is None. + :paramtype attr_qualified_name: str + :return: JSON object + :rtype: JSON + :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[JSON] = kwargs.pop("cls", None) + + _request = build_lineage_get_by_unique_attribute_request( + type_name=type_name, + direction=direction, + depth=depth, + attr_qualified_name=attr_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + +class RelationshipOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.purview.datamap.PurviewDataMapClient`'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, relationship: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.0 # Optional. The version of the relationship. + } + """ + + @overload + def create(self, relationship: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: 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: JSON object + :rtype: JSON + :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.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.0 # Optional. The version of the relationship. + } + """ + + @distributed_trace + def create(self, relationship: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + """Create a new relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Is either a JSON type or a IO[bytes] type. Required. + :type relationship: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(relationship, (IOBase, bytes)): + _content = relationship + else: + _json = relationship + + _request = build_relationship_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def update(self, relationship: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.0 # Optional. The version of the relationship. + } + """ + + @overload + def update(self, relationship: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Required. + :type relationship: 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: JSON object + :rtype: JSON + :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.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.0 # Optional. The version of the relationship. + } + """ + + @distributed_trace + def update(self, relationship: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + """Update an existing relationship between entities. + + :param relationship: The AtlasRelationship object containing the information for the + relationship to be created. Is either a JSON type or a IO[bytes] type. Required. + :type relationship: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + 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.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.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.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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(relationship, (IOBase, bytes)): + _content = relationship + else: + _json = relationship + + _request = build_relationship_update_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get(self, guid: str, *, extended_info: Optional[bool] = None, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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.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.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[JSON] = 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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class TypeOperations: # 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.PurviewDataMapClient`'s + :attr:`type` 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_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the businessMetadata definition for the given guid. + + :param guid: businessMetadata guid. Required. + :type guid: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_business_metadata_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_business_metadata_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the businessMetadata definition by it's name (unique). + + :param name: businessMetadata name. Required. + :type name: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_business_metadata_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_classification_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. .. raw:: html

  • 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_classification_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_classification_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. .. raw:: html
  • 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_classification_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_entity_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_entity_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_entity_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_entity_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_enum_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_enum_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_enum_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_enum_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_relationship_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_relationship_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_relationship_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_relationship_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_struct_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_struct_def_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_struct_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_struct_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. .. raw:: html

  • 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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_by_guid_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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_by_name(self, name: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. .. raw:: html

  • 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. :code:`

` ASSOCIATION is a relationship + with no containment. :code:`
` COMPOSITION and AGGREGATION are containment + relationships. :code:`

` 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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, 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_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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list(self, *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any) -> JSON: + # 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 False. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "enum", + "entity", "classification", "relationship", "struct", and "term_template". Default value is + None. + :paramtype type: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def bulk_create(self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Required. + :type types_def: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def bulk_create(self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Required. + :type types_def: 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace + def bulk_create(self, types_def: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # 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 types_def: A composite wrapper object with corresponding lists of the type definition. + Is either a JSON type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_create_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def bulk_update(self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Required. + :type types_def: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def bulk_update(self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Required. + :type types_def: 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: JSON object + :rtype: JSON + :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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @distributed_trace + def bulk_update(self, types_def: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Update all types in bulk, changes detected in the type definitions would be persisted. + + :param types_def: A composite object that captures all type definition changes. Is either a + JSON type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_update_request( + content_type=content_type, + json=_json, + 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 [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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @overload + def bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Required. + :type types_def: 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: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.0 # Optional. The version of the record. + } + ] + } + """ + + @overload + def bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Required. + :type types_def: 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 bulk_delete( # pylint: disable=inconsistent-return-statements + self, types_def: Union[JSON, IO[bytes]], **kwargs: Any + ) -> None: + # pylint: disable=line-too-long + """Delete API for all types in bulk. + + :param types_def: A composite object that captures all types to be deleted. Is either a JSON + type or a IO[bytes] type. Required. + :type types_def: JSON or IO[bytes] + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :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. + types_def = { + "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. The date format. + "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.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. The date format. + "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. .. raw:: html

  • 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.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. The date format. + "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.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. The date format. + "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.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.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. The date format. + "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. :code:`

` + ASSOCIATION is a relationship with no containment. :code:`
` + COMPOSITION and AGGREGATION are containment relationships. :code:`

` + 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.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. The date format. + "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.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. The date format. + "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.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" + _json = None + _content = None + if isinstance(types_def, (IOBase, bytes)): + _content = types_def + else: + _json = types_def + + _request = build_type_bulk_delete_request( + content_type=content_type, + json=_json, + 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_headers( + self, *, include_term_template: bool = False, type: Optional[str] = None, **kwargs: Any + ) -> List[JSON]: + # 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 False. + :paramtype include_term_template: bool + :keyword type: Typedef name as search filter when get typedefs. Known values are: "enum", + "entity", "classification", "relationship", "struct", and "term_template". Default value is + None. + :paramtype type: str + :return: list of JSON object + :rtype: list[JSON] + :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[JSON]] = kwargs.pop("cls", None) + + _request = build_type_list_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(List[JSON], deserialized), {}) # type: ignore + + return cast(List[JSON], deserialized) # type: ignore + + @distributed_trace + def get_term_template_def_by_guid(self, guid: str, **kwargs: Any) -> JSON: + # 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: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_term_template_def_by_guid_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def get_term_template_def_by_name(self, name: str, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Get the term template definition by its name (unique). + + :param name: The name of the term template. Required. + :type name: str + :return: JSON object + :rtype: JSON + :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. The date format. + "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.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[JSON] = kwargs.pop("cls", None) + + _request = build_type_get_term_template_def_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 = 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) + raise HttpResponseError(response=response) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore + + return cast(JSON, deserialized) # type: ignore 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 From 5accc146703bf817cebc6878127b0064a719d673 Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:26:13 -0700 Subject: [PATCH 3/6] Create patch customization for import_business_metadata --- .../purview/datamap/operations/_patch.py | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_patch.py 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..463d97d9a878 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/azure/purview/datamap/operations/_patch.py @@ -0,0 +1,98 @@ +# ------------------------------------ +# 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 ._operations import EntityOperations as EntityOperationsGenerated +import sys +from typing import Any, Dict, List, Optional + +from msrest import Serializer + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.rest import HttpRequest + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +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 + """ + + +def build_entity_import_business_metadata_request( + files: Optional[Dict[str, Any]] = None, content: Any = None, **kwargs: Any +) -> HttpRequest: + content_type: Optional[str] = kwargs.pop("content_type", None) + + accept = "application/json" + # Construct URL + _url = "/atlas/v2/entity/businessmetadata/import" + + # Construct headers + _header_parameters: Dict[str, Any] = kwargs.pop("headers", {}) + if content_type is not None: + _header_parameters["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _header_parameters["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_header_parameters, files=files, content=content, **kwargs) + + + +class EntityOperations(EntityOperationsGenerated): + def import_business_metadata(self, *args, **kwargs) -> JSON: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + request = build_entity_import_business_metadata_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) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=True, **kwargs + ) + response = pipeline_response.http_response + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = response + return deserialized + + +__all__: List[str] = [ + "EntityOperations", +] # Add all objects you want publicly available to users at this package level From 87fa8b8265ac12c5adf34c2529e61e2c647d498d Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:27:00 -0700 Subject: [PATCH 4/6] Create setup script --- sdk/purview/azure-purview-datamap/setup.py | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/setup.py diff --git a/sdk/purview/azure-purview-datamap/setup.py b/sdk/purview/azure-purview-datamap/setup.py new file mode 100644 index 000000000000..f252436fb766 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/setup.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-purview-datamap" +PACKAGE_PPRINT_NAME = "Azure Purview Data Map" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else 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') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + 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', + keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product + classifiers=[ + "Development Status :: 4 - Beta", + 'Programming Language :: Python', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + '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={ + 'pytyped': ['py.typed'], + }, + install_requires=[ + 'msrest>=0.6.21', + 'azure-core>=1.23.0,<2.0.0', + ], + python_requires=">=3.6" +) From 55261b5f55befab6fde96d736c98e34259a910d5 Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:27:30 -0700 Subject: [PATCH 5/6] Create metadata files --- .../azure-purview-datamap/CHANGELOG.md | 5 +++++ sdk/purview/azure-purview-datamap/LICENSE | 21 +++++++++++++++++++ sdk/purview/azure-purview-datamap/MANIFEST.in | 7 +++++++ .../dev_requirements.txt | 4 ++++ .../azure-purview-datamap/pyproject.toml | 6 ++++++ .../azure-purview-datamap/sdk_packaging.toml | 9 ++++++++ 6 files changed, 52 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/CHANGELOG.md create mode 100644 sdk/purview/azure-purview-datamap/LICENSE create mode 100644 sdk/purview/azure-purview-datamap/MANIFEST.in create mode 100644 sdk/purview/azure-purview-datamap/dev_requirements.txt create mode 100644 sdk/purview/azure-purview-datamap/pyproject.toml create mode 100644 sdk/purview/azure-purview-datamap/sdk_packaging.toml diff --git a/sdk/purview/azure-purview-datamap/CHANGELOG.md b/sdk/purview/azure-purview-datamap/CHANGELOG.md new file mode 100644 index 000000000000..0f12a9ce717e --- /dev/null +++ b/sdk/purview/azure-purview-datamap/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (2024-01-26) + +- This is the initial release of the Azure Purview Data Map library. 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..0df0af45f694 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/MANIFEST.in @@ -0,0 +1,7 @@ +recursive-include tests *.py +recursive-include samples *.py *.md +include *.md +include LICENSE +include azure/__init__.py +include azure/purview/__init__.py +include azure/purview/datamap/py.typed 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..7bcb06628c55 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/dev_requirements.txt @@ -0,0 +1,4 @@ +-e ../../../tools/azure-sdk-tools +-e ../../../tools/azure-devtools +-e ../../identity/azure-identity +aiohttp>=3.0 \ 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..a40402ec35c9 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/pyproject.toml @@ -0,0 +1,6 @@ +[tool.azure-sdk-build] +pylint = false +pyright = false +type_check_samples = false +verifytypes = false +ci_enabled = false \ No newline at end of file diff --git a/sdk/purview/azure-purview-datamap/sdk_packaging.toml b/sdk/purview/azure-purview-datamap/sdk_packaging.toml new file mode 100644 index 000000000000..8fad0f45e070 --- /dev/null +++ b/sdk/purview/azure-purview-datamap/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +auto_update = false +package_name = "azure-purview-datamap" +package_pprint_name = "Azure Purview Data Map" +is_stable = false +is_arm = false + +# Package owners should uncomment and set this doc id. +# package_doc_id = "purview-datamap" \ No newline at end of file From ba42eae247631b3d942a40f23e0428b9db356e28 Mon Sep 17 00:00:00 2001 From: Declan Grant Date: Fri, 26 Jan 2024 12:27:45 -0700 Subject: [PATCH 6/6] Create README --- sdk/purview/azure-purview-datamap/README.md | 169 ++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sdk/purview/azure-purview-datamap/README.md diff --git a/sdk/purview/azure-purview-datamap/README.md b/sdk/purview/azure-purview-datamap/README.md new file mode 100644 index 000000000000..c9c3bbde817c --- /dev/null +++ b/sdk/purview/azure-purview-datamap/README.md @@ -0,0 +1,169 @@ +# Azure Purview Data Map client library for Python + +Azure Purview Data Map is a fully managed cloud service whose users can discover the data sources they need and understand the data sources they find. At the same time, Data Map helps organizations get more value from their existing investments. + +- Search for data using technical or business terms +- Browse associated technical, business, semantic, and operational metadata +- Identify the sensitivity level of data. + +**Please rely heavily on the [service's documentation][catalog_product_documentation] and our [client docs][request_builders_and_client] to use this library** + +[Source code][source_code] | [Package (PyPI)][datamap_pypi] | [API reference documentation][datamap_ref_docs]| [Product documentation][catalog_product_documentation] + +## _Disclaimer_ + +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ + +## Getting started + +### Prerequisites + +- Python 3.6 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. + +#### Create a Purview Resource + +Follow [these][purview_resource] instructions to create your Purview resource + +### Install the package + +Install the Azure Purview Data Map client library for Python with [pip][pip]: + +```bash +pip install azure-purview-datamap +``` + +### Authenticate the client + +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] and +[enable AAD authentication on your Purview resource][enable_aad] + +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 PurviewDataMapClient +from azure.identity import DefaultAzureCredential + +credential = DefaultAzureCredential() +client = PurviewDataMapClient(endpoint="https://.purview.azure.com", credential=credential) +``` + +## 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 + +The following section shows you how to initialize and authenticate your client, then get all of your type-defs. + +- [Get All Type Definitions](#get-all-type-definitions "Get All Type Definitions") + +### Get All Type Definitions + +```python +from azure.purview.datamap import PurviewDataMapClient +from azure.identity import DefaultAzureCredential +from azure.core.exceptions import HttpResponseError + +credential = DefaultAzureCredential() +client = PurviewDataMapClient(endpoint="https://.purview.azure.com", credential=credential) +try: + response = client.type.list() + # print out all of your entity definitions + print(response['entityDefs']) + +except HttpResponseError as e: + print(e) +``` + +## Troubleshooting + +### General + +The Purview Catalog client will raise exceptions defined in [Azure Core][azure_core] if you call `.raise_for_status()` on your responses. + +### Logging + +This library uses the standard +[logging][python_logging] library for logging. +Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO +level. + +Detailed DEBUG level logging, including request/response bodies and unredacted +headers, can be enabled on a client with the `logging_enable` keyword argument: + +```python +import sys +import logging +from azure.identity import DefaultAzureCredential +from azure.purview.datamap import PurviewDataMapClient + +# Create a logger for the 'azure' SDK +logger = logging.getLogger('azure') +logger.setLevel(logging.DEBUG) + +# Configure a console output +handler = logging.StreamHandler(stream=sys.stdout) +logger.addHandler(handler) + +endpoint = "https://.purview.azure.com" +credential = DefaultAzureCredential() + +# This client will log detailed information about its HTTP sessions, at DEBUG level +client = PurviewDataMapClient(endpoint=endpoint, credential=credential, logging_enable=True) +``` + +Similarly, `logging_enable` can enable detailed logging for a single `send_request` call, +even when it isn't enabled for the client: + +```python +result = client.type.list(logging_enable=True) +``` + +## 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 [cla.microsoft.com][cla]. + +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][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + + +[source_code]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/purview/azure-purview-datamap/azure/purview/datamap +[datamap_pypi]: https://aka.ms/azsdk/python/purviewdatamap/pypi +[datamap_ref_docs]: https://aka.ms/azsdk/python/purviewdatamap/ref-docs +[datamap_product_documentation]: https://azure.microsoft.com/services/purview/ +[azure_subscription]: https://azure.microsoft.com/free/ +[purview_resource]: https://learn.microsoft.com/en-us/purview/create-microsoft-purview-portal +[pip]: https://pypi.org/project/pip/ +[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 +[enable_aad]: https://docs.microsoft.com/azure/purview/create-catalog-portal#add-a-security-principal-to-a-data-plane-role +[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/README.md +[python_logging]: https://docs.python.org/3.5/library/logging.html +[cla]: https://cla.microsoft.com +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com