# coding: utf-8

"""
    Cudo Compute service

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from src.cudo_compute.configuration import Configuration


class BillingAccountSpendRow(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 = {
        'amount': 'Decimal',
        'description': 'str',
        'project_id': 'str',
        'quantity': 'float',
        'unit': 'Unit',
        'unit_amount': 'Decimal'
    }

    attribute_map = {
        'amount': 'amount',
        'description': 'description',
        'project_id': 'projectId',
        'quantity': 'quantity',
        'unit': 'unit',
        'unit_amount': 'unitAmount'
    }

    def __init__(self, amount=None, description=None, project_id=None, quantity=None, unit=None, unit_amount=None, _configuration=None):  # noqa: E501
        """BillingAccountSpendRow - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._amount = None
        self._description = None
        self._project_id = None
        self._quantity = None
        self._unit = None
        self._unit_amount = None
        self.discriminator = None

        self.amount = amount
        self.description = description
        self.project_id = project_id
        self.quantity = quantity
        self.unit = unit
        self.unit_amount = unit_amount

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


        :return: The amount of this BillingAccountSpendRow.  # noqa: E501
        :rtype: Decimal
        """
        return self._amount

    @amount.setter
    def amount(self, amount):
        """Sets the amount of this BillingAccountSpendRow.


        :param amount: The amount of this BillingAccountSpendRow.  # noqa: E501
        :type: Decimal
        """
        if self._configuration.client_side_validation and amount is None:
            raise ValueError("Invalid value for `amount`, must not be `None`")  # noqa: E501

        self._amount = amount

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


        :return: The description of this BillingAccountSpendRow.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this BillingAccountSpendRow.


        :param description: The description of this BillingAccountSpendRow.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and description is None:
            raise ValueError("Invalid value for `description`, must not be `None`")  # noqa: E501

        self._description = description

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


        :return: The project_id of this BillingAccountSpendRow.  # noqa: E501
        :rtype: str
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this BillingAccountSpendRow.


        :param project_id: The project_id of this BillingAccountSpendRow.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and project_id is None:
            raise ValueError("Invalid value for `project_id`, must not be `None`")  # noqa: E501

        self._project_id = project_id

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


        :return: The quantity of this BillingAccountSpendRow.  # noqa: E501
        :rtype: float
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this BillingAccountSpendRow.


        :param quantity: The quantity of this BillingAccountSpendRow.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and quantity is None:
            raise ValueError("Invalid value for `quantity`, must not be `None`")  # noqa: E501

        self._quantity = quantity

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


        :return: The unit of this BillingAccountSpendRow.  # noqa: E501
        :rtype: Unit
        """
        return self._unit

    @unit.setter
    def unit(self, unit):
        """Sets the unit of this BillingAccountSpendRow.


        :param unit: The unit of this BillingAccountSpendRow.  # noqa: E501
        :type: Unit
        """
        if self._configuration.client_side_validation and unit is None:
            raise ValueError("Invalid value for `unit`, must not be `None`")  # noqa: E501

        self._unit = unit

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


        :return: The unit_amount of this BillingAccountSpendRow.  # noqa: E501
        :rtype: Decimal
        """
        return self._unit_amount

    @unit_amount.setter
    def unit_amount(self, unit_amount):
        """Sets the unit_amount of this BillingAccountSpendRow.


        :param unit_amount: The unit_amount of this BillingAccountSpendRow.  # noqa: E501
        :type: Decimal
        """
        if self._configuration.client_side_validation and unit_amount is None:
            raise ValueError("Invalid value for `unit_amount`, must not be `None`")  # noqa: E501

        self._unit_amount = unit_amount

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
