# 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 InventoryCount(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, catalog_object_id=None, catalog_object_type=None, state=None, location_id=None, quantity=None, calculated_at=None):
        """
        InventoryCount - 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 = {
            'catalog_object_id': 'str',
            'catalog_object_type': 'str',
            'state': 'str',
            'location_id': 'str',
            'quantity': 'str',
            'calculated_at': 'str'
        }

        self.attribute_map = {
            'catalog_object_id': 'catalog_object_id',
            'catalog_object_type': 'catalog_object_type',
            'state': 'state',
            'location_id': 'location_id',
            'quantity': 'quantity',
            'calculated_at': 'calculated_at'
        }

        self._catalog_object_id = catalog_object_id
        self._catalog_object_type = catalog_object_type
        self._state = state
        self._location_id = location_id
        self._quantity = quantity
        self._calculated_at = calculated_at

    @property
    def catalog_object_id(self):
        """
        Gets the catalog_object_id of this InventoryCount.
        The Square generated ID of the [CatalogObject](#type-catalogobject) being tracked.

        :return: The catalog_object_id of this InventoryCount.
        :rtype: str
        """
        return self._catalog_object_id

    @catalog_object_id.setter
    def catalog_object_id(self, catalog_object_id):
        """
        Sets the catalog_object_id of this InventoryCount.
        The Square generated ID of the [CatalogObject](#type-catalogobject) being tracked.

        :param catalog_object_id: The catalog_object_id of this InventoryCount.
        :type: str
        """

        self._catalog_object_id = catalog_object_id

    @property
    def catalog_object_type(self):
        """
        Gets the catalog_object_type of this InventoryCount.
        The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being tracked. Tracking is only supported for the `ITEM_VARIATION` type.

        :return: The catalog_object_type of this InventoryCount.
        :rtype: str
        """
        return self._catalog_object_type

    @catalog_object_type.setter
    def catalog_object_type(self, catalog_object_type):
        """
        Sets the catalog_object_type of this InventoryCount.
        The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being tracked. Tracking is only supported for the `ITEM_VARIATION` type.

        :param catalog_object_type: The catalog_object_type of this InventoryCount.
        :type: str
        """

        self._catalog_object_type = catalog_object_type

    @property
    def state(self):
        """
        Gets the state of this InventoryCount.
        The current [InventoryState](#type-inventorystate) for the related quantity of items.

        :return: The state of this InventoryCount.
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """
        Sets the state of this InventoryCount.
        The current [InventoryState](#type-inventorystate) for the related quantity of items.

        :param state: The state of this InventoryCount.
        :type: str
        """

        self._state = state

    @property
    def location_id(self):
        """
        Gets the location_id of this InventoryCount.
        The Square ID of the [Location](#type-location) where the related quantity of items are being tracked.

        :return: The location_id of this InventoryCount.
        :rtype: str
        """
        return self._location_id

    @location_id.setter
    def location_id(self, location_id):
        """
        Sets the location_id of this InventoryCount.
        The Square ID of the [Location](#type-location) where the related quantity of items are being tracked.

        :param location_id: The location_id of this InventoryCount.
        :type: str
        """

        self._location_id = location_id

    @property
    def quantity(self):
        """
        Gets the quantity of this InventoryCount.
        The number of items in the count as a decimal string. Fractional quantities are not supported.

        :return: The quantity of this InventoryCount.
        :rtype: str
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """
        Sets the quantity of this InventoryCount.
        The number of items in the count as a decimal string. Fractional quantities are not supported.

        :param quantity: The quantity of this InventoryCount.
        :type: str
        """

        self._quantity = quantity

    @property
    def calculated_at(self):
        """
        Gets the calculated_at of this InventoryCount.
        A read-only timestamp in RFC 3339 format that indicates when Square received the most recent physical count or adjustment that had an affect on the estimated count.

        :return: The calculated_at of this InventoryCount.
        :rtype: str
        """
        return self._calculated_at

    @calculated_at.setter
    def calculated_at(self, calculated_at):
        """
        Sets the calculated_at of this InventoryCount.
        A read-only timestamp in RFC 3339 format that indicates when Square received the most recent physical count or adjustment that had an affect on the estimated count.

        :param calculated_at: The calculated_at of this InventoryCount.
        :type: str
        """

        self._calculated_at = calculated_at

    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
