# coding: utf-8

"""
    VeeRoute Urban Delivery API

    Программный интерфейс продукта Urban Delivery  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from vrt_ud.configuration import Configuration


class Location(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 = {
        'latitude': 'float',
        'longitude': 'float',
        'arrival_duration': 'int',
        'departure_duration': 'int'
    }

    attribute_map = {
        'latitude': 'latitude',
        'longitude': 'longitude',
        'arrival_duration': 'arrival_duration',
        'departure_duration': 'departure_duration'
    }

    def __init__(self, latitude=None, longitude=None, arrival_duration=0, departure_duration=0, local_vars_configuration=None):  # noqa: E501
        """Location - 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._latitude = None
        self._longitude = None
        self._arrival_duration = None
        self._departure_duration = None
        self.discriminator = None

        self.latitude = latitude
        self.longitude = longitude
        if arrival_duration is not None:
            self.arrival_duration = arrival_duration
        if departure_duration is not None:
            self.departure_duration = departure_duration

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

        Широта в градусах  # noqa: E501

        :return: The latitude of this Location.  # noqa: E501
        :rtype: float
        """
        return self._latitude

    @latitude.setter
    def latitude(self, latitude):
        """Sets the latitude of this Location.

        Широта в градусах  # noqa: E501

        :param latitude: The latitude of this Location.  # noqa: E501
        :type: float
        """
        if self.local_vars_configuration.client_side_validation and latitude is None:  # noqa: E501
            raise ValueError("Invalid value for `latitude`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                latitude is not None and latitude > 90):  # noqa: E501
            raise ValueError("Invalid value for `latitude`, must be a value less than or equal to `90`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                latitude is not None and latitude < -90):  # noqa: E501
            raise ValueError("Invalid value for `latitude`, must be a value greater than or equal to `-90`")  # noqa: E501

        self._latitude = latitude

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

        Долгота в градусах  # noqa: E501

        :return: The longitude of this Location.  # noqa: E501
        :rtype: float
        """
        return self._longitude

    @longitude.setter
    def longitude(self, longitude):
        """Sets the longitude of this Location.

        Долгота в градусах  # noqa: E501

        :param longitude: The longitude of this Location.  # noqa: E501
        :type: float
        """
        if self.local_vars_configuration.client_side_validation and longitude is None:  # noqa: E501
            raise ValueError("Invalid value for `longitude`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                longitude is not None and longitude > 180):  # noqa: E501
            raise ValueError("Invalid value for `longitude`, must be a value less than or equal to `180`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                longitude is not None and longitude < -180):  # noqa: E501
            raise ValueError("Invalid value for `longitude`, must be a value greater than or equal to `-180`")  # noqa: E501

        self._longitude = longitude

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

        Время на подъезд (парковку) на локации в минутах  # noqa: E501

        :return: The arrival_duration of this Location.  # noqa: E501
        :rtype: int
        """
        return self._arrival_duration

    @arrival_duration.setter
    def arrival_duration(self, arrival_duration):
        """Sets the arrival_duration of this Location.

        Время на подъезд (парковку) на локации в минутах  # noqa: E501

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

        self._arrival_duration = arrival_duration

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

        Время на отъезд от локации в минутах  # noqa: E501

        :return: The departure_duration of this Location.  # noqa: E501
        :rtype: int
        """
        return self._departure_duration

    @departure_duration.setter
    def departure_duration(self, departure_duration):
        """Sets the departure_duration of this Location.

        Время на отъезд от локации в минутах  # noqa: E501

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

        self._departure_duration = departure_duration

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

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