Source code for integrateddatalake.models.metadata

# coding: utf-8

"""
    Data Lake API

    Service for storing Objects, download objects, add extended metadata tags,  subscribe for notifications, import tenant specific MindSphere Time Series data, and enable data access using cross account access and STS in Integrated MindSphere Data Lake. - Objects reside in user specified path like below example. Extension in object name is optional. Root path can be denoted as \"/\"       /basefolder/subfolder/objectname.objectext   - The following generic error codes might occur at any of the specified operations. Generic errors are prefixed with 'mdsp.core.generic.'.    - missingParameter   - invalidParameter   - missingRequestBodyProperty   - invalidRequestBodyProperty   - unauthorized   - forbidden   - noMatch   - unsupportedMediaType   - tooManyRequests   - internalServerError  # noqa: E501
"""


import pprint
import re
import six
from mindsphere_core.exceptions import MindsphereClientError


[docs]class Metadata(object): """ Attributes: attribute_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ attribute_types = {"tags": "list[str]"} attribute_map = {"tags": "tags"} def __init__(self, tags=None): self._tags = tags self.discriminator = None @property def tags(self): """Gets the tags of this Metadata. Array of Metadata. :return: The tags of this Metadata. :rtype: list[str] """ return self._tags @tags.setter def tags(self, tags): """Sets the tags of this Metadata. Array of Metadata. :param tags: The tags of this Metadata. :type: list[str] """ if tags is None: raise MindsphereClientError("Invalid value for `tags`, must not be `None`") self._tags = tags
[docs] def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.attribute_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list( map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) ) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict( map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items(), ) ) else: result[attr] = value if issubclass(Metadata, dict): for key, value in self.items(): result[key] = value return result
[docs] def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict())
def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, Metadata): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other