# coding: utf-8

"""
    VeeRoute.UD

    VeeRoute.UD API  # noqa: E501

    The version of the OpenAPI document: 2.8.160628
    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 AdvancedLocation(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 = {
        'key': 'str',
        'location': 'Location',
        'transport_restrictions': 'list[str]',
        'load_windows': 'list[LoadWindow]'
    }

    attribute_map = {
        'key': 'key',
        'location': 'location',
        'transport_restrictions': 'transport_restrictions',
        'load_windows': 'load_windows'
    }

    def __init__(self, key=None, location=None, transport_restrictions=None, load_windows=None, local_vars_configuration=None):  # noqa: E501
        """AdvancedLocation - 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._key = None
        self._location = None
        self._transport_restrictions = None
        self._load_windows = None
        self.discriminator = None

        self.key = key
        self.location = location
        if transport_restrictions is not None:
            self.transport_restrictions = transport_restrictions
        if load_windows is not None:
            self.load_windows = load_windows

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

        Location key, unique ID.  # noqa: E501

        :return: The key of this AdvancedLocation.  # noqa: E501
        :rtype: str
        """
        return self._key

    @key.setter
    def key(self, key):
        """Sets the key of this AdvancedLocation.

        Location key, unique ID.  # noqa: E501

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

        self._key = key

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


        :return: The location of this AdvancedLocation.  # noqa: E501
        :rtype: Location
        """
        return self._location

    @location.setter
    def location(self, location):
        """Sets the location of this AdvancedLocation.


        :param location: The location of this AdvancedLocation.  # noqa: E501
        :type: Location
        """

        self._location = location

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

        List of requirements for vehicles that can arrive to this location.  # noqa: E501

        :return: The transport_restrictions of this AdvancedLocation.  # noqa: E501
        :rtype: list[str]
        """
        return self._transport_restrictions

    @transport_restrictions.setter
    def transport_restrictions(self, transport_restrictions):
        """Sets the transport_restrictions of this AdvancedLocation.

        List of requirements for vehicles that can arrive to this location.  # noqa: E501

        :param transport_restrictions: The transport_restrictions of this AdvancedLocation.  # noqa: E501
        :type: list[str]
        """

        self._transport_restrictions = transport_restrictions

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

        List of time windows for the location.  # noqa: E501

        :return: The load_windows of this AdvancedLocation.  # noqa: E501
        :rtype: list[LoadWindow]
        """
        return self._load_windows

    @load_windows.setter
    def load_windows(self, load_windows):
        """Sets the load_windows of this AdvancedLocation.

        List of time windows for the location.  # noqa: E501

        :param load_windows: The load_windows of this AdvancedLocation.  # noqa: E501
        :type: list[LoadWindow]
        """

        self._load_windows = load_windows

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

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