# coding: utf-8

"""
    The Selling Partner API for Amazon External Fulfillment Return Item Processing

    You can use the Amazon External Fulfillment Return Item Processing API to retrieve, track, and process return items through Amazon's External Fulfillment returns management system.

    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 ModelReturn(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 = {
        'id': 'str',
        'return_location_id': 'str',
        'merchant_sku': 'str',
        'return_type': 'str',
        'return_sub_type': 'str',
        'number_of_units': 'int',
        'status': 'str',
        'fulfillment_location_id': 'str',
        'creation_date_time': 'str',
        'last_updated_date_time': 'str',
        'return_metadata': 'ReturnMetadata',
        'return_shipping_info': 'ReturnShippingInfo',
        'marketplace_channel_details': 'MarketplaceChannelDetails',
        'otp_details': 'OtpDetails',
        'package_delivery_mode': 'str',
        'replanning_details': 'ReplanningDetails',
    }

    attribute_map = {
        'id': 'id',
        'return_location_id': 'returnLocationId',
        'merchant_sku': 'merchantSku',
        'return_type': 'returnType',
        'return_sub_type': 'returnSubType',
        'number_of_units': 'numberOfUnits',
        'status': 'status',
        'fulfillment_location_id': 'fulfillmentLocationId',
        'creation_date_time': 'creationDateTime',
        'last_updated_date_time': 'lastUpdatedDateTime',
        'return_metadata': 'returnMetadata',
        'return_shipping_info': 'returnShippingInfo',
        'marketplace_channel_details': 'marketplaceChannelDetails',
        'otp_details': 'otpDetails',
        'package_delivery_mode': 'packageDeliveryMode',
        'replanning_details': 'replanningDetails',
    }

    def __init__(self, id=None, return_location_id=None, merchant_sku=None, return_type=None, return_sub_type=None, number_of_units=None, status=None, fulfillment_location_id=None, creation_date_time=None, last_updated_date_time=None, return_metadata=None, return_shipping_info=None, marketplace_channel_details=None, otp_details=None, package_delivery_mode=None, replanning_details=None, _configuration=None):  # noqa: E501
        """ModelReturn - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._return_location_id = None
        self._merchant_sku = None
        self._return_type = None
        self._return_sub_type = None
        self._number_of_units = None
        self._status = None
        self._fulfillment_location_id = None
        self._creation_date_time = None
        self._last_updated_date_time = None
        self._return_metadata = None
        self._return_shipping_info = None
        self._marketplace_channel_details = None
        self._otp_details = None
        self._package_delivery_mode = None
        self._replanning_details = None
        self.discriminator = None

        self.id = id
        if return_location_id is not None:
            self.return_location_id = return_location_id
        if merchant_sku is not None:
            self.merchant_sku = merchant_sku
        self.return_type = return_type
        if return_sub_type is not None:
            self.return_sub_type = return_sub_type
        if number_of_units is not None:
            self.number_of_units = number_of_units
        self.status = status
        self.fulfillment_location_id = fulfillment_location_id
        if creation_date_time is not None:
            self.creation_date_time = creation_date_time
        self.last_updated_date_time = last_updated_date_time
        self.return_metadata = return_metadata
        self.return_shipping_info = return_shipping_info
        self.marketplace_channel_details = marketplace_channel_details
        if otp_details is not None:
            self.otp_details = otp_details
        if package_delivery_mode is not None:
            self.package_delivery_mode = package_delivery_mode
        if replanning_details is not None:
            self.replanning_details = replanning_details

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

        The return item's ID.  # noqa: E501

        :return: The id of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this ModelReturn.

        The return item's ID.  # noqa: E501

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

        self._id = id

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

        The SmartConnect identifier for where the return item was dropped for delivery.  # noqa: E501

        :return: The return_location_id of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._return_location_id

    @return_location_id.setter
    def return_location_id(self, return_location_id):
        """Sets the return_location_id of this ModelReturn.

        The SmartConnect identifier for where the return item was dropped for delivery.  # noqa: E501

        :param return_location_id: The return_location_id of this ModelReturn.  # noqa: E501
        :type: str
        """

        self._return_location_id = return_location_id

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

        The seller's identifier for the SKU.  # noqa: E501

        :return: The merchant_sku of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._merchant_sku

    @merchant_sku.setter
    def merchant_sku(self, merchant_sku):
        """Sets the merchant_sku of this ModelReturn.

        The seller's identifier for the SKU.  # noqa: E501

        :param merchant_sku: The merchant_sku of this ModelReturn.  # noqa: E501
        :type: str
        """

        self._merchant_sku = merchant_sku

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

        The type of return.  # noqa: E501

        :return: The return_type of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._return_type

    @return_type.setter
    def return_type(self, return_type):
        """Sets the return_type of this ModelReturn.

        The type of return.  # noqa: E501

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

        self._return_type = return_type

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

        The sub-type of return.  # noqa: E501

        :return: The return_sub_type of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._return_sub_type

    @return_sub_type.setter
    def return_sub_type(self, return_sub_type):
        """Sets the return_sub_type of this ModelReturn.

        The sub-type of return.  # noqa: E501

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

        self._return_sub_type = return_sub_type

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

        The total number of units in the return.  # noqa: E501

        :return: The number_of_units of this ModelReturn.  # 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 ModelReturn.

        The total number of units in the return.  # noqa: E501

        :param number_of_units: The number_of_units of this ModelReturn.  # noqa: E501
        :type: int
        """
        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 status(self):
        """Gets the status of this ModelReturn.  # noqa: E501

        The current status of the return.  # noqa: E501

        :return: The status of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this ModelReturn.

        The current status of the return.  # noqa: E501

        :param status: The status of this ModelReturn.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and status is None:
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
        allowed_values = ["CREATED", "CARRIER_NOTIFIED_TO_PICK_UP_FROM_CUSTOMER", "CARRIER_OUT_FOR_PICK_UP_FROM_CUSTOMER", "CUSTOMER_CANCELLED_PICK_UP", "CUSTOMER_RESCHEDULED_PICK_UP", "PICKED_FROM_CUSTOMER", "IN_TRANSIT", "OUT_FOR_DELIVERY", "DELIVERED", "REPLANNED", "CUSTOMER_DROPPED_OFF", "PARTIALLY_PROCESSED", "PROCESSED", "REJECTED", "CANCELLED"]  # noqa: E501
        if (self._configuration.client_side_validation and
                status not in allowed_values):
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"  # noqa: E501
                .format(status, allowed_values)
            )

        self._status = status

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

        The ID of the location that fulfilled the order.  # noqa: E501

        :return: The fulfillment_location_id of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._fulfillment_location_id

    @fulfillment_location_id.setter
    def fulfillment_location_id(self, fulfillment_location_id):
        """Sets the fulfillment_location_id of this ModelReturn.

        The ID of the location that fulfilled the order.  # noqa: E501

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

        self._fulfillment_location_id = fulfillment_location_id

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

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :return: The creation_date_time of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._creation_date_time

    @creation_date_time.setter
    def creation_date_time(self, creation_date_time):
        """Sets the creation_date_time of this ModelReturn.

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :param creation_date_time: The creation_date_time of this ModelReturn.  # noqa: E501
        :type: str
        """

        self._creation_date_time = creation_date_time

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

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

        :return: The last_updated_date_time of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._last_updated_date_time

    @last_updated_date_time.setter
    def last_updated_date_time(self, last_updated_date_time):
        """Sets the last_updated_date_time of this ModelReturn.

        A date and time in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.  # noqa: E501

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

        self._last_updated_date_time = last_updated_date_time

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


        :return: The return_metadata of this ModelReturn.  # noqa: E501
        :rtype: ReturnMetadata
        """
        return self._return_metadata

    @return_metadata.setter
    def return_metadata(self, return_metadata):
        """Sets the return_metadata of this ModelReturn.


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

        self._return_metadata = return_metadata

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


        :return: The return_shipping_info of this ModelReturn.  # noqa: E501
        :rtype: ReturnShippingInfo
        """
        return self._return_shipping_info

    @return_shipping_info.setter
    def return_shipping_info(self, return_shipping_info):
        """Sets the return_shipping_info of this ModelReturn.


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

        self._return_shipping_info = return_shipping_info

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


        :return: The marketplace_channel_details of this ModelReturn.  # noqa: E501
        :rtype: MarketplaceChannelDetails
        """
        return self._marketplace_channel_details

    @marketplace_channel_details.setter
    def marketplace_channel_details(self, marketplace_channel_details):
        """Sets the marketplace_channel_details of this ModelReturn.


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

        self._marketplace_channel_details = marketplace_channel_details

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


        :return: The otp_details of this ModelReturn.  # noqa: E501
        :rtype: OtpDetails
        """
        return self._otp_details

    @otp_details.setter
    def otp_details(self, otp_details):
        """Sets the otp_details of this ModelReturn.


        :param otp_details: The otp_details of this ModelReturn.  # noqa: E501
        :type: OtpDetails
        """

        self._otp_details = otp_details

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

        The package delivery mode. This indicates whether the return was delivered to the seller with or without a one-time password (OTP).  # noqa: E501

        :return: The package_delivery_mode of this ModelReturn.  # noqa: E501
        :rtype: str
        """
        return self._package_delivery_mode

    @package_delivery_mode.setter
    def package_delivery_mode(self, package_delivery_mode):
        """Sets the package_delivery_mode of this ModelReturn.

        The package delivery mode. This indicates whether the return was delivered to the seller with or without a one-time password (OTP).  # noqa: E501

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

        self._package_delivery_mode = package_delivery_mode

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


        :return: The replanning_details of this ModelReturn.  # noqa: E501
        :rtype: ReplanningDetails
        """
        return self._replanning_details

    @replanning_details.setter
    def replanning_details(self, replanning_details):
        """Sets the replanning_details of this ModelReturn.


        :param replanning_details: The replanning_details of this ModelReturn.  # noqa: E501
        :type: ReplanningDetails
        """

        self._replanning_details = replanning_details

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

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