# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function

from .resources.transaction import Transaction


class Transactions(object):
    def __init__(self, client):
        self.requestor = client.requestor
        self.configuration = client.configuration

    def all(self):
        status_code, response = self.requestor.request("get", "/api/v1/transactions/")
        return list(map(Transaction, response.get('transactions', [])))

    def detail(self, uuid):
        status_code, response = self.requestor.request("get", "/api/v1/transactions/%s" % uuid)
        return Transaction(response)

    def update(self, uuid, metadata):
        raise NotImplemented("Transaction update is not implemented")
