# coding: utf-8

"""
Copyright 2017 Square, Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re


class InventoryChange(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, type=None, physical_count=None, adjustment=None, transfer=None):
        """
        InventoryChange - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'type': 'str',
            'physical_count': 'InventoryPhysicalCount',
            'adjustment': 'InventoryAdjustment',
            'transfer': 'InventoryTransfer'
        }

        self.attribute_map = {
            'type': 'type',
            'physical_count': 'physical_count',
            'adjustment': 'adjustment',
            'transfer': 'transfer'
        }

        self._type = type
        self._physical_count = physical_count
        self._adjustment = adjustment
        self._transfer = transfer

    @property
    def type(self):
        """
        Gets the type of this InventoryChange.
        Indicates how the inventory change was applied. See [InventoryChangeType](#type-inventorychangetype) for all possible values.

        :return: The type of this InventoryChange.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this InventoryChange.
        Indicates how the inventory change was applied. See [InventoryChangeType](#type-inventorychangetype) for all possible values.

        :param type: The type of this InventoryChange.
        :type: str
        """

        self._type = type

    @property
    def physical_count(self):
        """
        Gets the physical_count of this InventoryChange.
        Contains details about the physical count when `type` is `PHYSICAL_COUNT` and unset for all other types.

        :return: The physical_count of this InventoryChange.
        :rtype: InventoryPhysicalCount
        """
        return self._physical_count

    @physical_count.setter
    def physical_count(self, physical_count):
        """
        Sets the physical_count of this InventoryChange.
        Contains details about the physical count when `type` is `PHYSICAL_COUNT` and unset for all other types.

        :param physical_count: The physical_count of this InventoryChange.
        :type: InventoryPhysicalCount
        """

        self._physical_count = physical_count

    @property
    def adjustment(self):
        """
        Gets the adjustment of this InventoryChange.
        Contains details about the inventory adjustment when `type` is `ADJUSTMENT` and unset for all other types.

        :return: The adjustment of this InventoryChange.
        :rtype: InventoryAdjustment
        """
        return self._adjustment

    @adjustment.setter
    def adjustment(self, adjustment):
        """
        Sets the adjustment of this InventoryChange.
        Contains details about the inventory adjustment when `type` is `ADJUSTMENT` and unset for all other types.

        :param adjustment: The adjustment of this InventoryChange.
        :type: InventoryAdjustment
        """

        self._adjustment = adjustment

    @property
    def transfer(self):
        """
        Gets the transfer of this InventoryChange.
        Contains details about the inventory transfer when `type` is `TRANSFER` and unset for all other types.

        :return: The transfer of this InventoryChange.
        :rtype: InventoryTransfer
        """
        return self._transfer

    @transfer.setter
    def transfer(self, transfer):
        """
        Sets the transfer of this InventoryChange.
        Contains details about the inventory transfer when `type` is `TRANSFER` and unset for all other types.

        :param transfer: The transfer of this InventoryChange.
        :type: InventoryTransfer
        """

        self._transfer = transfer

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in 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

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return 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
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
