huaweicloud-sdk-python-v3/huaweicloud-sdk-bms/huaweicloudsdkbms/v1/model/band_width.py

217 lines
7.1 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 pprint
import re
import six
class BandWidth:
"""
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',
'sharetype': 'str',
'id': 'str',
'size': 'int',
'chargemode': 'str'
}
attribute_map = {
'name': 'name',
'sharetype': 'sharetype',
'id': 'id',
'size': 'size',
'chargemode': 'chargemode'
}
def __init__(self, name=None, sharetype=None, id=None, size=None, chargemode=None):
"""BandWidth - a model defined in huaweicloud sdk"""
self._name = None
self._sharetype = None
self._id = None
self._size = None
self._chargemode = None
self.discriminator = None
if name is not None:
self.name = name
self.sharetype = sharetype
if id is not None:
self.id = id
self.size = size
if chargemode is not None:
self.chargemode = chargemode
@property
def name(self):
"""Gets the name of this BandWidth.
带宽名称
:return: The name of this BandWidth.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this BandWidth.
带宽名称
:param name: The name of this BandWidth.
:type: str
"""
self._name = name
@property
def sharetype(self):
"""Gets the sharetype of this BandWidth.
带宽的共享类型。共享类型枚举PER表示独享WHOLE表示共享
:return: The sharetype of this BandWidth.
:rtype: str
"""
return self._sharetype
@sharetype.setter
def sharetype(self, sharetype):
"""Sets the sharetype of this BandWidth.
带宽的共享类型。共享类型枚举PER表示独享WHOLE表示共享
:param sharetype: The sharetype of this BandWidth.
:type: str
"""
self._sharetype = sharetype
@property
def id(self):
"""Gets the id of this BandWidth.
共享带宽ID。创建WHOLE类型带宽的弹性公网IP时可以指定之前的共享带宽创建。共享带宽的使用限制请参见“共享带宽简介”。 说明当创建WHOLE类型的带宽时该字段必选。
:return: The id of this BandWidth.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this BandWidth.
共享带宽ID。创建WHOLE类型带宽的弹性公网IP时可以指定之前的共享带宽创建。共享带宽的使用限制请参见“共享带宽简介”。 说明当创建WHOLE类型的带宽时该字段必选。
:param id: The id of this BandWidth.
:type: str
"""
self._id = id
@property
def size(self):
"""Gets the size of this BandWidth.
取值范围默认5Mbit/s~2000Mbit/s具体范围以各Region配置为准请参见管理控制台对应页面显示。功能说明带宽大小。共享带宽的大小有最小值限制默认为5M。 说明如果传入的参数为小数如10.2或者字符类型如10会自动强制转换为整数。带宽小于300Mbit/s时步长支持1Mbit/s带宽为300Mbit/s~1000Mbit/s时步长支持50Mbit/s带宽为1000Mbit/s~2000Mbit/s时步长支持1000Mbit/s。如果sharetype是PER该参数必选如果sharetype是WHOLE并且id有值该参数会忽略。
:return: The size of this BandWidth.
:rtype: int
"""
return self._size
@size.setter
def size(self, size):
"""Sets the size of this BandWidth.
取值范围默认5Mbit/s~2000Mbit/s具体范围以各Region配置为准请参见管理控制台对应页面显示。功能说明带宽大小。共享带宽的大小有最小值限制默认为5M。 说明如果传入的参数为小数如10.2或者字符类型如10会自动强制转换为整数。带宽小于300Mbit/s时步长支持1Mbit/s带宽为300Mbit/s~1000Mbit/s时步长支持50Mbit/s带宽为1000Mbit/s~2000Mbit/s时步长支持1000Mbit/s。如果sharetype是PER该参数必选如果sharetype是WHOLE并且id有值该参数会忽略。
:param size: The size of this BandWidth.
:type: int
"""
self._size = size
@property
def chargemode(self):
"""Gets the chargemode of this BandWidth.
带宽的计费类型。取值为traffic按流量计费、bandwidth按带宽计费未传该字段表示按带宽计费。字段值为空表示按带宽计费。 说明如果sharetype是WHOLE并且id有值仅支持按带宽计费该参数会忽略。
:return: The chargemode of this BandWidth.
:rtype: str
"""
return self._chargemode
@chargemode.setter
def chargemode(self, chargemode):
"""Sets the chargemode of this BandWidth.
带宽的计费类型。取值为traffic按流量计费、bandwidth按带宽计费未传该字段表示按带宽计费。字段值为空表示按带宽计费。 说明如果sharetype是WHOLE并且id有值仅支持按带宽计费该参数会忽略。
:param chargemode: The chargemode of this BandWidth.
:type: str
"""
self._chargemode = chargemode
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"""
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, BandWidth):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other