# coding: utf-8

"""
    VeeRoute.LSS Clustering

    VeeRoute.LSS Clustering API  # noqa: E501

    The version of the OpenAPI document: 3.2.160181
    Contact: support@veeroute.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from vrt_lss_clustering.configuration import Configuration


class ClusterSettings(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 = {
        'configuration': 'str',
        'calculation_time': 'int',
        'result_ttl': 'int',
        'transport_factor': 'list[TransportFactor]',
        'routing': 'list[Routing]',
        'assumptions': 'ClusterAssumptions',
        'precision': 'int',
        'limits': 'ClusterLimits'
    }

    attribute_map = {
        'configuration': 'configuration',
        'calculation_time': 'calculation_time',
        'result_ttl': 'result_ttl',
        'transport_factor': 'transport_factor',
        'routing': 'routing',
        'assumptions': 'assumptions',
        'precision': 'precision',
        'limits': 'limits'
    }

    def __init__(self, configuration='default', calculation_time=40, result_ttl=20, transport_factor=[], routing=[], assumptions=None, precision=3, limits=None, local_vars_configuration=None):  # noqa: E501
        """ClusterSettings - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._configuration = None
        self._calculation_time = None
        self._result_ttl = None
        self._transport_factor = None
        self._routing = None
        self._assumptions = None
        self._precision = None
        self._limits = None
        self.discriminator = None

        if configuration is not None:
            self.configuration = configuration
        if calculation_time is not None:
            self.calculation_time = calculation_time
        if result_ttl is not None:
            self.result_ttl = result_ttl
        if transport_factor is not None:
            self.transport_factor = transport_factor
        if routing is not None:
            self.routing = routing
        if assumptions is not None:
            self.assumptions = assumptions
        if precision is not None:
            self.precision = precision
        if limits is not None:
            self.limits = limits

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

        Clustering configuration name. The configuration determines the result goal and quality.   # noqa: E501

        :return: The configuration of this ClusterSettings.  # noqa: E501
        :rtype: str
        """
        return self._configuration

    @configuration.setter
    def configuration(self, configuration):
        """Sets the configuration of this ClusterSettings.

        Clustering configuration name. The configuration determines the result goal and quality.   # noqa: E501

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

        self._configuration = configuration

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

        Calculation time in minutes. The countdown starts from the moment when data is uploaded to the server and clustering starts.   # noqa: E501

        :return: The calculation_time of this ClusterSettings.  # noqa: E501
        :rtype: int
        """
        return self._calculation_time

    @calculation_time.setter
    def calculation_time(self, calculation_time):
        """Sets the calculation_time of this ClusterSettings.

        Calculation time in minutes. The countdown starts from the moment when data is uploaded to the server and clustering starts.   # noqa: E501

        :param calculation_time: The calculation_time of this ClusterSettings.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                calculation_time is not None and calculation_time > 2880):  # noqa: E501
            raise ValueError("Invalid value for `calculation_time`, must be a value less than or equal to `2880`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                calculation_time is not None and calculation_time < 1):  # noqa: E501
            raise ValueError("Invalid value for `calculation_time`, must be a value greater than or equal to `1`")  # noqa: E501

        self._calculation_time = calculation_time

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

        Clustering result lifetime, in minutes. The countdown starts from the moment when clustering is completed.   # noqa: E501

        :return: The result_ttl of this ClusterSettings.  # noqa: E501
        :rtype: int
        """
        return self._result_ttl

    @result_ttl.setter
    def result_ttl(self, result_ttl):
        """Sets the result_ttl of this ClusterSettings.

        Clustering result lifetime, in minutes. The countdown starts from the moment when clustering is completed.   # noqa: E501

        :param result_ttl: The result_ttl of this ClusterSettings.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                result_ttl is not None and result_ttl > 14400):  # noqa: E501
            raise ValueError("Invalid value for `result_ttl`, must be a value less than or equal to `14400`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                result_ttl is not None and result_ttl < 1):  # noqa: E501
            raise ValueError("Invalid value for `result_ttl`, must be a value greater than or equal to `1`")  # noqa: E501

        self._result_ttl = result_ttl

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

        Vehicle speed change coefficients.  # noqa: E501

        :return: The transport_factor of this ClusterSettings.  # noqa: E501
        :rtype: list[TransportFactor]
        """
        return self._transport_factor

    @transport_factor.setter
    def transport_factor(self, transport_factor):
        """Sets the transport_factor of this ClusterSettings.

        Vehicle speed change coefficients.  # noqa: E501

        :param transport_factor: The transport_factor of this ClusterSettings.  # noqa: E501
        :type: list[TransportFactor]
        """

        self._transport_factor = transport_factor

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

        Time and distance matrices list for each vehicle type. By specifying an external routing matrix, the `flight_distance`, `traffic_jams`, `transport_factor` parameters are not taken into account.   # noqa: E501

        :return: The routing of this ClusterSettings.  # noqa: E501
        :rtype: list[Routing]
        """
        return self._routing

    @routing.setter
    def routing(self, routing):
        """Sets the routing of this ClusterSettings.

        Time and distance matrices list for each vehicle type. By specifying an external routing matrix, the `flight_distance`, `traffic_jams`, `transport_factor` parameters are not taken into account.   # noqa: E501

        :param routing: The routing of this ClusterSettings.  # noqa: E501
        :type: list[Routing]
        """

        self._routing = routing

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


        :return: The assumptions of this ClusterSettings.  # noqa: E501
        :rtype: ClusterAssumptions
        """
        return self._assumptions

    @assumptions.setter
    def assumptions(self, assumptions):
        """Sets the assumptions of this ClusterSettings.


        :param assumptions: The assumptions of this ClusterSettings.  # noqa: E501
        :type: ClusterAssumptions
        """

        self._assumptions = assumptions

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

        Specifies the calculation accuracy in the decimal point sequence number. By default, 3, i.e. accuracy equals 0.001.   # noqa: E501

        :return: The precision of this ClusterSettings.  # noqa: E501
        :rtype: int
        """
        return self._precision

    @precision.setter
    def precision(self, precision):
        """Sets the precision of this ClusterSettings.

        Specifies the calculation accuracy in the decimal point sequence number. By default, 3, i.e. accuracy equals 0.001.   # noqa: E501

        :param precision: The precision of this ClusterSettings.  # noqa: E501
        :type: int
        """
        if (self.local_vars_configuration.client_side_validation and
                precision is not None and precision > 6):  # noqa: E501
            raise ValueError("Invalid value for `precision`, must be a value less than or equal to `6`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                precision is not None and precision < 0):  # noqa: E501
            raise ValueError("Invalid value for `precision`, must be a value greater than or equal to `0`")  # noqa: E501

        self._precision = precision

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


        :return: The limits of this ClusterSettings.  # noqa: E501
        :rtype: ClusterLimits
        """
        return self._limits

    @limits.setter
    def limits(self, limits):
        """Sets the limits of this ClusterSettings.


        :param limits: The limits of this ClusterSettings.  # noqa: E501
        :type: ClusterLimits
        """

        self._limits = limits

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

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