python/kubernetes/client/models/v1alpha1_cluster_cidr_spec.py
2022-10-11 20:12:42 +00:00

206 lines
7.3 KiB
Python

# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernetes.client.configuration import Configuration
class V1alpha1ClusterCIDRSpec(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
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.
"""
openapi_types = {
'ipv4': 'str',
'ipv6': 'str',
'node_selector': 'V1NodeSelector',
'per_node_host_bits': 'int'
}
attribute_map = {
'ipv4': 'ipv4',
'ipv6': 'ipv6',
'node_selector': 'nodeSelector',
'per_node_host_bits': 'perNodeHostBits'
}
def __init__(self, ipv4=None, ipv6=None, node_selector=None, per_node_host_bits=None, local_vars_configuration=None): # noqa: E501
"""V1alpha1ClusterCIDRSpec - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._ipv4 = None
self._ipv6 = None
self._node_selector = None
self._per_node_host_bits = None
self.discriminator = None
if ipv4 is not None:
self.ipv4 = ipv4
if ipv6 is not None:
self.ipv6 = ipv6
if node_selector is not None:
self.node_selector = node_selector
self.per_node_host_bits = per_node_host_bits
@property
def ipv4(self):
"""Gets the ipv4 of this V1alpha1ClusterCIDRSpec. # noqa: E501
IPv4 defines an IPv4 IP block in CIDR notation(e.g. \"10.0.0.0/8\"). At least one of IPv4 and IPv6 must be specified. This field is immutable. # noqa: E501
:return: The ipv4 of this V1alpha1ClusterCIDRSpec. # noqa: E501
:rtype: str
"""
return self._ipv4
@ipv4.setter
def ipv4(self, ipv4):
"""Sets the ipv4 of this V1alpha1ClusterCIDRSpec.
IPv4 defines an IPv4 IP block in CIDR notation(e.g. \"10.0.0.0/8\"). At least one of IPv4 and IPv6 must be specified. This field is immutable. # noqa: E501
:param ipv4: The ipv4 of this V1alpha1ClusterCIDRSpec. # noqa: E501
:type: str
"""
self._ipv4 = ipv4
@property
def ipv6(self):
"""Gets the ipv6 of this V1alpha1ClusterCIDRSpec. # noqa: E501
IPv6 defines an IPv6 IP block in CIDR notation(e.g. \"fd12:3456:789a:1::/64\"). At least one of IPv4 and IPv6 must be specified. This field is immutable. # noqa: E501
:return: The ipv6 of this V1alpha1ClusterCIDRSpec. # noqa: E501
:rtype: str
"""
return self._ipv6
@ipv6.setter
def ipv6(self, ipv6):
"""Sets the ipv6 of this V1alpha1ClusterCIDRSpec.
IPv6 defines an IPv6 IP block in CIDR notation(e.g. \"fd12:3456:789a:1::/64\"). At least one of IPv4 and IPv6 must be specified. This field is immutable. # noqa: E501
:param ipv6: The ipv6 of this V1alpha1ClusterCIDRSpec. # noqa: E501
:type: str
"""
self._ipv6 = ipv6
@property
def node_selector(self):
"""Gets the node_selector of this V1alpha1ClusterCIDRSpec. # noqa: E501
:return: The node_selector of this V1alpha1ClusterCIDRSpec. # noqa: E501
:rtype: V1NodeSelector
"""
return self._node_selector
@node_selector.setter
def node_selector(self, node_selector):
"""Sets the node_selector of this V1alpha1ClusterCIDRSpec.
:param node_selector: The node_selector of this V1alpha1ClusterCIDRSpec. # noqa: E501
:type: V1NodeSelector
"""
self._node_selector = node_selector
@property
def per_node_host_bits(self):
"""Gets the per_node_host_bits of this V1alpha1ClusterCIDRSpec. # noqa: E501
PerNodeHostBits defines the number of host bits to be configured per node. A subnet mask determines how much of the address is used for network bits and host bits. For example an IPv4 address of 192.168.0.0/24, splits the address into 24 bits for the network portion and 8 bits for the host portion. To allocate 256 IPs, set this field to 8 (a /24 mask for IPv4 or a /120 for IPv6). Minimum value is 4 (16 IPs). This field is immutable. # noqa: E501
:return: The per_node_host_bits of this V1alpha1ClusterCIDRSpec. # noqa: E501
:rtype: int
"""
return self._per_node_host_bits
@per_node_host_bits.setter
def per_node_host_bits(self, per_node_host_bits):
"""Sets the per_node_host_bits of this V1alpha1ClusterCIDRSpec.
PerNodeHostBits defines the number of host bits to be configured per node. A subnet mask determines how much of the address is used for network bits and host bits. For example an IPv4 address of 192.168.0.0/24, splits the address into 24 bits for the network portion and 8 bits for the host portion. To allocate 256 IPs, set this field to 8 (a /24 mask for IPv4 or a /120 for IPv6). Minimum value is 4 (16 IPs). This field is immutable. # noqa: E501
:param per_node_host_bits: The per_node_host_bits of this V1alpha1ClusterCIDRSpec. # noqa: E501
:type: int
"""
if self.local_vars_configuration.client_side_validation and per_node_host_bits is None: # noqa: E501
raise ValueError("Invalid value for `per_node_host_bits`, must not be `None`") # noqa: E501
self._per_node_host_bits = per_node_host_bits
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:
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, V1alpha1ClusterCIDRSpec):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, V1alpha1ClusterCIDRSpec):
return True
return self.to_dict() != other.to_dict()