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

        self.attribute_map = {
            'id': 'id',
            'reference_id': 'reference_id',
            'catalog_object_id': 'catalog_object_id',
            'catalog_object_type': 'catalog_object_type',
            'state': 'state',
            'location_id': 'location_id',
            'quantity': 'quantity',
            'source': 'source',
            'employee_id': 'employee_id',
            'occurred_at': 'occurred_at',
            'created_at': 'created_at'
        }

        self._id = id
        self._reference_id = reference_id
        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._source = source
        self._employee_id = employee_id
        self._occurred_at = occurred_at
        self._created_at = created_at

    @property
    def id(self):
        """
        Gets the id of this InventoryPhysicalCount.
        A unique ID generated by Square for the [InventoryPhysicalCount](#type-inventoryphysicalcount).

        :return: The id of this InventoryPhysicalCount.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Sets the id of this InventoryPhysicalCount.
        A unique ID generated by Square for the [InventoryPhysicalCount](#type-inventoryphysicalcount).

        :param id: The id of this InventoryPhysicalCount.
        :type: str
        """

        self._id = id

    @property
    def reference_id(self):
        """
        Gets the reference_id of this InventoryPhysicalCount.
        An optional ID provided by the application to tie the [InventoryPhysicalCount](#type-inventoryphysicalcount) to an external system.

        :return: The reference_id of this InventoryPhysicalCount.
        :rtype: str
        """
        return self._reference_id

    @reference_id.setter
    def reference_id(self, reference_id):
        """
        Sets the reference_id of this InventoryPhysicalCount.
        An optional ID provided by the application to tie the [InventoryPhysicalCount](#type-inventoryphysicalcount) to an external system.

        :param reference_id: The reference_id of this InventoryPhysicalCount.
        :type: str
        """

        self._reference_id = reference_id

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

        :return: The catalog_object_id of this InventoryPhysicalCount.
        :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 InventoryPhysicalCount.
        The Square generated ID of the [CatalogObject](#type-catalogobject) being tracked.

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

        self._catalog_object_id = catalog_object_id

    @property
    def catalog_object_type(self):
        """
        Gets the catalog_object_type of this InventoryPhysicalCount.
        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 InventoryPhysicalCount.
        :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 InventoryPhysicalCount.
        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 InventoryPhysicalCount.
        :type: str
        """

        self._catalog_object_type = catalog_object_type

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

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

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

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

        self._state = state

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

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

    @location_id.setter
    def location_id(self, location_id):
        """
        Sets the location_id of this InventoryPhysicalCount.
        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 InventoryPhysicalCount.
        :type: str
        """

        self._location_id = location_id

    @property
    def quantity(self):
        """
        Gets the quantity of this InventoryPhysicalCount.
        The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point.  _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.

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

    @quantity.setter
    def quantity(self, quantity):
        """
        Sets the quantity of this InventoryPhysicalCount.
        The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point.  _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.

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

        self._quantity = quantity

    @property
    def source(self):
        """
        Gets the source of this InventoryPhysicalCount.
        Read-only information about the application that submitted the physical count.

        :return: The source of this InventoryPhysicalCount.
        :rtype: SourceApplication
        """
        return self._source

    @source.setter
    def source(self, source):
        """
        Sets the source of this InventoryPhysicalCount.
        Read-only information about the application that submitted the physical count.

        :param source: The source of this InventoryPhysicalCount.
        :type: SourceApplication
        """

        self._source = source

    @property
    def employee_id(self):
        """
        Gets the employee_id of this InventoryPhysicalCount.
        The Square ID of the [Employee](#type-employee) responsible for the physical count.

        :return: The employee_id of this InventoryPhysicalCount.
        :rtype: str
        """
        return self._employee_id

    @employee_id.setter
    def employee_id(self, employee_id):
        """
        Sets the employee_id of this InventoryPhysicalCount.
        The Square ID of the [Employee](#type-employee) responsible for the physical count.

        :param employee_id: The employee_id of this InventoryPhysicalCount.
        :type: str
        """

        self._employee_id = employee_id

    @property
    def occurred_at(self):
        """
        Gets the occurred_at of this InventoryPhysicalCount.
        A client-generated timestamp in RFC 3339 format that indicates when the physical count took place. For write actions, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.

        :return: The occurred_at of this InventoryPhysicalCount.
        :rtype: str
        """
        return self._occurred_at

    @occurred_at.setter
    def occurred_at(self, occurred_at):
        """
        Sets the occurred_at of this InventoryPhysicalCount.
        A client-generated timestamp in RFC 3339 format that indicates when the physical count took place. For write actions, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.

        :param occurred_at: The occurred_at of this InventoryPhysicalCount.
        :type: str
        """

        self._occurred_at = occurred_at

    @property
    def created_at(self):
        """
        Gets the created_at of this InventoryPhysicalCount.
        A read-only timestamp in RFC 3339 format that indicates when Square received the physical count.

        :return: The created_at of this InventoryPhysicalCount.
        :rtype: str
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """
        Sets the created_at of this InventoryPhysicalCount.
        A read-only timestamp in RFC 3339 format that indicates when Square received the physical count.

        :param created_at: The created_at of this InventoryPhysicalCount.
        :type: str
        """

        self._created_at = created_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
