def update(self, resource_id, **kwargs): ''' Updates an existing account and returns a json structure containing the details of the requested account. ''' return Account(self, **self.post('/v2/accounts/' + resource_id, kwargs))
def find(self, **kwargs): ''' Return an array containing json structures of details of the accounts matching the search criteria for the logged in user. ''' response = self.get('/v2/accounts/find', query=kwargs) data = [Account(self, **fields) for fields in response['accounts']] return PaginatedCollection(data, response['pagination'])
def create(self, **kwargs): ''' Creates a new account and returns a json structure containing the details of the requested account. ''' return Account(self, **self.post('/v2/accounts/create', kwargs))
def retrieve(self, resource_id, **kwargs): '''Returns a json structure containing the details of the requested account.''' return Account(self, **self.get('/v2/accounts/' + resource_id, query=kwargs))
def current(self): '''Returns a json structure containing the details of the active account.''' return Account(self, **self.get('/v2/accounts/current'))