huaweicloud-sdk-python-v3/huaweicloud-sdk-asm/huaweicloudsdkasm/v1/model/mesh_metadata.py

231 lines
7.3 KiB
Python
Raw Normal View History

2023-10-12 09:41:03 +00:00
# coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class MeshMetadata:
"""
Attributes:
openapi_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.
"""
sensitive_list = []
openapi_types = {
'name': 'str',
'uid': 'str',
'annotations': 'dict(str, str)',
'labels': 'dict(str, str)',
2023-11-02 08:35:25 +00:00
'creation_timestamp': 'datetime'
2023-10-12 09:41:03 +00:00
}
attribute_map = {
'name': 'name',
'uid': 'uid',
'annotations': 'annotations',
'labels': 'labels',
2023-11-02 08:35:25 +00:00
'creation_timestamp': 'creationTimestamp'
2023-10-12 09:41:03 +00:00
}
2023-11-02 08:35:25 +00:00
def __init__(self, name=None, uid=None, annotations=None, labels=None, creation_timestamp=None):
2023-10-12 09:41:03 +00:00
"""MeshMetadata
The model defined in huaweicloud sdk
2023-11-02 08:35:25 +00:00
:param name: 网格名称 命名规则以小写字母开头由小写字母数字中划线(-)组成长度范围4-64且不能以中划线(-)结尾
2023-10-12 09:41:03 +00:00
:type name: str
:param uid: 网格ID资源唯一标识创建成功后自动生成填写无效
:type uid: str
:param annotations: 网格注解由key/value组成 ``` \"annotations\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
:type annotations: dict(str, str)
2023-11-02 08:35:25 +00:00
:param labels: 网格标签由key/value组成 ``` \"labels\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
2023-10-12 09:41:03 +00:00
:type labels: dict(str, str)
2023-11-02 08:35:25 +00:00
:param creation_timestamp: 网格创建时间
:type creation_timestamp: datetime
2023-10-12 09:41:03 +00:00
"""
self._name = None
self._uid = None
self._annotations = None
self._labels = None
2023-11-02 08:35:25 +00:00
self._creation_timestamp = None
2023-10-12 09:41:03 +00:00
self.discriminator = None
self.name = name
if uid is not None:
self.uid = uid
if annotations is not None:
self.annotations = annotations
if labels is not None:
self.labels = labels
2023-11-02 08:35:25 +00:00
if creation_timestamp is not None:
self.creation_timestamp = creation_timestamp
2023-10-12 09:41:03 +00:00
@property
def name(self):
"""Gets the name of this MeshMetadata.
2023-11-02 08:35:25 +00:00
网格名称 命名规则以小写字母开头由小写字母数字中划线(-)组成长度范围4-64且不能以中划线(-)结尾
2023-10-12 09:41:03 +00:00
:return: The name of this MeshMetadata.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this MeshMetadata.
2023-11-02 08:35:25 +00:00
网格名称 命名规则以小写字母开头由小写字母数字中划线(-)组成长度范围4-64且不能以中划线(-)结尾
2023-10-12 09:41:03 +00:00
:param name: The name of this MeshMetadata.
:type name: str
"""
self._name = name
@property
def uid(self):
"""Gets the uid of this MeshMetadata.
网格ID资源唯一标识创建成功后自动生成填写无效
:return: The uid of this MeshMetadata.
:rtype: str
"""
return self._uid
@uid.setter
def uid(self, uid):
"""Sets the uid of this MeshMetadata.
网格ID资源唯一标识创建成功后自动生成填写无效
:param uid: The uid of this MeshMetadata.
:type uid: str
"""
self._uid = uid
@property
def annotations(self):
"""Gets the annotations of this MeshMetadata.
网格注解由key/value组成 ``` \"annotations\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
:return: The annotations of this MeshMetadata.
:rtype: dict(str, str)
"""
return self._annotations
@annotations.setter
def annotations(self, annotations):
"""Sets the annotations of this MeshMetadata.
网格注解由key/value组成 ``` \"annotations\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
:param annotations: The annotations of this MeshMetadata.
:type annotations: dict(str, str)
"""
self._annotations = annotations
@property
def labels(self):
"""Gets the labels of this MeshMetadata.
2023-11-02 08:35:25 +00:00
网格标签由key/value组成 ``` \"labels\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
2023-10-12 09:41:03 +00:00
:return: The labels of this MeshMetadata.
:rtype: dict(str, str)
"""
return self._labels
@labels.setter
def labels(self, labels):
"""Sets the labels of this MeshMetadata.
2023-11-02 08:35:25 +00:00
网格标签由key/value组成 ``` \"labels\": { \"key1\" : \"value1\", \"key2\" : \"value2\" } ```
2023-10-12 09:41:03 +00:00
:param labels: The labels of this MeshMetadata.
:type labels: dict(str, str)
"""
self._labels = labels
@property
2023-11-02 08:35:25 +00:00
def creation_timestamp(self):
"""Gets the creation_timestamp of this MeshMetadata.
2023-10-12 09:41:03 +00:00
网格创建时间
2023-11-02 08:35:25 +00:00
:return: The creation_timestamp of this MeshMetadata.
2023-10-12 09:41:03 +00:00
:rtype: datetime
"""
2023-11-02 08:35:25 +00:00
return self._creation_timestamp
2023-10-12 09:41:03 +00:00
2023-11-02 08:35:25 +00:00
@creation_timestamp.setter
def creation_timestamp(self, creation_timestamp):
"""Sets the creation_timestamp of this MeshMetadata.
2023-10-12 09:41:03 +00:00
网格创建时间
2023-11-02 08:35:25 +00:00
:param creation_timestamp: The creation_timestamp of this MeshMetadata.
:type creation_timestamp: datetime
2023-10-12 09:41:03 +00:00
"""
2023-11-02 08:35:25 +00:00
self._creation_timestamp = creation_timestamp
2023-10-12 09:41:03 +00:00
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_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:
if attr in self.sensitive_list:
result[attr] = "****"
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, MeshMetadata):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other