# coding: utf-8

"""
    Selling Partner API for Retail Procurement Orders

    The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.

    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 OrderItemAcknowledgement(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 = {
        'acknowledgement_code': 'str',
        'acknowledged_quantity': 'ItemQuantity',
        'scheduled_ship_date': 'datetime',
        'scheduled_delivery_date': 'datetime',
        'rejection_reason': 'str',
    }

    attribute_map = {
        'acknowledgement_code': 'acknowledgementCode',
        'acknowledged_quantity': 'acknowledgedQuantity',
        'scheduled_ship_date': 'scheduledShipDate',
        'scheduled_delivery_date': 'scheduledDeliveryDate',
        'rejection_reason': 'rejectionReason',
    }

    def __init__(self, acknowledgement_code=None, acknowledged_quantity=None, scheduled_ship_date=None, scheduled_delivery_date=None, rejection_reason=None, _configuration=None):  # noqa: E501
        """OrderItemAcknowledgement - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._acknowledgement_code = None
        self._acknowledged_quantity = None
        self._scheduled_ship_date = None
        self._scheduled_delivery_date = None
        self._rejection_reason = None
        self.discriminator = None

        self.acknowledgement_code = acknowledgement_code
        self.acknowledged_quantity = acknowledged_quantity
        if scheduled_ship_date is not None:
            self.scheduled_ship_date = scheduled_ship_date
        if scheduled_delivery_date is not None:
            self.scheduled_delivery_date = scheduled_delivery_date
        if rejection_reason is not None:
            self.rejection_reason = rejection_reason

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

        This indicates the acknowledgement code.  # noqa: E501

        :return: The acknowledgement_code of this OrderItemAcknowledgement.  # noqa: E501
        :rtype: str
        """
        return self._acknowledgement_code

    @acknowledgement_code.setter
    def acknowledgement_code(self, acknowledgement_code):
        """Sets the acknowledgement_code of this OrderItemAcknowledgement.

        This indicates the acknowledgement code.  # noqa: E501

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

        self._acknowledgement_code = acknowledgement_code

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


        :return: The acknowledged_quantity of this OrderItemAcknowledgement.  # noqa: E501
        :rtype: ItemQuantity
        """
        return self._acknowledged_quantity

    @acknowledged_quantity.setter
    def acknowledged_quantity(self, acknowledged_quantity):
        """Sets the acknowledged_quantity of this OrderItemAcknowledgement.


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

        self._acknowledged_quantity = acknowledged_quantity

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

        Estimated ship date per line item. Must be in ISO-8601 date/time format.  # noqa: E501

        :return: The scheduled_ship_date of this OrderItemAcknowledgement.  # noqa: E501
        :rtype: datetime
        """
        return self._scheduled_ship_date

    @scheduled_ship_date.setter
    def scheduled_ship_date(self, scheduled_ship_date):
        """Sets the scheduled_ship_date of this OrderItemAcknowledgement.

        Estimated ship date per line item. Must be in ISO-8601 date/time format.  # noqa: E501

        :param scheduled_ship_date: The scheduled_ship_date of this OrderItemAcknowledgement.  # noqa: E501
        :type: datetime
        """

        self._scheduled_ship_date = scheduled_ship_date

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

        Estimated delivery date per line item. Must be in ISO-8601 date/time format.  # noqa: E501

        :return: The scheduled_delivery_date of this OrderItemAcknowledgement.  # noqa: E501
        :rtype: datetime
        """
        return self._scheduled_delivery_date

    @scheduled_delivery_date.setter
    def scheduled_delivery_date(self, scheduled_delivery_date):
        """Sets the scheduled_delivery_date of this OrderItemAcknowledgement.

        Estimated delivery date per line item. Must be in ISO-8601 date/time format.  # noqa: E501

        :param scheduled_delivery_date: The scheduled_delivery_date of this OrderItemAcknowledgement.  # noqa: E501
        :type: datetime
        """

        self._scheduled_delivery_date = scheduled_delivery_date

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

        Indicates the reason for rejection.  # noqa: E501

        :return: The rejection_reason of this OrderItemAcknowledgement.  # noqa: E501
        :rtype: str
        """
        return self._rejection_reason

    @rejection_reason.setter
    def rejection_reason(self, rejection_reason):
        """Sets the rejection_reason of this OrderItemAcknowledgement.

        Indicates the reason for rejection.  # noqa: E501

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

        self._rejection_reason = rejection_reason

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

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