# coding: utf-8

"""
    Selling Partner API for Retail Procurement Payments

    The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class PaymentTerms(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 = {
        'type': 'str',
        'discount_percent': 'str',
        'discount_due_days': 'float',
        'net_due_days': 'float',
    }

    attribute_map = {
        'type': 'type',
        'discount_percent': 'discountPercent',
        'discount_due_days': 'discountDueDays',
        'net_due_days': 'netDueDays',
    }

    def __init__(self, type=None, discount_percent=None, discount_due_days=None, net_due_days=None, _configuration=None):  # noqa: E501
        """PaymentTerms - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._type = None
        self._discount_percent = None
        self._discount_due_days = None
        self._net_due_days = None
        self.discriminator = None

        if type is not None:
            self.type = type
        if discount_percent is not None:
            self.discount_percent = discount_percent
        if discount_due_days is not None:
            self.discount_due_days = discount_due_days
        if net_due_days is not None:
            self.net_due_days = net_due_days

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

        The payment term type for the invoice.  # noqa: E501

        :return: The type of this PaymentTerms.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this PaymentTerms.

        The payment term type for the invoice.  # noqa: E501

        :param type: The type of this PaymentTerms.  # noqa: E501
        :type: str
        """
        allowed_values = ["Basic", "EndOfMonth", "FixedDate", "Proximo", "PaymentDueUponReceiptOfInvoice", "LetterofCredit"]  # noqa: E501
        if (self._configuration.client_side_validation and
                type not in allowed_values):
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"  # noqa: E501
                .format(type, allowed_values)
            )

        self._type = type

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

        A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.  # noqa: E501

        :return: The discount_percent of this PaymentTerms.  # noqa: E501
        :rtype: str
        """
        return self._discount_percent

    @discount_percent.setter
    def discount_percent(self, discount_percent):
        """Sets the discount_percent of this PaymentTerms.

        A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.  # noqa: E501

        :param discount_percent: The discount_percent of this PaymentTerms.  # noqa: E501
        :type: str
        """

        self._discount_percent = discount_percent

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

        The number of calendar days from the Base date (Invoice date) until the discount is no longer valid.  # noqa: E501

        :return: The discount_due_days of this PaymentTerms.  # noqa: E501
        :rtype: float
        """
        return self._discount_due_days

    @discount_due_days.setter
    def discount_due_days(self, discount_due_days):
        """Sets the discount_due_days of this PaymentTerms.

        The number of calendar days from the Base date (Invoice date) until the discount is no longer valid.  # noqa: E501

        :param discount_due_days: The discount_due_days of this PaymentTerms.  # noqa: E501
        :type: float
        """

        self._discount_due_days = discount_due_days

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

        The number of calendar days from the base date (invoice date) until the total amount on the invoice is due.  # noqa: E501

        :return: The net_due_days of this PaymentTerms.  # noqa: E501
        :rtype: float
        """
        return self._net_due_days

    @net_due_days.setter
    def net_due_days(self, net_due_days):
        """Sets the net_due_days of this PaymentTerms.

        The number of calendar days from the base date (invoice date) until the total amount on the invoice is due.  # noqa: E501

        :param net_due_days: The net_due_days of this PaymentTerms.  # noqa: E501
        :type: float
        """

        self._net_due_days = net_due_days

    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(PaymentTerms, 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, PaymentTerms):
            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, PaymentTerms):
            return True

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