# coding: utf-8

"""
    Spotii Billing API

    API for Billing  # noqa: E501

    OpenAPI spec version: v1.0
    Contact: hello@nuclearo.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six


class Installments(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 = {
        'installments_id': 'str',
        'external_key': 'str',
        'installments_number': 'str',
        'plan_id': 'str',
        'installments': 'list[InstallmentSerilizer]',
        'payment_method_id': 'str',
        'amount': 'str',
        'currency': 'str',
        'status': 'str',
        'created_at': 'datetime'
    }

    attribute_map = {
        'installments_id': 'installments_id',
        'external_key': 'external_key',
        'installments_number': 'installments_number',
        'plan_id': 'plan_id',
        'installments': 'installments',
        'payment_method_id': 'payment_method_id',
        'amount': 'amount',
        'currency': 'currency',
        'status': 'status',
        'created_at': 'created_at'
    }

    def __init__(self, installments_id=None, external_key=None, installments_number=None, plan_id=None, installments=None, payment_method_id=None, amount=None, currency=None, status=None, created_at=None):  # noqa: E501
        """Installments - a model defined in Swagger"""  # noqa: E501
        self._installments_id = None
        self._external_key = None
        self._installments_number = None
        self._plan_id = None
        self._installments = None
        self._payment_method_id = None
        self._amount = None
        self._currency = None
        self._status = None
        self._created_at = None
        self.discriminator = None
        if installments_id is not None:
            self.installments_id = installments_id
        self.external_key = external_key
        if installments_number is not None:
            self.installments_number = installments_number
        self.plan_id = plan_id
        if installments is not None:
            self.installments = installments
        if payment_method_id is not None:
            self.payment_method_id = payment_method_id
        self.amount = amount
        self.currency = currency
        if status is not None:
            self.status = status
        if created_at is not None:
            self.created_at = created_at

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


        :return: The installments_id of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._installments_id

    @installments_id.setter
    def installments_id(self, installments_id):
        """Sets the installments_id of this Installments.


        :param installments_id: The installments_id of this Installments.  # noqa: E501
        :type: str
        """

        self._installments_id = installments_id

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


        :return: The external_key of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._external_key

    @external_key.setter
    def external_key(self, external_key):
        """Sets the external_key of this Installments.


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

        self._external_key = external_key

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


        :return: The installments_number of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._installments_number

    @installments_number.setter
    def installments_number(self, installments_number):
        """Sets the installments_number of this Installments.


        :param installments_number: The installments_number of this Installments.  # noqa: E501
        :type: str
        """

        self._installments_number = installments_number

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


        :return: The plan_id of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._plan_id

    @plan_id.setter
    def plan_id(self, plan_id):
        """Sets the plan_id of this Installments.


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

        self._plan_id = plan_id

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


        :return: The installments of this Installments.  # noqa: E501
        :rtype: list[InstallmentSerilizer]
        """
        return self._installments

    @installments.setter
    def installments(self, installments):
        """Sets the installments of this Installments.


        :param installments: The installments of this Installments.  # noqa: E501
        :type: list[InstallmentSerilizer]
        """

        self._installments = installments

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


        :return: The payment_method_id of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._payment_method_id

    @payment_method_id.setter
    def payment_method_id(self, payment_method_id):
        """Sets the payment_method_id of this Installments.


        :param payment_method_id: The payment_method_id of this Installments.  # noqa: E501
        :type: str
        """

        self._payment_method_id = payment_method_id

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


        :return: The amount of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._amount

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


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

        self._amount = amount

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


        :return: The currency of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._currency

    @currency.setter
    def currency(self, currency):
        """Sets the currency of this Installments.


        :param currency: The currency of this Installments.  # noqa: E501
        :type: str
        """
        if currency is None:
            raise ValueError("Invalid value for `currency`, must not be `None`")  # noqa: E501
        allowed_values = ["USD", "AED"]  # noqa: E501
        if currency not in allowed_values:
            raise ValueError(
                "Invalid value for `currency` ({0}), must be one of {1}"  # noqa: E501
                .format(currency, allowed_values)
            )

        self._currency = currency

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


        :return: The status of this Installments.  # noqa: E501
        :rtype: str
        """
        return self._status

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


        :param status: The status of this Installments.  # noqa: E501
        :type: str
        """

        self._status = status

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


        :return: The created_at of this Installments.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Installments.


        :param created_at: The created_at of this Installments.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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

        return self.__dict__ == other.__dict__

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