# 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 Payment(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 = {
        'payment_id': 'str',
        'transactions': 'list[Transaction]',
        'external_key': 'str',
        'object_id': 'str',
        'payment_number': 'str',
        'amount': 'str',
        'currency': 'str',
        'created_by': 'str',
        'updated_by': 'str',
        'created_at': 'datetime',
        'updated_at': 'datetime',
        'tenant': 'str',
        'account': 'str',
        'payment_method': 'str',
        'object_type': 'int'
    }

    attribute_map = {
        'payment_id': 'payment_id',
        'transactions': 'transactions',
        'external_key': 'external_key',
        'object_id': 'object_id',
        'payment_number': 'payment_number',
        'amount': 'amount',
        'currency': 'currency',
        'created_by': 'created_by',
        'updated_by': 'updated_by',
        'created_at': 'created_at',
        'updated_at': 'updated_at',
        'tenant': 'tenant',
        'account': 'account',
        'payment_method': 'payment_method',
        'object_type': 'object_type'
    }

    def __init__(self, payment_id=None, transactions=None, external_key=None, object_id=None, payment_number=None, amount=None, currency=None, created_by=None, updated_by=None, created_at=None, updated_at=None, tenant=None, account=None, payment_method=None, object_type=None):  # noqa: E501
        """Payment - a model defined in Swagger"""  # noqa: E501
        self._payment_id = None
        self._transactions = None
        self._external_key = None
        self._object_id = None
        self._payment_number = None
        self._amount = None
        self._currency = None
        self._created_by = None
        self._updated_by = None
        self._created_at = None
        self._updated_at = None
        self._tenant = None
        self._account = None
        self._payment_method = None
        self._object_type = None
        self.discriminator = None
        if payment_id is not None:
            self.payment_id = payment_id
        if transactions is not None:
            self.transactions = transactions
        self.external_key = external_key
        if object_id is not None:
            self.object_id = object_id
        self.payment_number = payment_number
        self.amount = amount
        self.currency = currency
        self.created_by = created_by
        self.updated_by = updated_by
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        self.tenant = tenant
        self.account = account
        self.payment_method = payment_method
        if object_type is not None:
            self.object_type = object_type

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


        :return: The payment_id of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._payment_id

    @payment_id.setter
    def payment_id(self, payment_id):
        """Sets the payment_id of this Payment.


        :param payment_id: The payment_id of this Payment.  # noqa: E501
        :type: str
        """

        self._payment_id = payment_id

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


        :return: The transactions of this Payment.  # noqa: E501
        :rtype: list[Transaction]
        """
        return self._transactions

    @transactions.setter
    def transactions(self, transactions):
        """Sets the transactions of this Payment.


        :param transactions: The transactions of this Payment.  # noqa: E501
        :type: list[Transaction]
        """

        self._transactions = transactions

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


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

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


        :param external_key: The external_key of this Payment.  # 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 object_id(self):
        """Gets the object_id of this Payment.  # noqa: E501


        :return: The object_id of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._object_id

    @object_id.setter
    def object_id(self, object_id):
        """Sets the object_id of this Payment.


        :param object_id: The object_id of this Payment.  # noqa: E501
        :type: str
        """

        self._object_id = object_id

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


        :return: The payment_number of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._payment_number

    @payment_number.setter
    def payment_number(self, payment_number):
        """Sets the payment_number of this Payment.


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

        self._payment_number = payment_number

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


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

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


        :param amount: The amount of this Payment.  # 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 Payment.  # noqa: E501


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

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


        :param currency: The currency of this Payment.  # 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 created_by(self):
        """Gets the created_by of this Payment.  # noqa: E501


        :return: The created_by of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """Sets the created_by of this Payment.


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

        self._created_by = created_by

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


        :return: The updated_by of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._updated_by

    @updated_by.setter
    def updated_by(self, updated_by):
        """Sets the updated_by of this Payment.


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

        self._updated_by = updated_by

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


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

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


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

        self._created_at = created_at

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


        :return: The updated_at of this Payment.  # noqa: E501
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this Payment.


        :param updated_at: The updated_at of this Payment.  # noqa: E501
        :type: datetime
        """

        self._updated_at = updated_at

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


        :return: The tenant of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._tenant

    @tenant.setter
    def tenant(self, tenant):
        """Sets the tenant of this Payment.


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

        self._tenant = tenant

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


        :return: The account of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._account

    @account.setter
    def account(self, account):
        """Sets the account of this Payment.


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

        self._account = account

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


        :return: The payment_method of this Payment.  # noqa: E501
        :rtype: str
        """
        return self._payment_method

    @payment_method.setter
    def payment_method(self, payment_method):
        """Sets the payment_method of this Payment.


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

        self._payment_method = payment_method

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


        :return: The object_type of this Payment.  # noqa: E501
        :rtype: int
        """
        return self._object_type

    @object_type.setter
    def object_type(self, object_type):
        """Sets the object_type of this Payment.


        :param object_type: The object_type of this Payment.  # noqa: E501
        :type: int
        """

        self._object_type = object_type

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

        return self.__dict__ == other.__dict__

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