# coding: utf-8

"""
    Selling Partner API for FBA Inbound Eligibilty

    With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon's fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon's fulfillment centers.

    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 ItemEligibilityPreview(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 = {
        'asin': 'str',
        'marketplace_id': 'str',
        'program': 'str',
        'is_eligible_for_program': 'bool',
        'ineligibility_reason_list': 'List[str]',
    }

    attribute_map = {
        'asin': 'asin',
        'marketplace_id': 'marketplaceId',
        'program': 'program',
        'is_eligible_for_program': 'isEligibleForProgram',
        'ineligibility_reason_list': 'ineligibilityReasonList',
    }

    def __init__(self, asin=None, marketplace_id=None, program=None, is_eligible_for_program=None, ineligibility_reason_list=None, _configuration=None):  # noqa: E501
        """ItemEligibilityPreview - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._asin = None
        self._marketplace_id = None
        self._program = None
        self._is_eligible_for_program = None
        self._ineligibility_reason_list = None
        self.discriminator = None

        self.asin = asin
        if marketplace_id is not None:
            self.marketplace_id = marketplace_id
        self.program = program
        self.is_eligible_for_program = is_eligible_for_program
        if ineligibility_reason_list is not None:
            self.ineligibility_reason_list = ineligibility_reason_list

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

        The ASIN for which eligibility was determined.  # noqa: E501

        :return: The asin of this ItemEligibilityPreview.  # noqa: E501
        :rtype: str
        """
        return self._asin

    @asin.setter
    def asin(self, asin):
        """Sets the asin of this ItemEligibilityPreview.

        The ASIN for which eligibility was determined.  # noqa: E501

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

        self._asin = asin

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

        The marketplace for which eligibility was determined.  # noqa: E501

        :return: The marketplace_id of this ItemEligibilityPreview.  # noqa: E501
        :rtype: str
        """
        return self._marketplace_id

    @marketplace_id.setter
    def marketplace_id(self, marketplace_id):
        """Sets the marketplace_id of this ItemEligibilityPreview.

        The marketplace for which eligibility was determined.  # noqa: E501

        :param marketplace_id: The marketplace_id of this ItemEligibilityPreview.  # noqa: E501
        :type: str
        """

        self._marketplace_id = marketplace_id

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

        The program for which eligibility was determined.  # noqa: E501

        :return: The program of this ItemEligibilityPreview.  # noqa: E501
        :rtype: str
        """
        return self._program

    @program.setter
    def program(self, program):
        """Sets the program of this ItemEligibilityPreview.

        The program for which eligibility was determined.  # noqa: E501

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

        self._program = program

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

        Indicates if the item is eligible for the program.  # noqa: E501

        :return: The is_eligible_for_program of this ItemEligibilityPreview.  # noqa: E501
        :rtype: bool
        """
        return self._is_eligible_for_program

    @is_eligible_for_program.setter
    def is_eligible_for_program(self, is_eligible_for_program):
        """Sets the is_eligible_for_program of this ItemEligibilityPreview.

        Indicates if the item is eligible for the program.  # noqa: E501

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

        self._is_eligible_for_program = is_eligible_for_program

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

        Potential Ineligibility Reason Codes.  # noqa: E501

        :return: The ineligibility_reason_list of this ItemEligibilityPreview.  # noqa: E501
        :rtype: List[str]
        """
        return self._ineligibility_reason_list

    @ineligibility_reason_list.setter
    def ineligibility_reason_list(self, ineligibility_reason_list):
        """Sets the ineligibility_reason_list of this ItemEligibilityPreview.

        Potential Ineligibility Reason Codes.  # noqa: E501

        :param ineligibility_reason_list: The ineligibility_reason_list of this ItemEligibilityPreview.  # noqa: E501
        :type: List[str]
        """
        allowed_values = ["FBA_INB_0004", "FBA_INB_0006", "FBA_INB_0007", "FBA_INB_0008", "FBA_INB_0009", "FBA_INB_0010", "FBA_INB_0011", "FBA_INB_0012", "FBA_INB_0013", "FBA_INB_0014", "FBA_INB_0015", "FBA_INB_0016", "FBA_INB_0017", "FBA_INB_0018", "FBA_INB_0019", "FBA_INB_0034", "FBA_INB_0035", "FBA_INB_0036", "FBA_INB_0037", "FBA_INB_0038", "FBA_INB_0050", "FBA_INB_0051", "FBA_INB_0053", "FBA_INB_0055", "FBA_INB_0056", "FBA_INB_0059", "FBA_INB_0065", "FBA_INB_0066", "FBA_INB_0067", "FBA_INB_0068", "FBA_INB_0095", "FBA_INB_0097", "FBA_INB_0098", "FBA_INB_0099", "FBA_INB_0100", "FBA_INB_0103", "FBA_INB_0104", "FBA_INB_0197", "UNKNOWN_INB_ERROR_CODE"]  # noqa: E501
        if (self._configuration.client_side_validation and
                not set(ineligibility_reason_list).issubset(set(allowed_values))):  # noqa: E501
            raise ValueError(
                "Invalid values for `ineligibility_reason_list` [{0}], must be a subset of [{1}]"  # noqa: E501
                .format(", ".join(map(str, set(ineligibility_reason_list) - set(allowed_values))),  # noqa: E501
                        ", ".join(map(str, allowed_values)))
            )

        self._ineligibility_reason_list = ineligibility_reason_list

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

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