# coding: utf-8

"""
    The Selling Partner API for External Fulfillment Inventory Management

    You can use the Amazon External Fulfillment Inventory API to manage inventory operations in Amazon's External Fulfillment network, including batch inventory updates and retrievals.

    The version of the OpenAPI document: 2024-09-11
    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 InventoryResponseBody(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 = {
        'client_sequence_number': 'int',
        'location_id': 'str',
        'sku_id': 'str',
        'sellable_quantity': 'int',
        'reserved_quantity': 'int',
        'marketplace_attributes': 'MarketplaceAttributes',
        'actionable_errors': 'List[ActionableError]',
    }

    attribute_map = {
        'client_sequence_number': 'clientSequenceNumber',
        'location_id': 'locationId',
        'sku_id': 'skuId',
        'sellable_quantity': 'sellableQuantity',
        'reserved_quantity': 'reservedQuantity',
        'marketplace_attributes': 'marketplaceAttributes',
        'actionable_errors': 'actionableErrors',
    }

    def __init__(self, client_sequence_number=None, location_id=None, sku_id=None, sellable_quantity=None, reserved_quantity=None, marketplace_attributes=None, actionable_errors=None, _configuration=None):  # noqa: E501
        """InventoryResponseBody - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._client_sequence_number = None
        self._location_id = None
        self._sku_id = None
        self._sellable_quantity = None
        self._reserved_quantity = None
        self._marketplace_attributes = None
        self._actionable_errors = None
        self.discriminator = None

        if client_sequence_number is not None:
            self.client_sequence_number = client_sequence_number
        if location_id is not None:
            self.location_id = location_id
        if sku_id is not None:
            self.sku_id = sku_id
        if sellable_quantity is not None:
            self.sellable_quantity = sellable_quantity
        if reserved_quantity is not None:
            self.reserved_quantity = reserved_quantity
        if marketplace_attributes is not None:
            self.marketplace_attributes = marketplace_attributes
        if actionable_errors is not None:
            self.actionable_errors = actionable_errors

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

        Latest sequence number for an inventory update.  # noqa: E501

        :return: The client_sequence_number of this InventoryResponseBody.  # noqa: E501
        :rtype: int
        """
        return self._client_sequence_number

    @client_sequence_number.setter
    def client_sequence_number(self, client_sequence_number):
        """Sets the client_sequence_number of this InventoryResponseBody.

        Latest sequence number for an inventory update.  # noqa: E501

        :param client_sequence_number: The client_sequence_number of this InventoryResponseBody.  # noqa: E501
        :type: int
        """

        self._client_sequence_number = client_sequence_number

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

        The location where inventory is updated or retrieved.  # noqa: E501

        :return: The location_id of this InventoryResponseBody.  # noqa: E501
        :rtype: str
        """
        return self._location_id

    @location_id.setter
    def location_id(self, location_id):
        """Sets the location_id of this InventoryResponseBody.

        The location where inventory is updated or retrieved.  # noqa: E501

        :param location_id: The location_id of this InventoryResponseBody.  # noqa: E501
        :type: str
        """

        self._location_id = location_id

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

        The SKU ID for which inventory is updated or retrieved  # noqa: E501

        :return: The sku_id of this InventoryResponseBody.  # noqa: E501
        :rtype: str
        """
        return self._sku_id

    @sku_id.setter
    def sku_id(self, sku_id):
        """Sets the sku_id of this InventoryResponseBody.

        The SKU ID for which inventory is updated or retrieved  # noqa: E501

        :param sku_id: The sku_id of this InventoryResponseBody.  # noqa: E501
        :type: str
        """

        self._sku_id = sku_id

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

        The number of items of the specified SKU that are available for purchase.  # noqa: E501

        :return: The sellable_quantity of this InventoryResponseBody.  # noqa: E501
        :rtype: int
        """
        return self._sellable_quantity

    @sellable_quantity.setter
    def sellable_quantity(self, sellable_quantity):
        """Sets the sellable_quantity of this InventoryResponseBody.

        The number of items of the specified SKU that are available for purchase.  # noqa: E501

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

        self._sellable_quantity = sellable_quantity

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

        The number of items of the specified SKU created in any marketplace that are reserved for shipment and yet to be fulfilled.  # noqa: E501

        :return: The reserved_quantity of this InventoryResponseBody.  # noqa: E501
        :rtype: int
        """
        return self._reserved_quantity

    @reserved_quantity.setter
    def reserved_quantity(self, reserved_quantity):
        """Sets the reserved_quantity of this InventoryResponseBody.

        The number of items of the specified SKU created in any marketplace that are reserved for shipment and yet to be fulfilled.  # noqa: E501

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

        self._reserved_quantity = reserved_quantity

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


        :return: The marketplace_attributes of this InventoryResponseBody.  # noqa: E501
        :rtype: MarketplaceAttributes
        """
        return self._marketplace_attributes

    @marketplace_attributes.setter
    def marketplace_attributes(self, marketplace_attributes):
        """Sets the marketplace_attributes of this InventoryResponseBody.


        :param marketplace_attributes: The marketplace_attributes of this InventoryResponseBody.  # noqa: E501
        :type: MarketplaceAttributes
        """

        self._marketplace_attributes = marketplace_attributes

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

        Inventory operation errors that require seller action before retrying the inventory request.  # noqa: E501

        :return: The actionable_errors of this InventoryResponseBody.  # noqa: E501
        :rtype: List[ActionableError]
        """
        return self._actionable_errors

    @actionable_errors.setter
    def actionable_errors(self, actionable_errors):
        """Sets the actionable_errors of this InventoryResponseBody.

        Inventory operation errors that require seller action before retrying the inventory request.  # noqa: E501

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

        self._actionable_errors = actionable_errors

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

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