# 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 AspectObject(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 = {"aspect_name": "str", "aspect_id": "str"}
attribute_map = {"aspect_name": "aspectName", "aspect_id": "aspectId"}
def __init__(self, aspect_name=None, aspect_id=None):
self._aspect_name = aspect_name
self._aspect_id = aspect_id
self.discriminator = None
@property
def aspect_name(self):
"""Gets the aspect_name of this AspectObject.
Name of aspect
:return: The aspect_name of this AspectObject.
:rtype: str
"""
return self._aspect_name
@aspect_name.setter
def aspect_name(self, aspect_name):
"""Sets the aspect_name of this AspectObject.
Name of aspect
:param aspect_name: The aspect_name of this AspectObject.
:type: str
"""
if aspect_name is None:
raise MindsphereClientError(
"Invalid value for `aspect_name`, must not be `None`"
)
self._aspect_name = aspect_name
@property
def aspect_id(self):
"""Gets the aspect_id of this AspectObject.
Id of aspect
:return: The aspect_id of this AspectObject.
:rtype: str
"""
return self._aspect_id
@aspect_id.setter
def aspect_id(self, aspect_id):
"""Sets the aspect_id of this AspectObject.
Id of aspect
:param aspect_id: The aspect_id of this AspectObject.
:type: str
"""
if aspect_id is None:
raise MindsphereClientError(
"Invalid value for `aspect_id`, must not be `None`"
)
self._aspect_id = aspect_id
[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(AspectObject, 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, AspectObject):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other