# 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 V1PaymentItemization(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, name=None, quantity=None, itemization_type=None, item_detail=None, notes=None, item_variation_name=None, total_money=None, single_quantity_money=None, gross_sales_money=None, discount_money=None, net_sales_money=None, taxes=None, discounts=None, modifiers=None):
        """
        V1PaymentItemization - 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 = {
            'name': 'str',
            'quantity': 'float',
            'itemization_type': 'str',
            'item_detail': 'V1PaymentItemDetail',
            'notes': 'str',
            'item_variation_name': 'str',
            'total_money': 'V1Money',
            'single_quantity_money': 'V1Money',
            'gross_sales_money': 'V1Money',
            'discount_money': 'V1Money',
            'net_sales_money': 'V1Money',
            'taxes': 'list[V1PaymentTax]',
            'discounts': 'list[V1PaymentDiscount]',
            'modifiers': 'list[V1PaymentModifier]'
        }

        self.attribute_map = {
            'name': 'name',
            'quantity': 'quantity',
            'itemization_type': 'itemization_type',
            'item_detail': 'item_detail',
            'notes': 'notes',
            'item_variation_name': 'item_variation_name',
            'total_money': 'total_money',
            'single_quantity_money': 'single_quantity_money',
            'gross_sales_money': 'gross_sales_money',
            'discount_money': 'discount_money',
            'net_sales_money': 'net_sales_money',
            'taxes': 'taxes',
            'discounts': 'discounts',
            'modifiers': 'modifiers'
        }

        self._name = name
        self._quantity = quantity
        self._itemization_type = itemization_type
        self._item_detail = item_detail
        self._notes = notes
        self._item_variation_name = item_variation_name
        self._total_money = total_money
        self._single_quantity_money = single_quantity_money
        self._gross_sales_money = gross_sales_money
        self._discount_money = discount_money
        self._net_sales_money = net_sales_money
        self._taxes = taxes
        self._discounts = discounts
        self._modifiers = modifiers

    @property
    def name(self):
        """
        Gets the name of this V1PaymentItemization.
        The item's name.

        :return: The name of this V1PaymentItemization.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this V1PaymentItemization.
        The item's name.

        :param name: The name of this V1PaymentItemization.
        :type: str
        """

        self._name = name

    @property
    def quantity(self):
        """
        Gets the quantity of this V1PaymentItemization.
        The quantity of the item purchased. This can be a decimal value.

        :return: The quantity of this V1PaymentItemization.
        :rtype: float
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """
        Sets the quantity of this V1PaymentItemization.
        The quantity of the item purchased. This can be a decimal value.

        :param quantity: The quantity of this V1PaymentItemization.
        :type: float
        """

        self._quantity = quantity

    @property
    def itemization_type(self):
        """
        Gets the itemization_type of this V1PaymentItemization.
        The type of purchase that the itemization represents, such as an ITEM or CUSTOM_AMOUNT See [V1PaymentItemizationItemizationType](#type-v1paymentitemizationitemizationtype) for possible values

        :return: The itemization_type of this V1PaymentItemization.
        :rtype: str
        """
        return self._itemization_type

    @itemization_type.setter
    def itemization_type(self, itemization_type):
        """
        Sets the itemization_type of this V1PaymentItemization.
        The type of purchase that the itemization represents, such as an ITEM or CUSTOM_AMOUNT See [V1PaymentItemizationItemizationType](#type-v1paymentitemizationitemizationtype) for possible values

        :param itemization_type: The itemization_type of this V1PaymentItemization.
        :type: str
        """

        self._itemization_type = itemization_type

    @property
    def item_detail(self):
        """
        Gets the item_detail of this V1PaymentItemization.
        Details of the item, including its unique identifier and the identifier of the item variation purchased.

        :return: The item_detail of this V1PaymentItemization.
        :rtype: V1PaymentItemDetail
        """
        return self._item_detail

    @item_detail.setter
    def item_detail(self, item_detail):
        """
        Sets the item_detail of this V1PaymentItemization.
        Details of the item, including its unique identifier and the identifier of the item variation purchased.

        :param item_detail: The item_detail of this V1PaymentItemization.
        :type: V1PaymentItemDetail
        """

        self._item_detail = item_detail

    @property
    def notes(self):
        """
        Gets the notes of this V1PaymentItemization.
        Notes entered by the merchant about the item at the time of payment, if any.

        :return: The notes of this V1PaymentItemization.
        :rtype: str
        """
        return self._notes

    @notes.setter
    def notes(self, notes):
        """
        Sets the notes of this V1PaymentItemization.
        Notes entered by the merchant about the item at the time of payment, if any.

        :param notes: The notes of this V1PaymentItemization.
        :type: str
        """

        self._notes = notes

    @property
    def item_variation_name(self):
        """
        Gets the item_variation_name of this V1PaymentItemization.
        The name of the item variation purchased, if any.

        :return: The item_variation_name of this V1PaymentItemization.
        :rtype: str
        """
        return self._item_variation_name

    @item_variation_name.setter
    def item_variation_name(self, item_variation_name):
        """
        Sets the item_variation_name of this V1PaymentItemization.
        The name of the item variation purchased, if any.

        :param item_variation_name: The item_variation_name of this V1PaymentItemization.
        :type: str
        """

        self._item_variation_name = item_variation_name

    @property
    def total_money(self):
        """
        Gets the total_money of this V1PaymentItemization.
        The total cost of the item, including all taxes and discounts.

        :return: The total_money of this V1PaymentItemization.
        :rtype: V1Money
        """
        return self._total_money

    @total_money.setter
    def total_money(self, total_money):
        """
        Sets the total_money of this V1PaymentItemization.
        The total cost of the item, including all taxes and discounts.

        :param total_money: The total_money of this V1PaymentItemization.
        :type: V1Money
        """

        self._total_money = total_money

    @property
    def single_quantity_money(self):
        """
        Gets the single_quantity_money of this V1PaymentItemization.
        The cost of a single unit of this item.

        :return: The single_quantity_money of this V1PaymentItemization.
        :rtype: V1Money
        """
        return self._single_quantity_money

    @single_quantity_money.setter
    def single_quantity_money(self, single_quantity_money):
        """
        Sets the single_quantity_money of this V1PaymentItemization.
        The cost of a single unit of this item.

        :param single_quantity_money: The single_quantity_money of this V1PaymentItemization.
        :type: V1Money
        """

        self._single_quantity_money = single_quantity_money

    @property
    def gross_sales_money(self):
        """
        Gets the gross_sales_money of this V1PaymentItemization.
        The total cost of the itemization and its modifiers, not including taxes or discounts.

        :return: The gross_sales_money of this V1PaymentItemization.
        :rtype: V1Money
        """
        return self._gross_sales_money

    @gross_sales_money.setter
    def gross_sales_money(self, gross_sales_money):
        """
        Sets the gross_sales_money of this V1PaymentItemization.
        The total cost of the itemization and its modifiers, not including taxes or discounts.

        :param gross_sales_money: The gross_sales_money of this V1PaymentItemization.
        :type: V1Money
        """

        self._gross_sales_money = gross_sales_money

    @property
    def discount_money(self):
        """
        Gets the discount_money of this V1PaymentItemization.
        The total of all discounts applied to the itemization. This value is always negative or zero.

        :return: The discount_money of this V1PaymentItemization.
        :rtype: V1Money
        """
        return self._discount_money

    @discount_money.setter
    def discount_money(self, discount_money):
        """
        Sets the discount_money of this V1PaymentItemization.
        The total of all discounts applied to the itemization. This value is always negative or zero.

        :param discount_money: The discount_money of this V1PaymentItemization.
        :type: V1Money
        """

        self._discount_money = discount_money

    @property
    def net_sales_money(self):
        """
        Gets the net_sales_money of this V1PaymentItemization.
        The sum of gross_sales_money and discount_money.

        :return: The net_sales_money of this V1PaymentItemization.
        :rtype: V1Money
        """
        return self._net_sales_money

    @net_sales_money.setter
    def net_sales_money(self, net_sales_money):
        """
        Sets the net_sales_money of this V1PaymentItemization.
        The sum of gross_sales_money and discount_money.

        :param net_sales_money: The net_sales_money of this V1PaymentItemization.
        :type: V1Money
        """

        self._net_sales_money = net_sales_money

    @property
    def taxes(self):
        """
        Gets the taxes of this V1PaymentItemization.
        All taxes applied to this itemization.

        :return: The taxes of this V1PaymentItemization.
        :rtype: list[V1PaymentTax]
        """
        return self._taxes

    @taxes.setter
    def taxes(self, taxes):
        """
        Sets the taxes of this V1PaymentItemization.
        All taxes applied to this itemization.

        :param taxes: The taxes of this V1PaymentItemization.
        :type: list[V1PaymentTax]
        """

        self._taxes = taxes

    @property
    def discounts(self):
        """
        Gets the discounts of this V1PaymentItemization.
        All discounts applied to this itemization.

        :return: The discounts of this V1PaymentItemization.
        :rtype: list[V1PaymentDiscount]
        """
        return self._discounts

    @discounts.setter
    def discounts(self, discounts):
        """
        Sets the discounts of this V1PaymentItemization.
        All discounts applied to this itemization.

        :param discounts: The discounts of this V1PaymentItemization.
        :type: list[V1PaymentDiscount]
        """

        self._discounts = discounts

    @property
    def modifiers(self):
        """
        Gets the modifiers of this V1PaymentItemization.
        All modifier options applied to this itemization.

        :return: The modifiers of this V1PaymentItemization.
        :rtype: list[V1PaymentModifier]
        """
        return self._modifiers

    @modifiers.setter
    def modifiers(self, modifiers):
        """
        Sets the modifiers of this V1PaymentItemization.
        All modifier options applied to this itemization.

        :param modifiers: The modifiers of this V1PaymentItemization.
        :type: list[V1PaymentModifier]
        """

        self._modifiers = modifiers

    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
