def create_customer(self, customer, match): data = { 'customer': customer, 'match': match } r = self.http.post('/customer', data) return Customer.parse(r['customer'])
def update_customer(self, id, **kwargs): data = { 'match': kwargs.get('match'), 'customer': kwargs.get('customer') } r = self.http.put('/customer/{}'.format(id), data) return Customer.parse(r['customer'])
def get_customers(self, query=None): r = self.http.get('/customers', query) return [Customer.parse(c) for c in r['customers']]
def get_customer(self): return Customer.parse(self.http.get('/customer/%s' % id)['customer'])