# coding: utf-8

"""
    DeviceServer

    DeviceServer API  # noqa: E501

    The version of the OpenAPI document: 1.0.7
    Contact: david@3adesign.co.uk
    Generated by: https://openapi-generator.tech
"""


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

from DeviceServer.configuration import Configuration


class HostConfig(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 = {
        'host_name': 'str',
        'ip_address': 'str',
        'net_mask': 'str',
        'gateway': 'str',
        'static': 'bool'
    }

    attribute_map = {
        'host_name': 'HostName',
        'ip_address': 'IpAddress',
        'net_mask': 'NetMask',
        'gateway': 'Gateway',
        'static': 'Static'
    }

    def __init__(self, host_name=None, ip_address=None, net_mask=None, gateway=None, static=None, local_vars_configuration=None):  # noqa: E501
        """HostConfig - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._host_name = None
        self._ip_address = None
        self._net_mask = None
        self._gateway = None
        self._static = None
        self.discriminator = None

        self.host_name = host_name
        self.ip_address = ip_address
        self.net_mask = net_mask
        self.gateway = gateway
        self.static = static

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


        :return: The host_name of this HostConfig.  # noqa: E501
        :rtype: str
        """
        return self._host_name

    @host_name.setter
    def host_name(self, host_name):
        """Sets the host_name of this HostConfig.


        :param host_name: The host_name of this HostConfig.  # noqa: E501
        :type host_name: str
        """
        if self.local_vars_configuration.client_side_validation and host_name is None:  # noqa: E501
            raise ValueError("Invalid value for `host_name`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                host_name is not None and len(host_name) > 100):
            raise ValueError("Invalid value for `host_name`, length must be less than or equal to `100`")  # noqa: E501

        self._host_name = host_name

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


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

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


        :param ip_address: The ip_address of this HostConfig.  # noqa: E501
        :type ip_address: str
        """
        if self.local_vars_configuration.client_side_validation and ip_address is None:  # noqa: E501
            raise ValueError("Invalid value for `ip_address`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                ip_address is not None and len(ip_address) > 100):
            raise ValueError("Invalid value for `ip_address`, length must be less than or equal to `100`")  # noqa: E501

        self._ip_address = ip_address

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


        :return: The net_mask of this HostConfig.  # noqa: E501
        :rtype: str
        """
        return self._net_mask

    @net_mask.setter
    def net_mask(self, net_mask):
        """Sets the net_mask of this HostConfig.


        :param net_mask: The net_mask of this HostConfig.  # noqa: E501
        :type net_mask: str
        """
        if self.local_vars_configuration.client_side_validation and net_mask is None:  # noqa: E501
            raise ValueError("Invalid value for `net_mask`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                net_mask is not None and len(net_mask) > 100):
            raise ValueError("Invalid value for `net_mask`, length must be less than or equal to `100`")  # noqa: E501

        self._net_mask = net_mask

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


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

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


        :param gateway: The gateway of this HostConfig.  # noqa: E501
        :type gateway: str
        """
        if self.local_vars_configuration.client_side_validation and gateway is None:  # noqa: E501
            raise ValueError("Invalid value for `gateway`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                gateway is not None and len(gateway) > 100):
            raise ValueError("Invalid value for `gateway`, length must be less than or equal to `100`")  # noqa: E501

        self._gateway = gateway

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


        :return: The static of this HostConfig.  # noqa: E501
        :rtype: bool
        """
        return self._static

    @static.setter
    def static(self, static):
        """Sets the static of this HostConfig.


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

        self._static = static

    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, HostConfig):
            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, HostConfig):
            return True

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