# 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 PredictorInsertTask(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': 'Order',
        'locations': 'list[AdvancedLocation]',
        'max_cost': 'int',
        'allow_to_update_order': 'bool'
    }

    attribute_map = {
        'order': 'order',
        'locations': 'locations',
        'max_cost': 'max_cost',
        'allow_to_update_order': 'allow_to_update_order'
    }

    def __init__(self, order=None, locations=None, max_cost=None, allow_to_update_order=False, local_vars_configuration=None):  # noqa: E501
        """PredictorInsertTask - 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 = None
        self._locations = None
        self._max_cost = None
        self._allow_to_update_order = None
        self.discriminator = None

        self.order = order
        self.locations = locations
        self.max_cost = max_cost
        if allow_to_update_order is not None:
            self.allow_to_update_order = allow_to_update_order

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


        :return: The order of this PredictorInsertTask.  # noqa: E501
        :rtype: Order
        """
        return self._order

    @order.setter
    def order(self, order):
        """Sets the order of this PredictorInsertTask.


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

        self._order = order

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

        List of locations used in the order for window prediction.  # noqa: E501

        :return: The locations of this PredictorInsertTask.  # noqa: E501
        :rtype: list[AdvancedLocation]
        """
        return self._locations

    @locations.setter
    def locations(self, locations):
        """Sets the locations of this PredictorInsertTask.

        List of locations used in the order for window prediction.  # noqa: E501

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

        self._locations = locations

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

        The maximum cost for which it is possible to insert an order.  # noqa: E501

        :return: The max_cost of this PredictorInsertTask.  # noqa: E501
        :rtype: int
        """
        return self._max_cost

    @max_cost.setter
    def max_cost(self, max_cost):
        """Sets the max_cost of this PredictorInsertTask.

        The maximum cost for which it is possible to insert an order.  # noqa: E501

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

        self._max_cost = max_cost

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

        This parameter allows updating the existing order with the specified ID.  # noqa: E501

        :return: The allow_to_update_order of this PredictorInsertTask.  # noqa: E501
        :rtype: bool
        """
        return self._allow_to_update_order

    @allow_to_update_order.setter
    def allow_to_update_order(self, allow_to_update_order):
        """Sets the allow_to_update_order of this PredictorInsertTask.

        This parameter allows updating the existing order with the specified ID.  # noqa: E501

        :param allow_to_update_order: The allow_to_update_order of this PredictorInsertTask.  # noqa: E501
        :type: bool
        """

        self._allow_to_update_order = allow_to_update_order

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

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