# coding: utf-8


"""
IGNORE:
    Nutanix Networking Versioned APIs

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

    OpenAPI spec version: 4.0.1-beta-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 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.VirtualSwitchProjection import VirtualSwitchProjection  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.Vpc import Vpc  # noqa: F401,E501
from ntnx_networking_py_client.models.networking.v4.config.VpcProjection import VpcProjection  # noqa: F401,E501

class SubnetProjection(Subnet):

    """

    :param virtual_switch_projection: (:attr:`virtual_switch_projection`) 
    :type virtual_switch_projection: 
    :param vpc_projection: (:attr:`vpc_projection`) 
    :type vpc_projection: 

    """
    """
    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 = {
        'virtual_switch_projection': 'networking.v4.config.VirtualSwitchProjection',
        'vpc_projection': 'networking.v4.config.VpcProjection',
        '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 = {
        'virtual_switch_projection': 'virtualSwitchProjection',
        'vpc_projection': 'vpcProjection',
        '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, virtual_switch_projection=None, vpc_projection=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.__virtual_switch_projection = None
        self.__vpc_projection = None
        self.discriminator = None
        if virtual_switch_projection is not None:
            self.__virtual_switch_projection = virtual_switch_projection
        if vpc_projection is not None:
            self.__vpc_projection = vpc_projection

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

    def _initialize_fq_object_type(self):
        return 'networking.v4.r0.b1.config.SubnetProjection'


    @property
    def virtual_switch_projection(self):
        """
        

        :type:
            :class:`~ntnx_networking_py_client.models.networking.v4.config.VirtualSwitchProjection`
        """  # noqa: E501
        return self.__virtual_switch_projection

    @virtual_switch_projection.setter
    def virtual_switch_projection(self, virtual_switch_projection):

        self.__virtual_switch_projection = virtual_switch_projection

    @property
    def vpc_projection(self):
        """
        

        :type:
            :class:`~ntnx_networking_py_client.models.networking.v4.config.VpcProjection`
        """  # noqa: E501
        return self.__vpc_projection

    @vpc_projection.setter
    def vpc_projection(self, vpc_projection):

        self.__vpc_projection = vpc_projection

    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, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1]._to_dict(sanitize))
                    if hasattr(item[1], "_to_dict") else item,
                    six.iteritems(value)
                ))
            else:
                if sanitize:
                    if value is not None:
                        result[attr] = value
                else:
                    result[attr] = value
        if issubclass(SubnetProjection, 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, SubnetProjection):
            return False

        return self.__dict__ == other.__dict__

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

