# coding: utf-8
try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from aoc.configuration import Configuration


class VmNic(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 = {
        'egress_rate_limit_burst_in_bit': 'float',
        'egress_rate_limit_enabled': 'bool',
        'egress_rate_limit_max_rate_in_bitps': 'float',
        'enabled': 'bool',
        'gateway': 'str',
        'id': 'str',
        'ingress_rate_limit_burst_in_bit': 'float',
        'ingress_rate_limit_enabled': 'bool',
        'ingress_rate_limit_max_rate_in_bitps': 'float',
        'interface_id': 'str',
        'ip_address': 'str',
        'local_id': 'str',
        'mac_address': 'str',
        'mirror': 'bool',
        'model': 'VmNicModel',
        'nic': 'NestedNic',
        'order': 'int',
        'subnet_mask': 'str',
        'type': 'VmNicType',
        'vlan': 'NestedVlan',
        'vm': 'NestedVm'
    }

    attribute_map = {
        'egress_rate_limit_burst_in_bit': 'egress_rate_limit_burst_in_bit',
        'egress_rate_limit_enabled': 'egress_rate_limit_enabled',
        'egress_rate_limit_max_rate_in_bitps': 'egress_rate_limit_max_rate_in_bitps',
        'enabled': 'enabled',
        'gateway': 'gateway',
        'id': 'id',
        'ingress_rate_limit_burst_in_bit': 'ingress_rate_limit_burst_in_bit',
        'ingress_rate_limit_enabled': 'ingress_rate_limit_enabled',
        'ingress_rate_limit_max_rate_in_bitps': 'ingress_rate_limit_max_rate_in_bitps',
        'interface_id': 'interface_id',
        'ip_address': 'ip_address',
        'local_id': 'local_id',
        'mac_address': 'mac_address',
        'mirror': 'mirror',
        'model': 'model',
        'nic': 'nic',
        'order': 'order',
        'subnet_mask': 'subnet_mask',
        'type': 'type',
        'vlan': 'vlan',
        'vm': 'vm'
    }

    def __init__(self, **kwargs):  # noqa: E501
        """VmNic - a model defined in OpenAPI"""  # noqa: E501
        self.local_vars_configuration = kwargs.get("local_vars_configuration", Configuration.get_default_copy())

        self._egress_rate_limit_burst_in_bit = None
        self._egress_rate_limit_enabled = None
        self._egress_rate_limit_max_rate_in_bitps = None
        self._enabled = None
        self._gateway = None
        self._id = None
        self._ingress_rate_limit_burst_in_bit = None
        self._ingress_rate_limit_enabled = None
        self._ingress_rate_limit_max_rate_in_bitps = None
        self._interface_id = None
        self._ip_address = None
        self._local_id = None
        self._mac_address = None
        self._mirror = None
        self._model = None
        self._nic = None
        self._order = None
        self._subnet_mask = None
        self._type = None
        self._vlan = None
        self._vm = None
        self.discriminator = None

        self.egress_rate_limit_burst_in_bit = kwargs.get("egress_rate_limit_burst_in_bit", None)
        self.egress_rate_limit_enabled = kwargs.get("egress_rate_limit_enabled", None)
        self.egress_rate_limit_max_rate_in_bitps = kwargs.get("egress_rate_limit_max_rate_in_bitps", None)
        self.enabled = kwargs.get("enabled", None)
        self.gateway = kwargs.get("gateway", None)
        if "id" in kwargs:
            self.id = kwargs["id"]
        self.ingress_rate_limit_burst_in_bit = kwargs.get("ingress_rate_limit_burst_in_bit", None)
        self.ingress_rate_limit_enabled = kwargs.get("ingress_rate_limit_enabled", None)
        self.ingress_rate_limit_max_rate_in_bitps = kwargs.get("ingress_rate_limit_max_rate_in_bitps", None)
        self.interface_id = kwargs.get("interface_id", None)
        self.ip_address = kwargs.get("ip_address", None)
        if "local_id" in kwargs:
            self.local_id = kwargs["local_id"]
        self.mac_address = kwargs.get("mac_address", None)
        self.mirror = kwargs.get("mirror", None)
        self.model = kwargs.get("model", None)
        self.nic = kwargs.get("nic", None)
        self.order = kwargs.get("order", None)
        self.subnet_mask = kwargs.get("subnet_mask", None)
        self.type = kwargs.get("type", None)
        self.vlan = kwargs.get("vlan", None)
        if "vm" in kwargs:
            self.vm = kwargs["vm"]

    @property
    def egress_rate_limit_burst_in_bit(self):
        """Gets the egress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501


        :return: The egress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501
        :rtype: float
        """
        return self._egress_rate_limit_burst_in_bit

    @egress_rate_limit_burst_in_bit.setter
    def egress_rate_limit_burst_in_bit(self, egress_rate_limit_burst_in_bit):
        """Sets the egress_rate_limit_burst_in_bit of this VmNic.


        :param egress_rate_limit_burst_in_bit: The egress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501
        :type egress_rate_limit_burst_in_bit: float
        """

        self._egress_rate_limit_burst_in_bit = egress_rate_limit_burst_in_bit

    @property
    def egress_rate_limit_enabled(self):
        """Gets the egress_rate_limit_enabled of this VmNic.  # noqa: E501


        :return: The egress_rate_limit_enabled of this VmNic.  # noqa: E501
        :rtype: bool
        """
        return self._egress_rate_limit_enabled

    @egress_rate_limit_enabled.setter
    def egress_rate_limit_enabled(self, egress_rate_limit_enabled):
        """Sets the egress_rate_limit_enabled of this VmNic.


        :param egress_rate_limit_enabled: The egress_rate_limit_enabled of this VmNic.  # noqa: E501
        :type egress_rate_limit_enabled: bool
        """

        self._egress_rate_limit_enabled = egress_rate_limit_enabled

    @property
    def egress_rate_limit_max_rate_in_bitps(self):
        """Gets the egress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501


        :return: The egress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501
        :rtype: float
        """
        return self._egress_rate_limit_max_rate_in_bitps

    @egress_rate_limit_max_rate_in_bitps.setter
    def egress_rate_limit_max_rate_in_bitps(self, egress_rate_limit_max_rate_in_bitps):
        """Sets the egress_rate_limit_max_rate_in_bitps of this VmNic.


        :param egress_rate_limit_max_rate_in_bitps: The egress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501
        :type egress_rate_limit_max_rate_in_bitps: float
        """

        self._egress_rate_limit_max_rate_in_bitps = egress_rate_limit_max_rate_in_bitps

    @property
    def enabled(self):
        """Gets the enabled of this VmNic.  # noqa: E501


        :return: The enabled of this VmNic.  # noqa: E501
        :rtype: bool
        """
        return self._enabled

    @enabled.setter
    def enabled(self, enabled):
        """Sets the enabled of this VmNic.


        :param enabled: The enabled of this VmNic.  # noqa: E501
        :type enabled: bool
        """

        self._enabled = enabled

    @property
    def gateway(self):
        """Gets the gateway of this VmNic.  # noqa: E501


        :return: The gateway of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._gateway

    @gateway.setter
    def gateway(self, gateway):
        """Sets the gateway of this VmNic.


        :param gateway: The gateway of this VmNic.  # noqa: E501
        :type gateway: str
        """

        self._gateway = gateway

    @property
    def id(self):
        """Gets the id of this VmNic.  # noqa: E501


        :return: The id of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this VmNic.


        :param id: The id of this VmNic.  # noqa: E501
        :type id: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

    @property
    def ingress_rate_limit_burst_in_bit(self):
        """Gets the ingress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501


        :return: The ingress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501
        :rtype: float
        """
        return self._ingress_rate_limit_burst_in_bit

    @ingress_rate_limit_burst_in_bit.setter
    def ingress_rate_limit_burst_in_bit(self, ingress_rate_limit_burst_in_bit):
        """Sets the ingress_rate_limit_burst_in_bit of this VmNic.


        :param ingress_rate_limit_burst_in_bit: The ingress_rate_limit_burst_in_bit of this VmNic.  # noqa: E501
        :type ingress_rate_limit_burst_in_bit: float
        """

        self._ingress_rate_limit_burst_in_bit = ingress_rate_limit_burst_in_bit

    @property
    def ingress_rate_limit_enabled(self):
        """Gets the ingress_rate_limit_enabled of this VmNic.  # noqa: E501


        :return: The ingress_rate_limit_enabled of this VmNic.  # noqa: E501
        :rtype: bool
        """
        return self._ingress_rate_limit_enabled

    @ingress_rate_limit_enabled.setter
    def ingress_rate_limit_enabled(self, ingress_rate_limit_enabled):
        """Sets the ingress_rate_limit_enabled of this VmNic.


        :param ingress_rate_limit_enabled: The ingress_rate_limit_enabled of this VmNic.  # noqa: E501
        :type ingress_rate_limit_enabled: bool
        """

        self._ingress_rate_limit_enabled = ingress_rate_limit_enabled

    @property
    def ingress_rate_limit_max_rate_in_bitps(self):
        """Gets the ingress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501


        :return: The ingress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501
        :rtype: float
        """
        return self._ingress_rate_limit_max_rate_in_bitps

    @ingress_rate_limit_max_rate_in_bitps.setter
    def ingress_rate_limit_max_rate_in_bitps(self, ingress_rate_limit_max_rate_in_bitps):
        """Sets the ingress_rate_limit_max_rate_in_bitps of this VmNic.


        :param ingress_rate_limit_max_rate_in_bitps: The ingress_rate_limit_max_rate_in_bitps of this VmNic.  # noqa: E501
        :type ingress_rate_limit_max_rate_in_bitps: float
        """

        self._ingress_rate_limit_max_rate_in_bitps = ingress_rate_limit_max_rate_in_bitps

    @property
    def interface_id(self):
        """Gets the interface_id of this VmNic.  # noqa: E501


        :return: The interface_id of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._interface_id

    @interface_id.setter
    def interface_id(self, interface_id):
        """Sets the interface_id of this VmNic.


        :param interface_id: The interface_id of this VmNic.  # noqa: E501
        :type interface_id: str
        """

        self._interface_id = interface_id

    @property
    def ip_address(self):
        """Gets the ip_address of this VmNic.  # noqa: E501


        :return: The ip_address of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._ip_address

    @ip_address.setter
    def ip_address(self, ip_address):
        """Sets the ip_address of this VmNic.


        :param ip_address: The ip_address of this VmNic.  # noqa: E501
        :type ip_address: str
        """

        self._ip_address = ip_address

    @property
    def local_id(self):
        """Gets the local_id of this VmNic.  # noqa: E501


        :return: The local_id of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._local_id

    @local_id.setter
    def local_id(self, local_id):
        """Sets the local_id of this VmNic.


        :param local_id: The local_id of this VmNic.  # noqa: E501
        :type local_id: str
        """
        if self.local_vars_configuration.client_side_validation and local_id is None:  # noqa: E501
            raise ValueError("Invalid value for `local_id`, must not be `None`")  # noqa: E501

        self._local_id = local_id

    @property
    def mac_address(self):
        """Gets the mac_address of this VmNic.  # noqa: E501


        :return: The mac_address of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._mac_address

    @mac_address.setter
    def mac_address(self, mac_address):
        """Sets the mac_address of this VmNic.


        :param mac_address: The mac_address of this VmNic.  # noqa: E501
        :type mac_address: str
        """

        self._mac_address = mac_address

    @property
    def mirror(self):
        """Gets the mirror of this VmNic.  # noqa: E501


        :return: The mirror of this VmNic.  # noqa: E501
        :rtype: bool
        """
        return self._mirror

    @mirror.setter
    def mirror(self, mirror):
        """Sets the mirror of this VmNic.


        :param mirror: The mirror of this VmNic.  # noqa: E501
        :type mirror: bool
        """

        self._mirror = mirror

    @property
    def model(self):
        """Gets the model of this VmNic.  # noqa: E501


        :return: The model of this VmNic.  # noqa: E501
        :rtype: VmNicModel
        """
        return self._model

    @model.setter
    def model(self, model):
        """Sets the model of this VmNic.


        :param model: The model of this VmNic.  # noqa: E501
        :type model: VmNicModel
        """

        self._model = model

    @property
    def nic(self):
        """Gets the nic of this VmNic.  # noqa: E501


        :return: The nic of this VmNic.  # noqa: E501
        :rtype: NestedNic
        """
        return self._nic

    @nic.setter
    def nic(self, nic):
        """Sets the nic of this VmNic.


        :param nic: The nic of this VmNic.  # noqa: E501
        :type nic: NestedNic
        """

        self._nic = nic

    @property
    def order(self):
        """Gets the order of this VmNic.  # noqa: E501


        :return: The order of this VmNic.  # noqa: E501
        :rtype: int
        """
        return self._order

    @order.setter
    def order(self, order):
        """Sets the order of this VmNic.


        :param order: The order of this VmNic.  # noqa: E501
        :type order: int
        """

        self._order = order

    @property
    def subnet_mask(self):
        """Gets the subnet_mask of this VmNic.  # noqa: E501


        :return: The subnet_mask of this VmNic.  # noqa: E501
        :rtype: str
        """
        return self._subnet_mask

    @subnet_mask.setter
    def subnet_mask(self, subnet_mask):
        """Sets the subnet_mask of this VmNic.


        :param subnet_mask: The subnet_mask of this VmNic.  # noqa: E501
        :type subnet_mask: str
        """

        self._subnet_mask = subnet_mask

    @property
    def type(self):
        """Gets the type of this VmNic.  # noqa: E501


        :return: The type of this VmNic.  # noqa: E501
        :rtype: VmNicType
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this VmNic.


        :param type: The type of this VmNic.  # noqa: E501
        :type type: VmNicType
        """

        self._type = type

    @property
    def vlan(self):
        """Gets the vlan of this VmNic.  # noqa: E501


        :return: The vlan of this VmNic.  # noqa: E501
        :rtype: NestedVlan
        """
        return self._vlan

    @vlan.setter
    def vlan(self, vlan):
        """Sets the vlan of this VmNic.


        :param vlan: The vlan of this VmNic.  # noqa: E501
        :type vlan: NestedVlan
        """

        self._vlan = vlan

    @property
    def vm(self):
        """Gets the vm of this VmNic.  # noqa: E501


        :return: The vm of this VmNic.  # noqa: E501
        :rtype: NestedVm
        """
        return self._vm

    @vm.setter
    def vm(self, vm):
        """Sets the vm of this VmNic.


        :param vm: The vm of this VmNic.  # noqa: E501
        :type vm: NestedVm
        """
        if self.local_vars_configuration.client_side_validation and vm is None:  # noqa: E501
            raise ValueError("Invalid value for `vm`, must not be `None`")  # noqa: E501

        self._vm = vm

    def to_dict(self, serialize=False):
        """Returns the model properties as a dict"""
        result = {}

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, VmNic):
            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, VmNic):
            return True

        return self.to_dict() != other.to_dict()
