# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

    OpenAPI spec version: 4.11.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from swagger_client.configuration import Configuration


class TransferView(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 = {
        'parent': 'Transfer',
        'children': 'list[Transfer]',
        'charged_back_by': 'Transfer',
        'chargeback_of': 'Transfer',
        'transaction': 'TransactionView',
        'a_rate': 'BigDecimal',
        'd_rate': 'BigDecimal',
        'status_flows': 'list[TransferStatusFlowForTransferView]',
        'can_chargeback': 'bool',
        'operations': 'list[Operation]',
        'confirmation_password_input': 'PasswordInput',
        'users_which_can_add_to_contacts': 'TransactionSubjectsEnum',
        'users_which_can_view_profile': 'TransactionSubjectsEnum'
    }

    attribute_map = {
        'parent': 'parent',
        'children': 'children',
        'charged_back_by': 'chargedBackBy',
        'chargeback_of': 'chargebackOf',
        'transaction': 'transaction',
        'a_rate': 'ARate',
        'd_rate': 'DRate',
        'status_flows': 'statusFlows',
        'can_chargeback': 'canChargeback',
        'operations': 'operations',
        'confirmation_password_input': 'confirmationPasswordInput',
        'users_which_can_add_to_contacts': 'usersWhichCanAddToContacts',
        'users_which_can_view_profile': 'usersWhichCanViewProfile'
    }

    def __init__(self, parent=None, children=None, charged_back_by=None, chargeback_of=None, transaction=None, a_rate=None, d_rate=None, status_flows=None, can_chargeback=None, operations=None, confirmation_password_input=None, users_which_can_add_to_contacts=None, users_which_can_view_profile=None, _configuration=None):  # noqa: E501
        """TransferView - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._parent = None
        self._children = None
        self._charged_back_by = None
        self._chargeback_of = None
        self._transaction = None
        self._a_rate = None
        self._d_rate = None
        self._status_flows = None
        self._can_chargeback = None
        self._operations = None
        self._confirmation_password_input = None
        self._users_which_can_add_to_contacts = None
        self._users_which_can_view_profile = None
        self.discriminator = None

        if parent is not None:
            self.parent = parent
        if children is not None:
            self.children = children
        if charged_back_by is not None:
            self.charged_back_by = charged_back_by
        if chargeback_of is not None:
            self.chargeback_of = chargeback_of
        if transaction is not None:
            self.transaction = transaction
        if a_rate is not None:
            self.a_rate = a_rate
        if d_rate is not None:
            self.d_rate = d_rate
        if status_flows is not None:
            self.status_flows = status_flows
        if can_chargeback is not None:
            self.can_chargeback = can_chargeback
        if operations is not None:
            self.operations = operations
        if confirmation_password_input is not None:
            self.confirmation_password_input = confirmation_password_input
        if users_which_can_add_to_contacts is not None:
            self.users_which_can_add_to_contacts = users_which_can_add_to_contacts
        if users_which_can_view_profile is not None:
            self.users_which_can_view_profile = users_which_can_view_profile

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

        Reference to the parent transfer that generated this one, if any   # noqa: E501

        :return: The parent of this TransferView.  # noqa: E501
        :rtype: Transfer
        """
        return self._parent

    @parent.setter
    def parent(self, parent):
        """Sets the parent of this TransferView.

        Reference to the parent transfer that generated this one, if any   # noqa: E501

        :param parent: The parent of this TransferView.  # noqa: E501
        :type: Transfer
        """

        self._parent = parent

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

        Reference to the transfers generated by this one, if any   # noqa: E501

        :return: The children of this TransferView.  # noqa: E501
        :rtype: list[Transfer]
        """
        return self._children

    @children.setter
    def children(self, children):
        """Sets the children of this TransferView.

        Reference to the transfers generated by this one, if any   # noqa: E501

        :param children: The children of this TransferView.  # noqa: E501
        :type: list[Transfer]
        """

        self._children = children

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

        Reference to the transfer that has charged back this transfer. Only returned if this transfer has been charged back.   # noqa: E501

        :return: The charged_back_by of this TransferView.  # noqa: E501
        :rtype: Transfer
        """
        return self._charged_back_by

    @charged_back_by.setter
    def charged_back_by(self, charged_back_by):
        """Sets the charged_back_by of this TransferView.

        Reference to the transfer that has charged back this transfer. Only returned if this transfer has been charged back.   # noqa: E501

        :param charged_back_by: The charged_back_by of this TransferView.  # noqa: E501
        :type: Transfer
        """

        self._charged_back_by = charged_back_by

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

        Reference to the transfer that this transfer has charged back. Only returned if this transfer is a chargeback.   # noqa: E501

        :return: The chargeback_of of this TransferView.  # noqa: E501
        :rtype: Transfer
        """
        return self._chargeback_of

    @chargeback_of.setter
    def chargeback_of(self, chargeback_of):
        """Sets the chargeback_of of this TransferView.

        Reference to the transfer that this transfer has charged back. Only returned if this transfer is a chargeback.   # noqa: E501

        :param chargeback_of: The chargeback_of of this TransferView.  # noqa: E501
        :type: Transfer
        """

        self._chargeback_of = chargeback_of

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

        If this balance transfer was originated from a transaction (like a payment or scheduled payment), contains the reference to this transaction. Only returned if this `TransferView` is not already in a `TransactionView`.   # noqa: E501

        :return: The transaction of this TransferView.  # noqa: E501
        :rtype: TransactionView
        """
        return self._transaction

    @transaction.setter
    def transaction(self, transaction):
        """Sets the transaction of this TransferView.

        If this balance transfer was originated from a transaction (like a payment or scheduled payment), contains the reference to this transaction. Only returned if this `TransferView` is not already in a `TransactionView`.   # noqa: E501

        :param transaction: The transaction of this TransferView.  # noqa: E501
        :type: TransactionView
        """

        self._transaction = transaction

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

        The balance aging counter  # noqa: E501

        :return: The a_rate of this TransferView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._a_rate

    @a_rate.setter
    def a_rate(self, a_rate):
        """Sets the a_rate of this TransferView.

        The balance aging counter  # noqa: E501

        :param a_rate: The a_rate of this TransferView.  # noqa: E501
        :type: BigDecimal
        """

        self._a_rate = a_rate

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

        The balance maturity  # noqa: E501

        :return: The d_rate of this TransferView.  # noqa: E501
        :rtype: BigDecimal
        """
        return self._d_rate

    @d_rate.setter
    def d_rate(self, d_rate):
        """Sets the d_rate of this TransferView.

        The balance maturity  # noqa: E501

        :param d_rate: The d_rate of this TransferView.  # noqa: E501
        :type: BigDecimal
        """

        self._d_rate = d_rate

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

        List with each status this transfer has, with additional information, such as the flow and the log   # noqa: E501

        :return: The status_flows of this TransferView.  # noqa: E501
        :rtype: list[TransferStatusFlowForTransferView]
        """
        return self._status_flows

    @status_flows.setter
    def status_flows(self, status_flows):
        """Sets the status_flows of this TransferView.

        List with each status this transfer has, with additional information, such as the flow and the log   # noqa: E501

        :param status_flows: The status_flows of this TransferView.  # noqa: E501
        :type: list[TransferStatusFlowForTransferView]
        """

        self._status_flows = status_flows

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

        Can the authenticated user chargeback this transfer?   # noqa: E501

        :return: The can_chargeback of this TransferView.  # noqa: E501
        :rtype: bool
        """
        return self._can_chargeback

    @can_chargeback.setter
    def can_chargeback(self, can_chargeback):
        """Sets the can_chargeback of this TransferView.

        Can the authenticated user chargeback this transfer?   # noqa: E501

        :param can_chargeback: The can_chargeback of this TransferView.  # noqa: E501
        :type: bool
        """

        self._can_chargeback = can_chargeback

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

        The list of custom operations the logged user can run over this transfer   # noqa: E501

        :return: The operations of this TransferView.  # noqa: E501
        :rtype: list[Operation]
        """
        return self._operations

    @operations.setter
    def operations(self, operations):
        """Sets the operations of this TransferView.

        The list of custom operations the logged user can run over this transfer   # noqa: E501

        :param operations: The operations of this TransferView.  # noqa: E501
        :type: list[Operation]
        """

        self._operations = operations

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

        If a confirmation password is used, contains the definitions on how to request that password from the user. This confirmation password is required when performing sensible actions. Sometimes this is dynamic, for example, the confirmation might be configured to be used only once per session, or operations like payments may have a limit per day to be without confirmation (pinless).   # noqa: E501

        :return: The confirmation_password_input of this TransferView.  # noqa: E501
        :rtype: PasswordInput
        """
        return self._confirmation_password_input

    @confirmation_password_input.setter
    def confirmation_password_input(self, confirmation_password_input):
        """Sets the confirmation_password_input of this TransferView.

        If a confirmation password is used, contains the definitions on how to request that password from the user. This confirmation password is required when performing sensible actions. Sometimes this is dynamic, for example, the confirmation might be configured to be used only once per session, or operations like payments may have a limit per day to be without confirmation (pinless).   # noqa: E501

        :param confirmation_password_input: The confirmation_password_input of this TransferView.  # noqa: E501
        :type: PasswordInput
        """

        self._confirmation_password_input = confirmation_password_input

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

        Reference to none, one of (from or to) or both subjects of a transaction (or transfer)  Possible values are: * both: Reference to both from and to subjects of the transaction * from: Reference to the transaction from * none: Reference to none of the transaction subjects * to: Reference to the transaction to   # noqa: E501

        :return: The users_which_can_add_to_contacts of this TransferView.  # noqa: E501
        :rtype: TransactionSubjectsEnum
        """
        return self._users_which_can_add_to_contacts

    @users_which_can_add_to_contacts.setter
    def users_which_can_add_to_contacts(self, users_which_can_add_to_contacts):
        """Sets the users_which_can_add_to_contacts of this TransferView.

        Reference to none, one of (from or to) or both subjects of a transaction (or transfer)  Possible values are: * both: Reference to both from and to subjects of the transaction * from: Reference to the transaction from * none: Reference to none of the transaction subjects * to: Reference to the transaction to   # noqa: E501

        :param users_which_can_add_to_contacts: The users_which_can_add_to_contacts of this TransferView.  # noqa: E501
        :type: TransactionSubjectsEnum
        """

        self._users_which_can_add_to_contacts = users_which_can_add_to_contacts

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

        Reference to none, one of (from or to) or both subjects of a transaction (or transfer)  Possible values are: * both: Reference to both from and to subjects of the transaction * from: Reference to the transaction from * none: Reference to none of the transaction subjects * to: Reference to the transaction to   # noqa: E501

        :return: The users_which_can_view_profile of this TransferView.  # noqa: E501
        :rtype: TransactionSubjectsEnum
        """
        return self._users_which_can_view_profile

    @users_which_can_view_profile.setter
    def users_which_can_view_profile(self, users_which_can_view_profile):
        """Sets the users_which_can_view_profile of this TransferView.

        Reference to none, one of (from or to) or both subjects of a transaction (or transfer)  Possible values are: * both: Reference to both from and to subjects of the transaction * from: Reference to the transaction from * none: Reference to none of the transaction subjects * to: Reference to the transaction to   # noqa: E501

        :param users_which_can_view_profile: The users_which_can_view_profile of this TransferView.  # noqa: E501
        :type: TransactionSubjectsEnum
        """

        self._users_which_can_view_profile = users_which_can_view_profile

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

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