# coding: utf-8

"""
    VeeRoute.LSS Lastmile

    VeeRoute.LSS Lastmile API  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from vrt_lss_lastmile.configuration import Configuration


class Shift(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',
        'shift_type': 'str',
        'resource_key': 'str',
        'availability_time': 'TimeWindow',
        'working_time': 'TimeWindow',
        'start_location_key': 'str',
        'finish_location_key': 'str',
        'tariff': 'UniversalTariff'
    }

    attribute_map = {
        'key': 'key',
        'shift_type': 'shift_type',
        'resource_key': 'resource_key',
        'availability_time': 'availability_time',
        'working_time': 'working_time',
        'start_location_key': 'start_location_key',
        'finish_location_key': 'finish_location_key',
        'tariff': 'tariff'
    }

    def __init__(self, key=None, shift_type=None, resource_key=None, availability_time=None, working_time=None, start_location_key=None, finish_location_key=None, tariff=None, local_vars_configuration=None):  # noqa: E501
        """Shift - 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._shift_type = None
        self._resource_key = None
        self._availability_time = None
        self._working_time = None
        self._start_location_key = None
        self._finish_location_key = None
        self._tariff = None
        self.discriminator = None

        self.key = key
        self.shift_type = shift_type
        self.resource_key = resource_key
        self.availability_time = availability_time
        self.working_time = working_time
        if start_location_key is not None:
            self.start_location_key = start_location_key
        if finish_location_key is not None:
            self.finish_location_key = finish_location_key
        if tariff is not None:
            self.tariff = tariff

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

        Shift key, unique ID.  # noqa: E501

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

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

        Shift key, unique ID.  # noqa: E501

        :param key: The key of this Shift.  # 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 shift_type(self):
        """Gets the shift_type of this Shift.  # noqa: E501

        Shift type that can be a performer (PERFORMER) or a vehicle (TRANSPORT).  # noqa: E501

        :return: The shift_type of this Shift.  # noqa: E501
        :rtype: str
        """
        return self._shift_type

    @shift_type.setter
    def shift_type(self, shift_type):
        """Sets the shift_type of this Shift.

        Shift type that can be a performer (PERFORMER) or a vehicle (TRANSPORT).  # noqa: E501

        :param shift_type: The shift_type of this Shift.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and shift_type is None:  # noqa: E501
            raise ValueError("Invalid value for `shift_type`, must not be `None`")  # noqa: E501
        allowed_values = ["PERFORMER", "TRANSPORT"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and shift_type not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `shift_type` ({0}), must be one of {1}"  # noqa: E501
                .format(shift_type, allowed_values)
            )

        self._shift_type = shift_type

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

        Resource key referenced by the shift.  # noqa: E501

        :return: The resource_key of this Shift.  # noqa: E501
        :rtype: str
        """
        return self._resource_key

    @resource_key.setter
    def resource_key(self, resource_key):
        """Sets the resource_key of this Shift.

        Resource key referenced by the shift.  # noqa: E501

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

        self._resource_key = resource_key

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


        :return: The availability_time of this Shift.  # noqa: E501
        :rtype: TimeWindow
        """
        return self._availability_time

    @availability_time.setter
    def availability_time(self, availability_time):
        """Sets the availability_time of this Shift.


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

        self._availability_time = availability_time

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


        :return: The working_time of this Shift.  # noqa: E501
        :rtype: TimeWindow
        """
        return self._working_time

    @working_time.setter
    def working_time(self, working_time):
        """Sets the working_time of this Shift.


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

        self._working_time = working_time

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

        Start location key. If not specified, the trip starts from the first order location.  # noqa: E501

        :return: The start_location_key of this Shift.  # noqa: E501
        :rtype: str
        """
        return self._start_location_key

    @start_location_key.setter
    def start_location_key(self, start_location_key):
        """Sets the start_location_key of this Shift.

        Start location key. If not specified, the trip starts from the first order location.  # noqa: E501

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

        self._start_location_key = start_location_key

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

        Finish location key. If not specified, the trip finishes on the last order location.  # noqa: E501

        :return: The finish_location_key of this Shift.  # noqa: E501
        :rtype: str
        """
        return self._finish_location_key

    @finish_location_key.setter
    def finish_location_key(self, finish_location_key):
        """Sets the finish_location_key of this Shift.

        Finish location key. If not specified, the trip finishes on the last order location.  # noqa: E501

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

        self._finish_location_key = finish_location_key

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


        :return: The tariff of this Shift.  # noqa: E501
        :rtype: UniversalTariff
        """
        return self._tariff

    @tariff.setter
    def tariff(self, tariff):
        """Sets the tariff of this Shift.


        :param tariff: The tariff of this Shift.  # noqa: E501
        :type: UniversalTariff
        """

        self._tariff = tariff

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

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