# coding: utf-8


"""
IGNORE:
    Nutanix Networking APIs

    Manage networking configuration on Nutanix clusters, including AHV and advanced networking.  # noqa: E501

    OpenAPI spec version: 4.0.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
IGNORE
"""
import pprint
import json
import ast
import re  # noqa: F401

import six
from pathlib import Path
from ntnx_networking_py_client.models.common.v1.config.IPAddress import IPAddress  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.DhcpOptions import DhcpOptions  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.IPConfig import IPConfig  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.IPUsage import IPUsage  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.MigrationState import MigrationState  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.Subnet import Subnet  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.SubnetType import SubnetType  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.VirtualSwitch import VirtualSwitch  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.Vpc import Vpc  # noqa: F401,E501

class RemoteSubnet(Subnet):

    """Information about a subnet from the specified Prism Central cluster.

    :param vpc_name: (:attr:`vpc_name`) Name of the VPC associated with the subnet.
    :type vpc_name: 
     max=128 chars
    

    """
    """
    IGNORE:
    Attributes:
      swagger_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.
    IGNORE
    """  # noqa: E501
    swagger_types = {
        'vpc_name': 'str',
        'name': 'str',
        'description': 'str',
        'subnet_type': 'networking.v4.config.SubnetType',
        'network_id': 'int',
        'dhcp_options': 'networking.v4.config.DhcpOptions',
        'ip_config': 'list[networking.v4.config.IPConfig]',
        'cluster_reference': 'str',
        'virtual_switch_reference': 'str',
        'vpc_reference': 'str',
        'is_nat_enabled': 'bool',
        'is_external': 'bool',
        'reserved_ip_addresses': 'list[common.v1.config.IPAddress]',
        'dynamic_ip_addresses': 'list[common.v1.config.IPAddress]',
        'network_function_chain_reference': 'str',
        'bridge_name': 'str',
        'is_advanced_networking': 'bool',
        'cluster_name': 'str',
        'hypervisor_type': 'str',
        'virtual_switch': 'networking.v4.config.VirtualSwitch',
        'vpc': 'networking.v4.config.Vpc',
        'ip_prefix': 'str',
        'ip_usage': 'networking.v4.config.IPUsage',
        'migration_state': 'networking.v4.config.MigrationState',
        'metadata': 'common.v1.config.Metadata',
        'ext_id': 'str',
        'links': 'list[common.v1.response.ApiLink]',
        'tenant_id': 'str',
        '_reserved': 'dict(str, object)',
        '_object_type': 'str',
        '_unknown_fields': 'dict(str, object)',
    }

    attribute_map = {
        'vpc_name': 'vpcName',
        'name': 'name',
        'description': 'description',
        'subnet_type': 'subnetType',
        'network_id': 'networkId',
        'dhcp_options': 'dhcpOptions',
        'ip_config': 'ipConfig',
        'cluster_reference': 'clusterReference',
        'virtual_switch_reference': 'virtualSwitchReference',
        'vpc_reference': 'vpcReference',
        'is_nat_enabled': 'isNatEnabled',
        'is_external': 'isExternal',
        'reserved_ip_addresses': 'reservedIpAddresses',
        'dynamic_ip_addresses': 'dynamicIpAddresses',
        'network_function_chain_reference': 'networkFunctionChainReference',
        'bridge_name': 'bridgeName',
        'is_advanced_networking': 'isAdvancedNetworking',
        'cluster_name': 'clusterName',
        'hypervisor_type': 'hypervisorType',
        'virtual_switch': 'virtualSwitch',
        'vpc': 'vpc',
        'ip_prefix': 'ipPrefix',
        'ip_usage': 'ipUsage',
        'migration_state': 'migrationState',
        'metadata': 'metadata',
        'ext_id': 'extId',
        'links': 'links',
        'tenant_id': 'tenantId',
        '_reserved': '$reserved',
        '_object_type': '$objectType',
        '_unknown_fields': '$unknownFields',
    }



    def __init__(self, vpc_name=None, name=None, description=None, subnet_type=None, network_id=None, dhcp_options=None, ip_config=None, cluster_reference=None, virtual_switch_reference=None, vpc_reference=None, is_nat_enabled=None, is_external=None, reserved_ip_addresses=None, dynamic_ip_addresses=None, network_function_chain_reference=None, bridge_name=None, is_advanced_networking=None, cluster_name=None, hypervisor_type=None, virtual_switch=None, vpc=None, ip_prefix=None, ip_usage=None, migration_state=None, metadata=None, ext_id=None, links=None, tenant_id=None, *args, **kwargs):  # noqa: E501
        Subnet.__init__(self, name, description, subnet_type, network_id, dhcp_options, ip_config, cluster_reference, virtual_switch_reference, vpc_reference, is_nat_enabled, is_external, reserved_ip_addresses, dynamic_ip_addresses, network_function_chain_reference, bridge_name, is_advanced_networking, cluster_name, hypervisor_type, virtual_switch, vpc, ip_prefix, ip_usage, migration_state, metadata, ext_id, links, tenant_id, *args, **kwargs)
        self.__vpc_name = None
        self.discriminator = None
        if vpc_name is not None:
            self.__vpc_name = vpc_name

    def _initialize_object_type(self):
        return 'networking.v4.config.RemoteSubnet'

    def _initialize_object_version(self):
        return 'v4.r0'


    @property
    def vpc_name(self):
        """
        Name of the VPC associated with the subnet.

        :type:
                :class:`~str`
        """  # noqa: E501
        return self.__vpc_name

    @vpc_name.setter
    def vpc_name(self, vpc_name):
        if vpc_name is not None and len(vpc_name) > 128:
            raise ValueError("Invalid value for `vpc_name`, length must be less than or equal to `128`")  # noqa: E501

        self.__vpc_name = vpc_name

    def _to_dict(self, sanitize):
        """Returns the model properties as a dict. Omits None properties based on the provided "sanitize" parameter.

        :param sanitize: A flag to omit None properties if set to True
        :type sanitize: bool
        """

        result = {}
        for attr, attr_type in six.iteritems(self.swagger_types):

            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x._to_dict(sanitize) if hasattr(x, "_to_dict") else x,
                    value
                ))
            elif hasattr(value, "_to_dict"):
                result[attr] = value._to_dict(sanitize)
            elif isinstance(value, Path):
                result[attr] = str(value)
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1]._to_dict(sanitize)) if hasattr(item[1], "_to_dict")
                    else (
                        (item[0], str(item[1])) if item[0] == 'path' and '$objectType' in value and value['$objectType'] == 'pathlib.Path'
                        else item
                    ),
                    six.iteritems(value)
                ))
            else:
                if sanitize:
                    if value is not None:
                        result[attr] = value
                else:
                    result[attr] = value
        if issubclass(RemoteSubnet, dict):
            for key, value in six.iteritems(self):
                result[key] = value

        return result

    def to_dict(self):
        """Returns the model properties as a dictionary"""
        return self._to_dict(False)

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self._to_dict(True))

    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, RemoteSubnet):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other

