# coding: utf-8

"""
    VNS3 Controller API

    Cohesive networks VNS3 API providing complete control of your network's addresses, routes, rules and edge  # noqa: E501

    The version of the OpenAPI document: 4.8
    Contact: solutions@cohesive.net
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class IpsecTunnel(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 = {
        "id": "int",
        "local_subnet": "str",
        "remote_subnet": "str",
        "endpoint_id": "int",
        "endpoint_name": "str",
        "active": "bool",
        "description": "str",
        "connected": "bool",
        "ping_interface": "str",
        "ping_interval": "int",
        "ping_ipaddress": "str",
        "tunnel_params": "IpsecTunnelParams",
    }

    attribute_map = {
        "id": "id",
        "local_subnet": "local_subnet",
        "remote_subnet": "remote_subnet",
        "endpoint_id": "endpoint_id",
        "endpoint_name": "endpoint_name",
        "active": "active",
        "description": "description",
        "connected": "connected",
        "ping_interface": "ping_interface",
        "ping_interval": "ping_interval",
        "ping_ipaddress": "ping_ipaddress",
        "tunnel_params": "tunnel_params",
    }

    def __init__(
        self,
        id=None,
        local_subnet=None,
        remote_subnet=None,
        endpoint_id=None,
        endpoint_name=None,
        active=None,
        description=None,
        connected=None,
        ping_interface=None,
        ping_interval=None,
        ping_ipaddress=None,
        tunnel_params=None,
    ):  # noqa: E501
        """IpsecTunnel - a model defined in OpenAPI"""  # noqa: E501

        self._id = None
        self._local_subnet = None
        self._remote_subnet = None
        self._endpoint_id = None
        self._endpoint_name = None
        self._active = None
        self._description = None
        self._connected = None
        self._ping_interface = None
        self._ping_interval = None
        self._ping_ipaddress = None
        self._tunnel_params = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if local_subnet is not None:
            self.local_subnet = local_subnet
        if remote_subnet is not None:
            self.remote_subnet = remote_subnet
        if endpoint_id is not None:
            self.endpoint_id = endpoint_id
        if endpoint_name is not None:
            self.endpoint_name = endpoint_name
        if active is not None:
            self.active = active
        if description is not None:
            self.description = description
        if connected is not None:
            self.connected = connected
        if ping_interface is not None:
            self.ping_interface = ping_interface
        if ping_interval is not None:
            self.ping_interval = ping_interval
        if ping_ipaddress is not None:
            self.ping_ipaddress = ping_ipaddress
        if tunnel_params is not None:
            self.tunnel_params = tunnel_params

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


        :return: The id of this IpsecTunnel.  # noqa: E501
        :rtype: int
        """
        return self._id

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


        :param id: The id of this IpsecTunnel.  # noqa: E501
        :type: int
        """

        self._id = id

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


        :return: The local_subnet of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._local_subnet

    @local_subnet.setter
    def local_subnet(self, local_subnet):
        """Sets the local_subnet of this IpsecTunnel.


        :param local_subnet: The local_subnet of this IpsecTunnel.  # noqa: E501
        :type: str
        """

        self._local_subnet = local_subnet

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


        :return: The remote_subnet of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._remote_subnet

    @remote_subnet.setter
    def remote_subnet(self, remote_subnet):
        """Sets the remote_subnet of this IpsecTunnel.


        :param remote_subnet: The remote_subnet of this IpsecTunnel.  # noqa: E501
        :type: str
        """

        self._remote_subnet = remote_subnet

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


        :return: The endpoint_id of this IpsecTunnel.  # noqa: E501
        :rtype: int
        """
        return self._endpoint_id

    @endpoint_id.setter
    def endpoint_id(self, endpoint_id):
        """Sets the endpoint_id of this IpsecTunnel.


        :param endpoint_id: The endpoint_id of this IpsecTunnel.  # noqa: E501
        :type: int
        """

        self._endpoint_id = endpoint_id

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


        :return: The endpoint_name of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._endpoint_name

    @endpoint_name.setter
    def endpoint_name(self, endpoint_name):
        """Sets the endpoint_name of this IpsecTunnel.


        :param endpoint_name: The endpoint_name of this IpsecTunnel.  # noqa: E501
        :type: str
        """

        self._endpoint_name = endpoint_name

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


        :return: The active of this IpsecTunnel.  # noqa: E501
        :rtype: bool
        """
        return self._active

    @active.setter
    def active(self, active):
        """Sets the active of this IpsecTunnel.


        :param active: The active of this IpsecTunnel.  # noqa: E501
        :type: bool
        """

        self._active = active

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


        :return: The description of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this IpsecTunnel.


        :param description: The description of this IpsecTunnel.  # noqa: E501
        :type: str
        """

        self._description = description

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


        :return: The connected of this IpsecTunnel.  # noqa: E501
        :rtype: bool
        """
        return self._connected

    @connected.setter
    def connected(self, connected):
        """Sets the connected of this IpsecTunnel.


        :param connected: The connected of this IpsecTunnel.  # noqa: E501
        :type: bool
        """

        self._connected = connected

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


        :return: The ping_interface of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._ping_interface

    @ping_interface.setter
    def ping_interface(self, ping_interface):
        """Sets the ping_interface of this IpsecTunnel.


        :param ping_interface: The ping_interface of this IpsecTunnel.  # noqa: E501
        :type: str
        """
        allowed_values = ["eth0", "tun0"]  # noqa: E501
        if ping_interface not in allowed_values:
            raise ValueError(
                "Invalid value for `ping_interface` ({0}), must be one of {1}".format(  # noqa: E501
                    ping_interface, allowed_values
                )
            )

        self._ping_interface = ping_interface

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

        Interval for ping in seconds  # noqa: E501

        :return: The ping_interval of this IpsecTunnel.  # noqa: E501
        :rtype: int
        """
        return self._ping_interval

    @ping_interval.setter
    def ping_interval(self, ping_interval):
        """Sets the ping_interval of this IpsecTunnel.

        Interval for ping in seconds  # noqa: E501

        :param ping_interval: The ping_interval of this IpsecTunnel.  # noqa: E501
        :type: int
        """

        self._ping_interval = ping_interval

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


        :return: The ping_ipaddress of this IpsecTunnel.  # noqa: E501
        :rtype: str
        """
        return self._ping_ipaddress

    @ping_ipaddress.setter
    def ping_ipaddress(self, ping_ipaddress):
        """Sets the ping_ipaddress of this IpsecTunnel.


        :param ping_ipaddress: The ping_ipaddress of this IpsecTunnel.  # noqa: E501
        :type: str
        """

        self._ping_ipaddress = ping_ipaddress

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


        :return: The tunnel_params of this IpsecTunnel.  # noqa: E501
        :rtype: IpsecTunnelParams
        """
        return self._tunnel_params

    @tunnel_params.setter
    def tunnel_params(self, tunnel_params):
        """Sets the tunnel_params of this IpsecTunnel.


        :param tunnel_params: The tunnel_params of this IpsecTunnel.  # noqa: E501
        :type: IpsecTunnelParams
        """

        self._tunnel_params = tunnel_params

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

        return self.__dict__ == other.__dict__

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