# coding: utf-8

"""
    The Selling Partner API for Amazon External Fulfillment Shipments Processing

    You can use the External Fulfillment Shipments API to retrieve, manage, and track shipments processed through Amazon's external fulfillment network. Use this API to get shipment details, monitor status changes, and access fulfillment requirements.

    The version of the OpenAPI document: 2024-09-11
    Contact: marketplaceapitest@amazon.com
    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 ShipmentInfo(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 = {
        'shipment_type': 'str',
        'original_shipment_info': 'ReplacedShipmentInfo',
        'number_of_units': 'int',
        'priority': 'Priority',
        'buyer_order_id': 'str',
        'order_states_eligible_for_rejection': 'List[str]',
        'order_placed_timestamp': 'str',
        'processing_source': 'str',
    }

    attribute_map = {
        'shipment_type': 'shipmentType',
        'original_shipment_info': 'originalShipmentInfo',
        'number_of_units': 'numberOfUnits',
        'priority': 'priority',
        'buyer_order_id': 'buyerOrderId',
        'order_states_eligible_for_rejection': 'orderStatesEligibleForRejection',
        'order_placed_timestamp': 'orderPlacedTimestamp',
        'processing_source': 'processingSource',
    }

    def __init__(self, shipment_type=None, original_shipment_info=None, number_of_units=None, priority=None, buyer_order_id=None, order_states_eligible_for_rejection=None, order_placed_timestamp=None, processing_source=None, _configuration=None):  # noqa: E501
        """ShipmentInfo - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._shipment_type = None
        self._original_shipment_info = None
        self._number_of_units = None
        self._priority = None
        self._buyer_order_id = None
        self._order_states_eligible_for_rejection = None
        self._order_placed_timestamp = None
        self._processing_source = None
        self.discriminator = None

        self.shipment_type = shipment_type
        if original_shipment_info is not None:
            self.original_shipment_info = original_shipment_info
        self.number_of_units = number_of_units
        self.priority = priority
        self.buyer_order_id = buyer_order_id
        if order_states_eligible_for_rejection is not None:
            self.order_states_eligible_for_rejection = order_states_eligible_for_rejection
        if order_placed_timestamp is not None:
            self.order_placed_timestamp = order_placed_timestamp
        if processing_source is not None:
            self.processing_source = processing_source

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

        The type of shipment.  # noqa: E501

        :return: The shipment_type of this ShipmentInfo.  # noqa: E501
        :rtype: str
        """
        return self._shipment_type

    @shipment_type.setter
    def shipment_type(self, shipment_type):
        """Sets the shipment_type of this ShipmentInfo.

        The type of shipment.  # noqa: E501

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

        self._shipment_type = shipment_type

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


        :return: The original_shipment_info of this ShipmentInfo.  # noqa: E501
        :rtype: ReplacedShipmentInfo
        """
        return self._original_shipment_info

    @original_shipment_info.setter
    def original_shipment_info(self, original_shipment_info):
        """Sets the original_shipment_info of this ShipmentInfo.


        :param original_shipment_info: The original_shipment_info of this ShipmentInfo.  # noqa: E501
        :type: ReplacedShipmentInfo
        """

        self._original_shipment_info = original_shipment_info

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

        Total number of units in the shipment.  # noqa: E501

        :return: The number_of_units of this ShipmentInfo.  # noqa: E501
        :rtype: int
        """
        return self._number_of_units

    @number_of_units.setter
    def number_of_units(self, number_of_units):
        """Sets the number_of_units of this ShipmentInfo.

        Total number of units in the shipment.  # noqa: E501

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

        self._number_of_units = number_of_units

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


        :return: The priority of this ShipmentInfo.  # noqa: E501
        :rtype: Priority
        """
        return self._priority

    @priority.setter
    def priority(self, priority):
        """Sets the priority of this ShipmentInfo.


        :param priority: The priority of this ShipmentInfo.  # noqa: E501
        :type: Priority
        """
        if self._configuration.client_side_validation and priority is None:
            raise ValueError("Invalid value for `priority`, must not be `None`")  # noqa: E501

        self._priority = priority

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

        The buyer's order ID.  # noqa: E501

        :return: The buyer_order_id of this ShipmentInfo.  # noqa: E501
        :rtype: str
        """
        return self._buyer_order_id

    @buyer_order_id.setter
    def buyer_order_id(self, buyer_order_id):
        """Sets the buyer_order_id of this ShipmentInfo.

        The buyer's order ID.  # noqa: E501

        :param buyer_order_id: The buyer_order_id of this ShipmentInfo.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and buyer_order_id is None:
            raise ValueError("Invalid value for `buyer_order_id`, must not be `None`")  # noqa: E501

        self._buyer_order_id = buyer_order_id

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

        A list of order statuses for which the marketplace allows order rejection (seller cancellation). If the order has a status that does not belong to this list, then seller cancellation is not possible.  # noqa: E501

        :return: The order_states_eligible_for_rejection of this ShipmentInfo.  # noqa: E501
        :rtype: List[str]
        """
        return self._order_states_eligible_for_rejection

    @order_states_eligible_for_rejection.setter
    def order_states_eligible_for_rejection(self, order_states_eligible_for_rejection):
        """Sets the order_states_eligible_for_rejection of this ShipmentInfo.

        A list of order statuses for which the marketplace allows order rejection (seller cancellation). If the order has a status that does not belong to this list, then seller cancellation is not possible.  # noqa: E501

        :param order_states_eligible_for_rejection: The order_states_eligible_for_rejection of this ShipmentInfo.  # noqa: E501
        :type: List[str]
        """
        if (self._configuration.client_side_validation and
                order_states_eligible_for_rejection is not None and len(order_states_eligible_for_rejection) < 0):
            raise ValueError("Invalid value for `order_states_eligible_for_rejection`, number of items must be greater than or equal to `0`")  # noqa: E501

        self._order_states_eligible_for_rejection = order_states_eligible_for_rejection

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

        The timestamp of when the order was placed, in UTC  # noqa: E501

        :return: The order_placed_timestamp of this ShipmentInfo.  # noqa: E501
        :rtype: str
        """
        return self._order_placed_timestamp

    @order_placed_timestamp.setter
    def order_placed_timestamp(self, order_placed_timestamp):
        """Sets the order_placed_timestamp of this ShipmentInfo.

        The timestamp of when the order was placed, in UTC  # noqa: E501

        :param order_placed_timestamp: The order_placed_timestamp of this ShipmentInfo.  # noqa: E501
        :type: str
        """

        self._order_placed_timestamp = order_placed_timestamp

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

        The source of the order operation.  # noqa: E501

        :return: The processing_source of this ShipmentInfo.  # noqa: E501
        :rtype: str
        """
        return self._processing_source

    @processing_source.setter
    def processing_source(self, processing_source):
        """Sets the processing_source of this ShipmentInfo.

        The source of the order operation.  # noqa: E501

        :param processing_source: The processing_source of this ShipmentInfo.  # noqa: E501
        :type: str
        """
        allowed_values = ["EXTERNAL_PLATFORM", "INTERNAL_PLATFORM"]  # noqa: E501
        if (self._configuration.client_side_validation and
                processing_source not in allowed_values):
            raise ValueError(
                "Invalid value for `processing_source` ({0}), must be one of {1}"  # noqa: E501
                .format(processing_source, allowed_values)
            )

        self._processing_source = processing_source

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

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