'The constructor allows to create a customizable Transaction.
Note:
When no `version` is provided, one is being
generated by this method.
Args:
operation (str): Defines the operation of the Transaction.
asset (dict): Asset payload for this Transaction.
inputs (:obj:`list` of :class:`~bigchaindb.common.
transaction.Input`, optional): Define the assets to
outputs (:obj:`list` of :class:`~bigchaindb.common.
transaction.Output`, optional): Define the assets to
lock.
metadata (dict): Metadata to be stored along with the
Transaction.
version (string): Defines the version number of a Transaction.'

def __init__(self, operation, asset, inputs=None, outputs=None, metadata=None, version=None):

    if (operation not in Transaction.ALLOWED_OPERATIONS):
        allowed_ops = ',    '.join(self.__class__.ALLOWED_OPERATIONS)
        raise ValueError('`operation`    must    be    one    of    {}'.format(allowed_ops))
    if ((operation in [Transaction.CREATE, Transaction.GENESIS]) and (asset is not None) and (not (isinstance(asset, dict) and ('data' in asset)))):
        raise TypeError("`asset`    must    be    None    or    a    dict    holding    a    `data`        property    instance    for    '{}'    Transactions".format(operation))
    elif ((operation == Transaction.TRANSFER) and (not (isinstance(asset, dict) and ('id' in asset)))):
        raise TypeError("`asset`    must    be    a    dict    holding    an    `id`    property    for    'TRANSFER'    Transactions".format(operation))
    if (outputs and (not isinstance(outputs, list))):
        raise TypeError('`outputs`    must    be    a    list    instance    or    None')
    if (inputs and (not isinstance(inputs, list))):
        raise TypeError('`inputs`    must    be    a    list    instance    or    None')
    if ((metadata is not None) and (not isinstance(metadata, dict))):
        raise TypeError('`metadata`    must    be    a    dict    or    None')
    self.version = (version if (version is not None) else self.VERSION)
    self.operation = operation
    self.asset = asset
    self.inputs = (inputs or [])
    self.outputs = (outputs or [])
    self.metadata = metadata
