# coding: utf-8

"""
    Selling Partner API for Sales

    The Selling Partner API for Sales provides APIs related to sales performance.  # noqa: E501

    OpenAPI spec version: v1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class OrderMetricsInterval(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 = {
        'interval': 'str',
        'unit_count': 'int',
        'order_item_count': 'int',
        'order_count': 'int',
        'average_unit_price': 'Money',
        'total_sales': 'Money'
    }

    attribute_map = {
        'interval': 'interval',
        'unit_count': 'unitCount',
        'order_item_count': 'orderItemCount',
        'order_count': 'orderCount',
        'average_unit_price': 'averageUnitPrice',
        'total_sales': 'totalSales'
    }

    def __init__(self, interval=None, unit_count=None, order_item_count=None, order_count=None, average_unit_price=None, total_sales=None):  # noqa: E501
        """OrderMetricsInterval - a model defined in Swagger"""  # noqa: E501
        self._interval = None
        self._unit_count = None
        self._order_item_count = None
        self._order_count = None
        self._average_unit_price = None
        self._total_sales = None
        self.discriminator = None
        self.interval = interval
        self.unit_count = unit_count
        self.order_item_count = order_item_count
        self.order_count = order_count
        self.average_unit_price = average_unit_price
        self.total_sales = total_sales

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

        The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data).  # noqa: E501

        :return: The interval of this OrderMetricsInterval.  # noqa: E501
        :rtype: str
        """
        return self._interval

    @interval.setter
    def interval(self, interval):
        """Sets the interval of this OrderMetricsInterval.

        The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data).  # noqa: E501

        :param interval: The interval of this OrderMetricsInterval.  # noqa: E501
        :type: str
        """
        if interval is None:
            raise ValueError("Invalid value for `interval`, must not be `None`")  # noqa: E501

        self._interval = interval

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

        The number of units in orders based on the specified filters.  # noqa: E501

        :return: The unit_count of this OrderMetricsInterval.  # noqa: E501
        :rtype: int
        """
        return self._unit_count

    @unit_count.setter
    def unit_count(self, unit_count):
        """Sets the unit_count of this OrderMetricsInterval.

        The number of units in orders based on the specified filters.  # noqa: E501

        :param unit_count: The unit_count of this OrderMetricsInterval.  # noqa: E501
        :type: int
        """
        if unit_count is None:
            raise ValueError("Invalid value for `unit_count`, must not be `None`")  # noqa: E501

        self._unit_count = unit_count

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

        The number of order items based on the specified filters.  # noqa: E501

        :return: The order_item_count of this OrderMetricsInterval.  # noqa: E501
        :rtype: int
        """
        return self._order_item_count

    @order_item_count.setter
    def order_item_count(self, order_item_count):
        """Sets the order_item_count of this OrderMetricsInterval.

        The number of order items based on the specified filters.  # noqa: E501

        :param order_item_count: The order_item_count of this OrderMetricsInterval.  # noqa: E501
        :type: int
        """
        if order_item_count is None:
            raise ValueError("Invalid value for `order_item_count`, must not be `None`")  # noqa: E501

        self._order_item_count = order_item_count

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

        The number of orders based on the specified filters.  # noqa: E501

        :return: The order_count of this OrderMetricsInterval.  # noqa: E501
        :rtype: int
        """
        return self._order_count

    @order_count.setter
    def order_count(self, order_count):
        """Sets the order_count of this OrderMetricsInterval.

        The number of orders based on the specified filters.  # noqa: E501

        :param order_count: The order_count of this OrderMetricsInterval.  # noqa: E501
        :type: int
        """
        if order_count is None:
            raise ValueError("Invalid value for `order_count`, must not be `None`")  # noqa: E501

        self._order_count = order_count

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


        :return: The average_unit_price of this OrderMetricsInterval.  # noqa: E501
        :rtype: Money
        """
        return self._average_unit_price

    @average_unit_price.setter
    def average_unit_price(self, average_unit_price):
        """Sets the average_unit_price of this OrderMetricsInterval.


        :param average_unit_price: The average_unit_price of this OrderMetricsInterval.  # noqa: E501
        :type: Money
        """
        if average_unit_price is None:
            raise ValueError("Invalid value for `average_unit_price`, must not be `None`")  # noqa: E501

        self._average_unit_price = average_unit_price

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


        :return: The total_sales of this OrderMetricsInterval.  # noqa: E501
        :rtype: Money
        """
        return self._total_sales

    @total_sales.setter
    def total_sales(self, total_sales):
        """Sets the total_sales of this OrderMetricsInterval.


        :param total_sales: The total_sales of this OrderMetricsInterval.  # noqa: E501
        :type: Money
        """
        if total_sales is None:
            raise ValueError("Invalid value for `total_sales`, must not be `None`")  # noqa: E501

        self._total_sales = total_sales

    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(OrderMetricsInterval, 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, OrderMetricsInterval):
            return False

        return self.__dict__ == other.__dict__

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