# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class Invoice(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'str',
        'payment_url': 'str',
        'pdf_url': 'str',
        'due_date': 'datetime',
        'status': 'InvoiceStatus',
        'show_payment_link': 'bool',
        'outstanding_due_amount': 'int',
        'total_amount': 'int',
        'product_type': 'ProductType',
        'period_start_date': 'datetime',
        'period_end_date': 'datetime'
    }

    attribute_map = {
        'id': 'id',
        'payment_url': 'payment_url',
        'pdf_url': 'pdf_url',
        'due_date': 'due_date',
        'status': 'status',
        'show_payment_link': 'show_payment_link',
        'outstanding_due_amount': 'outstanding_due_amount',
        'total_amount': 'total_amount',
        'product_type': 'product_type',
        'period_start_date': 'period_start_date',
        'period_end_date': 'period_end_date'
    }

    def __init__(self, id=None, payment_url=None, pdf_url=None, due_date=None, status=None, show_payment_link=None, outstanding_due_amount=None, total_amount=None, product_type=None, period_start_date=None, period_end_date=None, local_vars_configuration=None):  # noqa: E501
        """Invoice - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._payment_url = None
        self._pdf_url = None
        self._due_date = None
        self._status = None
        self._show_payment_link = None
        self._outstanding_due_amount = None
        self._total_amount = None
        self._product_type = None
        self._period_start_date = None
        self._period_end_date = None
        self.discriminator = None

        self.id = id
        self.payment_url = payment_url
        self.pdf_url = pdf_url
        self.due_date = due_date
        self.status = status
        self.show_payment_link = show_payment_link
        self.outstanding_due_amount = outstanding_due_amount
        self.total_amount = total_amount
        self.product_type = product_type
        self.period_start_date = period_start_date
        self.period_end_date = period_end_date

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

        ID of invoice from Chargify.  # noqa: E501

        :return: The id of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Invoice.

        ID of invoice from Chargify.  # noqa: E501

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

        self._id = id

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

        URL to pay invoice.  # noqa: E501

        :return: The payment_url of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._payment_url

    @payment_url.setter
    def payment_url(self, payment_url):
        """Sets the payment_url of this Invoice.

        URL to pay invoice.  # noqa: E501

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

        self._payment_url = payment_url

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

        URL to view pdf of invoice.  # noqa: E501

        :return: The pdf_url of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._pdf_url

    @pdf_url.setter
    def pdf_url(self, pdf_url):
        """Sets the pdf_url of this Invoice.

        URL to view pdf of invoice.  # noqa: E501

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

        self._pdf_url = pdf_url

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

        Date invoice is due.  # noqa: E501

        :return: The due_date of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._due_date

    @due_date.setter
    def due_date(self, due_date):
        """Sets the due_date of this Invoice.

        Date invoice is due.  # noqa: E501

        :param due_date: The due_date of this Invoice.  # noqa: E501
        :type: datetime
        """
        if self.local_vars_configuration.client_side_validation and due_date is None:  # noqa: E501
            raise ValueError("Invalid value for `due_date`, must not be `None`")  # noqa: E501

        self._due_date = due_date

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

        Status of invoice payment.  # noqa: E501

        :return: The status of this Invoice.  # noqa: E501
        :rtype: InvoiceStatus
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Invoice.

        Status of invoice payment.  # noqa: E501

        :param status: The status of this Invoice.  # noqa: E501
        :type: InvoiceStatus
        """
        if self.local_vars_configuration.client_side_validation and status is None:  # noqa: E501
            raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501

        self._status = status

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

        Show link to pay invoice if invoice is open and payment information is already provided.  # noqa: E501

        :return: The show_payment_link of this Invoice.  # noqa: E501
        :rtype: bool
        """
        return self._show_payment_link

    @show_payment_link.setter
    def show_payment_link(self, show_payment_link):
        """Sets the show_payment_link of this Invoice.

        Show link to pay invoice if invoice is open and payment information is already provided.  # noqa: E501

        :param show_payment_link: The show_payment_link of this Invoice.  # noqa: E501
        :type: bool
        """
        if self.local_vars_configuration.client_side_validation and show_payment_link is None:  # noqa: E501
            raise ValueError("Invalid value for `show_payment_link`, must not be `None`")  # noqa: E501

        self._show_payment_link = show_payment_link

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

        Amount that still needs to be paid on the invoice in cents.  # noqa: E501

        :return: The outstanding_due_amount of this Invoice.  # noqa: E501
        :rtype: int
        """
        return self._outstanding_due_amount

    @outstanding_due_amount.setter
    def outstanding_due_amount(self, outstanding_due_amount):
        """Sets the outstanding_due_amount of this Invoice.

        Amount that still needs to be paid on the invoice in cents.  # noqa: E501

        :param outstanding_due_amount: The outstanding_due_amount of this Invoice.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and outstanding_due_amount is None:  # noqa: E501
            raise ValueError("Invalid value for `outstanding_due_amount`, must not be `None`")  # noqa: E501

        self._outstanding_due_amount = outstanding_due_amount

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

        Original invoice total amount due in cents.  # noqa: E501

        :return: The total_amount of this Invoice.  # noqa: E501
        :rtype: int
        """
        return self._total_amount

    @total_amount.setter
    def total_amount(self, total_amount):
        """Sets the total_amount of this Invoice.

        Original invoice total amount due in cents.  # noqa: E501

        :param total_amount: The total_amount of this Invoice.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and total_amount is None:  # noqa: E501
            raise ValueError("Invalid value for `total_amount`, must not be `None`")  # noqa: E501

        self._total_amount = total_amount

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

        Type of product this invoice is for.  # noqa: E501

        :return: The product_type of this Invoice.  # noqa: E501
        :rtype: ProductType
        """
        return self._product_type

    @product_type.setter
    def product_type(self, product_type):
        """Sets the product_type of this Invoice.

        Type of product this invoice is for.  # noqa: E501

        :param product_type: The product_type of this Invoice.  # noqa: E501
        :type: ProductType
        """
        if self.local_vars_configuration.client_side_validation and product_type is None:  # noqa: E501
            raise ValueError("Invalid value for `product_type`, must not be `None`")  # noqa: E501

        self._product_type = product_type

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

        Start date for the invoice.  # noqa: E501

        :return: The period_start_date of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._period_start_date

    @period_start_date.setter
    def period_start_date(self, period_start_date):
        """Sets the period_start_date of this Invoice.

        Start date for the invoice.  # noqa: E501

        :param period_start_date: The period_start_date of this Invoice.  # noqa: E501
        :type: datetime
        """
        if self.local_vars_configuration.client_side_validation and period_start_date is None:  # noqa: E501
            raise ValueError("Invalid value for `period_start_date`, must not be `None`")  # noqa: E501

        self._period_start_date = period_start_date

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

        End date for the invoice.  # noqa: E501

        :return: The period_end_date of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._period_end_date

    @period_end_date.setter
    def period_end_date(self, period_end_date):
        """Sets the period_end_date of this Invoice.

        End date for the invoice.  # noqa: E501

        :param period_end_date: The period_end_date of this Invoice.  # noqa: E501
        :type: datetime
        """
        if self.local_vars_configuration.client_side_validation and period_end_date is None:  # noqa: E501
            raise ValueError("Invalid value for `period_end_date`, must not be `None`")  # noqa: E501

        self._period_end_date = period_end_date

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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 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, Invoice):
            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, Invoice):
            return True

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