huaweicloud-sdk-python-v3/huaweicloud-sdk-deh/huaweicloudsdkdeh/v1/model/resp_server.py

392 lines
9.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RespServer:
"""
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 = {
'addresses': 'RespAddresses',
'created': 'str',
'flavor': 'RespFlavor',
'id': 'str',
'name': 'str',
'status': 'str',
'tenant_id': 'str',
'updated': 'str',
'user_id': 'str',
'task_state': 'str',
'image': 'RespImage',
'metadata': 'RespMetadata'
}
attribute_map = {
'addresses': 'addresses',
'created': 'created',
'flavor': 'flavor',
'id': 'id',
'name': 'name',
'status': 'status',
'tenant_id': 'tenant_id',
'updated': 'updated',
'user_id': 'user_id',
'task_state': 'task_state',
'image': 'image',
'metadata': 'metadata'
}
def __init__(self, addresses=None, created=None, flavor=None, id=None, name=None, status=None, tenant_id=None, updated=None, user_id=None, task_state=None, image=None, metadata=None):
"""RespServer - a model defined in huaweicloud sdk"""
self._addresses = None
self._created = None
self._flavor = None
self._id = None
self._name = None
self._status = None
self._tenant_id = None
self._updated = None
self._user_id = None
self._task_state = None
self._image = None
self._metadata = None
self.discriminator = None
self.addresses = addresses
self.created = created
self.flavor = flavor
self.id = id
self.name = name
self.status = status
self.tenant_id = tenant_id
self.updated = updated
self.user_id = user_id
self.task_state = task_state
self.image = image
self.metadata = metadata
@property
def addresses(self):
"""Gets the addresses of this RespServer.
:return: The addresses of this RespServer.
:rtype: RespAddresses
"""
return self._addresses
@addresses.setter
def addresses(self, addresses):
"""Sets the addresses of this RespServer.
:param addresses: The addresses of this RespServer.
:type: RespAddresses
"""
self._addresses = addresses
@property
def created(self):
"""Gets the created of this RespServer.
弹性云服务器创建时间。
:return: The created of this RespServer.
:rtype: str
"""
return self._created
@created.setter
def created(self, created):
"""Sets the created of this RespServer.
弹性云服务器创建时间。
:param created: The created of this RespServer.
:type: str
"""
self._created = created
@property
def flavor(self):
"""Gets the flavor of this RespServer.
:return: The flavor of this RespServer.
:rtype: RespFlavor
"""
return self._flavor
@flavor.setter
def flavor(self, flavor):
"""Sets the flavor of this RespServer.
:param flavor: The flavor of this RespServer.
:type: RespFlavor
"""
self._flavor = flavor
@property
def id(self):
"""Gets the id of this RespServer.
弹性云服务器ID格式为UUID。
:return: The id of this RespServer.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this RespServer.
弹性云服务器ID格式为UUID。
:param id: The id of this RespServer.
:type: str
"""
self._id = id
@property
def name(self):
"""Gets the name of this RespServer.
弹性云服务器名称。
:return: The name of this RespServer.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this RespServer.
弹性云服务器名称。
:param name: The name of this RespServer.
:type: str
"""
self._name = name
@property
def status(self):
"""Gets the status of this RespServer.
弹性云服务器状态。 取值范围ACTIVE、BUILD、DELETED、ERROR、HARD_REBOOT、MIGRATING、PASSWORD、PAUSED、REBOOT、REBUILD、RESIZE、REVERT_RESIZE、SHUTOFF、SHELVED、SHELVED_OFFLOADED、SOFT_DELETED、SUSPENDED、VERIFY_RESIZE
:return: The status of this RespServer.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this RespServer.
弹性云服务器状态。 取值范围ACTIVE、BUILD、DELETED、ERROR、HARD_REBOOT、MIGRATING、PASSWORD、PAUSED、REBOOT、REBUILD、RESIZE、REVERT_RESIZE、SHUTOFF、SHELVED、SHELVED_OFFLOADED、SOFT_DELETED、SUSPENDED、VERIFY_RESIZE
:param status: The status of this RespServer.
:type: str
"""
self._status = status
@property
def tenant_id(self):
"""Gets the tenant_id of this RespServer.
弹性云服务器所属租户ID格式为UUID。
:return: The tenant_id of this RespServer.
:rtype: str
"""
return self._tenant_id
@tenant_id.setter
def tenant_id(self, tenant_id):
"""Sets the tenant_id of this RespServer.
弹性云服务器所属租户ID格式为UUID。
:param tenant_id: The tenant_id of this RespServer.
:type: str
"""
self._tenant_id = tenant_id
@property
def updated(self):
"""Gets the updated of this RespServer.
弹性云服务器更新时间。
:return: The updated of this RespServer.
:rtype: str
"""
return self._updated
@updated.setter
def updated(self, updated):
"""Sets the updated of this RespServer.
弹性云服务器更新时间。
:param updated: The updated of this RespServer.
:type: str
"""
self._updated = updated
@property
def user_id(self):
"""Gets the user_id of this RespServer.
创建弹性云服务器的用户ID格式为UUID。
:return: The user_id of this RespServer.
:rtype: str
"""
return self._user_id
@user_id.setter
def user_id(self, user_id):
"""Sets the user_id of this RespServer.
创建弹性云服务器的用户ID格式为UUID。
:param user_id: The user_id of this RespServer.
:type: str
"""
self._user_id = user_id
@property
def task_state(self):
"""Gets the task_state of this RespServer.
弹性云服务器当前任务的状态。
:return: The task_state of this RespServer.
:rtype: str
"""
return self._task_state
@task_state.setter
def task_state(self, task_state):
"""Sets the task_state of this RespServer.
弹性云服务器当前任务的状态。
:param task_state: The task_state of this RespServer.
:type: str
"""
self._task_state = task_state
@property
def image(self):
"""Gets the image of this RespServer.
:return: The image of this RespServer.
:rtype: RespImage
"""
return self._image
@image.setter
def image(self, image):
"""Sets the image of this RespServer.
:param image: The image of this RespServer.
:type: RespImage
"""
self._image = image
@property
def metadata(self):
"""Gets the metadata of this RespServer.
:return: The metadata of this RespServer.
:rtype: RespMetadata
"""
return self._metadata
@metadata.setter
def metadata(self, metadata):
"""Sets the metadata of this RespServer.
:param metadata: The metadata of this RespServer.
:type: RespMetadata
"""
self._metadata = metadata
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, RespServer):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other