# 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 Transaction(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 = {
        'transaction_id': 'str',
        'external_key': 'str',
        'payment_external_key': 'str',
        'amount': 'str',
        'currency': 'str',
        'processed_amount': 'str',
        'processed_currency': 'str',
        'type': 'str',
        'status': 'str',
        'gateway_error_code': 'str',
        'gateway_error_message': 'str',
        'refference_id': 'str',
        'plugin_properties': 'object',
        'effective_at': 'datetime',
        'created_at': 'datetime',
        'updated_at': 'datetime',
        'deleted_at': 'datetime',
        'account': 'str',
        'payment': 'str'
    }

    attribute_map = {
        'transaction_id': 'transaction_id',
        'external_key': 'external_key',
        'payment_external_key': 'payment_external_key',
        'amount': 'amount',
        'currency': 'currency',
        'processed_amount': 'processed_amount',
        'processed_currency': 'processed_currency',
        'type': 'type',
        'status': 'status',
        'gateway_error_code': 'gateway_error_code',
        'gateway_error_message': 'gateway_error_message',
        'refference_id': 'refference_id',
        'plugin_properties': 'plugin_properties',
        'effective_at': 'effective_at',
        'created_at': 'created_at',
        'updated_at': 'updated_at',
        'deleted_at': 'deleted_at',
        'account': 'account',
        'payment': 'payment'
    }

    def __init__(self, transaction_id=None, external_key=None, payment_external_key=None, amount=None, currency=None, processed_amount=None, processed_currency=None, type=None, status=None, gateway_error_code=None, gateway_error_message=None, refference_id=None, plugin_properties=None, effective_at=None, created_at=None, updated_at=None, deleted_at=None, account=None, payment=None):  # noqa: E501
        """Transaction - a model defined in Swagger"""  # noqa: E501
        self._transaction_id = None
        self._external_key = None
        self._payment_external_key = None
        self._amount = None
        self._currency = None
        self._processed_amount = None
        self._processed_currency = None
        self._type = None
        self._status = None
        self._gateway_error_code = None
        self._gateway_error_message = None
        self._refference_id = None
        self._plugin_properties = None
        self._effective_at = None
        self._created_at = None
        self._updated_at = None
        self._deleted_at = None
        self._account = None
        self._payment = None
        self.discriminator = None
        if transaction_id is not None:
            self.transaction_id = transaction_id
        self.external_key = external_key
        if payment_external_key is not None:
            self.payment_external_key = payment_external_key
        if amount is not None:
            self.amount = amount
        if currency is not None:
            self.currency = currency
        if processed_amount is not None:
            self.processed_amount = processed_amount
        if processed_currency is not None:
            self.processed_currency = processed_currency
        self.type = type
        self.status = status
        if gateway_error_code is not None:
            self.gateway_error_code = gateway_error_code
        if gateway_error_message is not None:
            self.gateway_error_message = gateway_error_message
        if refference_id is not None:
            self.refference_id = refference_id
        if plugin_properties is not None:
            self.plugin_properties = plugin_properties
        if effective_at is not None:
            self.effective_at = effective_at
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        if deleted_at is not None:
            self.deleted_at = deleted_at
        self.account = account
        self.payment = payment

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


        :return: The transaction_id of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._transaction_id

    @transaction_id.setter
    def transaction_id(self, transaction_id):
        """Sets the transaction_id of this Transaction.


        :param transaction_id: The transaction_id of this Transaction.  # noqa: E501
        :type: str
        """

        self._transaction_id = transaction_id

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


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

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


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


        :return: The payment_external_key of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._payment_external_key

    @payment_external_key.setter
    def payment_external_key(self, payment_external_key):
        """Sets the payment_external_key of this Transaction.


        :param payment_external_key: The payment_external_key of this Transaction.  # noqa: E501
        :type: str
        """

        self._payment_external_key = payment_external_key

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


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

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


        :param amount: The amount of this Transaction.  # noqa: E501
        :type: str
        """

        self._amount = amount

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


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

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


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


        :return: The processed_amount of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._processed_amount

    @processed_amount.setter
    def processed_amount(self, processed_amount):
        """Sets the processed_amount of this Transaction.


        :param processed_amount: The processed_amount of this Transaction.  # noqa: E501
        :type: str
        """

        self._processed_amount = processed_amount

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


        :return: The processed_currency of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._processed_currency

    @processed_currency.setter
    def processed_currency(self, processed_currency):
        """Sets the processed_currency of this Transaction.


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

        self._processed_currency = processed_currency

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


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

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


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

        self._type = type

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


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

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


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

        self._status = status

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


        :return: The gateway_error_code of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._gateway_error_code

    @gateway_error_code.setter
    def gateway_error_code(self, gateway_error_code):
        """Sets the gateway_error_code of this Transaction.


        :param gateway_error_code: The gateway_error_code of this Transaction.  # noqa: E501
        :type: str
        """

        self._gateway_error_code = gateway_error_code

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


        :return: The gateway_error_message of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._gateway_error_message

    @gateway_error_message.setter
    def gateway_error_message(self, gateway_error_message):
        """Sets the gateway_error_message of this Transaction.


        :param gateway_error_message: The gateway_error_message of this Transaction.  # noqa: E501
        :type: str
        """

        self._gateway_error_message = gateway_error_message

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


        :return: The refference_id of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._refference_id

    @refference_id.setter
    def refference_id(self, refference_id):
        """Sets the refference_id of this Transaction.


        :param refference_id: The refference_id of this Transaction.  # noqa: E501
        :type: str
        """

        self._refference_id = refference_id

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


        :return: The plugin_properties of this Transaction.  # noqa: E501
        :rtype: object
        """
        return self._plugin_properties

    @plugin_properties.setter
    def plugin_properties(self, plugin_properties):
        """Sets the plugin_properties of this Transaction.


        :param plugin_properties: The plugin_properties of this Transaction.  # noqa: E501
        :type: object
        """

        self._plugin_properties = plugin_properties

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


        :return: The effective_at of this Transaction.  # noqa: E501
        :rtype: datetime
        """
        return self._effective_at

    @effective_at.setter
    def effective_at(self, effective_at):
        """Sets the effective_at of this Transaction.


        :param effective_at: The effective_at of this Transaction.  # noqa: E501
        :type: datetime
        """

        self._effective_at = effective_at

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


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

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


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

        self._created_at = created_at

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


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

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


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

        self._updated_at = updated_at

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


        :return: The deleted_at of this Transaction.  # noqa: E501
        :rtype: datetime
        """
        return self._deleted_at

    @deleted_at.setter
    def deleted_at(self, deleted_at):
        """Sets the deleted_at of this Transaction.


        :param deleted_at: The deleted_at of this Transaction.  # noqa: E501
        :type: datetime
        """

        self._deleted_at = deleted_at

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


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

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


        :param account: The account of this Transaction.  # 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(self):
        """Gets the payment of this Transaction.  # noqa: E501


        :return: The payment of this Transaction.  # noqa: E501
        :rtype: str
        """
        return self._payment

    @payment.setter
    def payment(self, payment):
        """Sets the payment of this Transaction.


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

        self._payment = payment

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

        return self.__dict__ == other.__dict__

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