Пример #1
0
 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))
Пример #2
0
 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'])
Пример #3
0
 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))
Пример #4
0
 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))
Пример #5
0
 def current(self):
     '''Returns a json structure containing the details of the active account.'''
     return Account(self, **self.get('/v2/accounts/current'))