# coding: utf-8

"""
    VeeRoute.UD

    VeeRoute.UD API  # noqa: E501

    The version of the OpenAPI document: 2.8.161005
    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 TripAction(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 = {
        'order_key': 'str',
        'demand_key': 'str',
        'location_key': 'str',
        'todolist': 'list[TripJob]',
        'cargo_placements': 'list[CargoPlacement]'
    }

    attribute_map = {
        'order_key': 'order_key',
        'demand_key': 'demand_key',
        'location_key': 'location_key',
        'todolist': 'todolist',
        'cargo_placements': 'cargo_placements'
    }

    def __init__(self, order_key=None, demand_key=None, location_key=None, todolist=None, cargo_placements=None, local_vars_configuration=None):  # noqa: E501
        """TripAction - 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._order_key = None
        self._demand_key = None
        self._location_key = None
        self._todolist = None
        self._cargo_placements = None
        self.discriminator = None

        self.order_key = order_key
        self.demand_key = demand_key
        self.location_key = location_key
        self.todolist = todolist
        if cargo_placements is not None:
            self.cargo_placements = cargo_placements

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

        Key of the order with which an action is taken.  # noqa: E501

        :return: The order_key of this TripAction.  # noqa: E501
        :rtype: str
        """
        return self._order_key

    @order_key.setter
    def order_key(self, order_key):
        """Sets the order_key of this TripAction.

        Key of the order with which an action is taken.  # noqa: E501

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

        self._order_key = order_key

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

        Key of the demand with which an action is taken.  # noqa: E501

        :return: The demand_key of this TripAction.  # noqa: E501
        :rtype: str
        """
        return self._demand_key

    @demand_key.setter
    def demand_key(self, demand_key):
        """Sets the demand_key of this TripAction.

        Key of the demand with which an action is taken.  # noqa: E501

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

        self._demand_key = demand_key

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

        Key of the location at which an action is taken.  # noqa: E501

        :return: The location_key of this TripAction.  # noqa: E501
        :rtype: str
        """
        return self._location_key

    @location_key.setter
    def location_key(self, location_key):
        """Sets the location_key of this TripAction.

        Key of the location at which an action is taken.  # noqa: E501

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

        self._location_key = location_key

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

        Works list, each is performed inside the 'job_time' time window.  # noqa: E501

        :return: The todolist of this TripAction.  # noqa: E501
        :rtype: list[TripJob]
        """
        return self._todolist

    @todolist.setter
    def todolist(self, todolist):
        """Sets the todolist of this TripAction.

        Works list, each is performed inside the 'job_time' time window.  # noqa: E501

        :param todolist: The todolist of this TripAction.  # noqa: E501
        :type: list[TripJob]
        """
        if self.local_vars_configuration.client_side_validation and todolist is None:  # noqa: E501
            raise ValueError("Invalid value for `todolist`, must not be `None`")  # noqa: E501

        self._todolist = todolist

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

        Cargo placements list.  # noqa: E501

        :return: The cargo_placements of this TripAction.  # noqa: E501
        :rtype: list[CargoPlacement]
        """
        return self._cargo_placements

    @cargo_placements.setter
    def cargo_placements(self, cargo_placements):
        """Sets the cargo_placements of this TripAction.

        Cargo placements list.  # noqa: E501

        :param cargo_placements: The cargo_placements of this TripAction.  # noqa: E501
        :type: list[CargoPlacement]
        """

        self._cargo_placements = cargo_placements

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

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