# coding: utf-8

"""
    Selling Partner API for Retail Procurement Shipments

    The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class Stop(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'function_code': 'str',
        'location_identification': 'Location',
        'arrival_time': 'datetime',
        'departure_time': 'datetime',
    }

    attribute_map = {
        'function_code': 'functionCode',
        'location_identification': 'locationIdentification',
        'arrival_time': 'arrivalTime',
        'departure_time': 'departureTime',
    }

    def __init__(self, function_code=None, location_identification=None, arrival_time=None, departure_time=None, _configuration=None):  # noqa: E501
        """Stop - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._function_code = None
        self._location_identification = None
        self._arrival_time = None
        self._departure_time = None
        self.discriminator = None

        self.function_code = function_code
        if location_identification is not None:
            self.location_identification = location_identification
        if arrival_time is not None:
            self.arrival_time = arrival_time
        if departure_time is not None:
            self.departure_time = departure_time

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

        Provide the function code.  # noqa: E501

        :return: The function_code of this Stop.  # noqa: E501
        :rtype: str
        """
        return self._function_code

    @function_code.setter
    def function_code(self, function_code):
        """Sets the function_code of this Stop.

        Provide the function code.  # noqa: E501

        :param function_code: The function_code of this Stop.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and function_code is None:
            raise ValueError("Invalid value for `function_code`, must not be `None`")  # noqa: E501
        allowed_values = ["PortOfDischarge", "FreightPayableAt", "PortOfLoading"]  # noqa: E501
        if (self._configuration.client_side_validation and
                function_code not in allowed_values):
            raise ValueError(
                "Invalid value for `function_code` ({0}), must be one of {1}"  # noqa: E501
                .format(function_code, allowed_values)
            )

        self._function_code = function_code

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


        :return: The location_identification of this Stop.  # noqa: E501
        :rtype: Location
        """
        return self._location_identification

    @location_identification.setter
    def location_identification(self, location_identification):
        """Sets the location_identification of this Stop.


        :param location_identification: The location_identification of this Stop.  # noqa: E501
        :type: Location
        """

        self._location_identification = location_identification

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

        Date and time of the arrival of the cargo.  # noqa: E501

        :return: The arrival_time of this Stop.  # noqa: E501
        :rtype: datetime
        """
        return self._arrival_time

    @arrival_time.setter
    def arrival_time(self, arrival_time):
        """Sets the arrival_time of this Stop.

        Date and time of the arrival of the cargo.  # noqa: E501

        :param arrival_time: The arrival_time of this Stop.  # noqa: E501
        :type: datetime
        """

        self._arrival_time = arrival_time

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

        Date and time of the departure of the cargo.  # noqa: E501

        :return: The departure_time of this Stop.  # noqa: E501
        :rtype: datetime
        """
        return self._departure_time

    @departure_time.setter
    def departure_time(self, departure_time):
        """Sets the departure_time of this Stop.

        Date and time of the departure of the cargo.  # noqa: E501

        :param departure_time: The departure_time of this Stop.  # noqa: E501
        :type: datetime
        """

        self._departure_time = departure_time

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(Stop, dict):
            for key, value in self.items():
                result[key] = 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, Stop):
            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, Stop):
            return True

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