huaweicloud-sdk-python-v3/huaweicloud-sdk-eip/huaweicloudsdkeip/v2/model/create_publicip_option.py

234 lines
9.4 KiB
Python
Raw Normal View History

# coding: utf-8
import re
import six
2021-07-26 11:24:08 +00:00
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreatePublicipOption:
"""
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 = {
'ip_address': 'str',
'type': 'str',
2021-11-25 09:11:54 +00:00
'ip_version': 'int',
2022-09-22 11:38:02 +00:00
'alias': 'str',
'port_id': 'str'
}
attribute_map = {
'ip_address': 'ip_address',
'type': 'type',
2021-11-25 09:11:54 +00:00
'ip_version': 'ip_version',
2022-09-22 11:38:02 +00:00
'alias': 'alias',
'port_id': 'port_id'
}
2022-09-22 11:38:02 +00:00
def __init__(self, ip_address=None, type=None, ip_version=None, alias=None, port_id=None):
2022-04-21 12:03:46 +00:00
"""CreatePublicipOption
The model defined in huaweicloud sdk
:param ip_address: 功能说明希望申请到的弹性公网IP的地址不指定时由系统自动分配 约束必须为IP地址格式且必须在可用地址池范围内
:type ip_address: str
:param type: 功能说明弹性公网IP的类型 取值范围5_telcom电信5_union联通5_bgp全动态BGP5_sbgp静态BGP5_ipv6 东北-大连5_telcom5_union 华南-广州5_bgp5_sbgp 华东-上海二5_bgp5_sbgp 华北-北京一5_bgp5_sbgp5_ipv6 亚太-香港5_bgp 亚太-曼谷5_bgp 亚太-新加坡5_bgp 非洲-约翰内斯堡5_bgp 西南-贵阳一5_bgp5_sbgp 华北-北京四5_bgp5_sbgp 约束必须是系统具体支持的类型 publicip_id为IPv4端口所以\"publicip_type\"字段未给定时默认为5_bgp
:type type: str
:param ip_version: 功能说明弹性IP弹性公网IP的版本 取值范围46分别表示创建ipv4和ipv6 约束必须是系统具体支持的类型 不填或空字符串时默认创建ipv4
:type ip_version: int
:param alias: 功能说明弹性公网IP名称 取值范围1-64个字符支持数字字母中文_(下划线)-中划线.
:type alias: str
2022-09-22 11:38:02 +00:00
:param port_id: 功能说明端口id 约束必须是存在的端口id如果该端口不存在或端口已绑定EIP则会提示出错
:type port_id: str
2022-04-21 12:03:46 +00:00
"""
self._ip_address = None
self._type = None
self._ip_version = None
2021-11-25 09:11:54 +00:00
self._alias = None
2022-09-22 11:38:02 +00:00
self._port_id = None
self.discriminator = None
if ip_address is not None:
self.ip_address = ip_address
self.type = type
if ip_version is not None:
self.ip_version = ip_version
2021-11-25 09:11:54 +00:00
if alias is not None:
self.alias = alias
2022-09-22 11:38:02 +00:00
if port_id is not None:
self.port_id = port_id
@property
def ip_address(self):
"""Gets the ip_address of this CreatePublicipOption.
功能说明希望申请到的弹性公网IP的地址不指定时由系统自动分配 约束必须为IP地址格式且必须在可用地址池范围内
:return: The ip_address of this CreatePublicipOption.
:rtype: str
"""
return self._ip_address
@ip_address.setter
def ip_address(self, ip_address):
"""Sets the ip_address of this CreatePublicipOption.
功能说明希望申请到的弹性公网IP的地址不指定时由系统自动分配 约束必须为IP地址格式且必须在可用地址池范围内
:param ip_address: The ip_address of this CreatePublicipOption.
2022-04-21 12:03:46 +00:00
:type ip_address: str
"""
self._ip_address = ip_address
@property
def type(self):
"""Gets the type of this CreatePublicipOption.
功能说明弹性公网IP的类型 取值范围5_telcom电信5_union联通5_bgp全动态BGP5_sbgp静态BGP5_ipv6 东北-大连5_telcom5_union 华南-广州5_bgp5_sbgp 华东-上海二5_bgp5_sbgp 华北-北京一5_bgp5_sbgp5_ipv6 亚太-香港5_bgp 亚太-曼谷5_bgp 亚太-新加坡5_bgp 非洲-约翰内斯堡5_bgp 西南-贵阳一5_bgp5_sbgp 华北-北京四5_bgp5_sbgp 约束必须是系统具体支持的类型 publicip_id为IPv4端口所以\"publicip_type\"字段未给定时默认为5_bgp。
:return: The type of this CreatePublicipOption.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this CreatePublicipOption.
功能说明弹性公网IP的类型 取值范围5_telcom电信5_union联通5_bgp全动态BGP5_sbgp静态BGP5_ipv6 东北-大连5_telcom5_union 华南-广州5_bgp5_sbgp 华东-上海二5_bgp5_sbgp 华北-北京一5_bgp5_sbgp5_ipv6 亚太-香港5_bgp 亚太-曼谷5_bgp 亚太-新加坡5_bgp 非洲-约翰内斯堡5_bgp 西南-贵阳一5_bgp5_sbgp 华北-北京四5_bgp5_sbgp 约束必须是系统具体支持的类型 publicip_id为IPv4端口所以\"publicip_type\"字段未给定时默认为5_bgp。
:param type: The type of this CreatePublicipOption.
2022-04-21 12:03:46 +00:00
:type type: str
"""
self._type = type
@property
def ip_version(self):
"""Gets the ip_version of this CreatePublicipOption.
功能说明弹性IP弹性公网IP的版本 取值范围46分别表示创建ipv4和ipv6 约束必须是系统具体支持的类型 不填或空字符串时默认创建ipv4
:return: The ip_version of this CreatePublicipOption.
:rtype: int
"""
return self._ip_version
@ip_version.setter
def ip_version(self, ip_version):
"""Sets the ip_version of this CreatePublicipOption.
功能说明弹性IP弹性公网IP的版本 取值范围46分别表示创建ipv4和ipv6 约束必须是系统具体支持的类型 不填或空字符串时默认创建ipv4
:param ip_version: The ip_version of this CreatePublicipOption.
2022-04-21 12:03:46 +00:00
:type ip_version: int
"""
self._ip_version = ip_version
2021-11-25 09:11:54 +00:00
@property
def alias(self):
"""Gets the alias of this CreatePublicipOption.
功能说明弹性公网IP名称 取值范围1-64个字符支持数字字母中文_(下划线)-中划线.
:return: The alias of this CreatePublicipOption.
:rtype: str
"""
return self._alias
@alias.setter
def alias(self, alias):
"""Sets the alias of this CreatePublicipOption.
功能说明弹性公网IP名称 取值范围1-64个字符支持数字字母中文_(下划线)-中划线.
:param alias: The alias of this CreatePublicipOption.
2022-04-21 12:03:46 +00:00
:type alias: str
2021-11-25 09:11:54 +00:00
"""
self._alias = alias
2022-09-22 11:38:02 +00:00
@property
def port_id(self):
"""Gets the port_id of this CreatePublicipOption.
功能说明端口id 约束必须是存在的端口id如果该端口不存在或端口已绑定EIP则会提示出错
:return: The port_id of this CreatePublicipOption.
:rtype: str
"""
return self._port_id
@port_id.setter
def port_id(self, port_id):
"""Sets the port_id of this CreatePublicipOption.
功能说明端口id 约束必须是存在的端口id如果该端口不存在或端口已绑定EIP则会提示出错
:param port_id: The port_id of this CreatePublicipOption.
:type port_id: str
"""
self._port_id = port_id
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):
2021-08-10 12:26:18 +00:00
"""Returns the string representation of the model"""
2021-07-09 10:57:08 +00:00
import simplejson as json
2021-08-10 12:26:18 +00:00
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
2021-08-10 12:26:18 +00:00
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, CreatePublicipOption):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other