def create_group(self, name, text): data = { 'name': name, 'text': text } r = self.http.post('/group', data) return Group.parse(r['group'])
def update_group(self, id, **kwargs): data = { 'name': kwargs.get('name'), 'text': kwargs.get('text') } r = self.http.put('/group/{}'.format(id), data) return Group.parse(r['group'])
def get_users_groups(self, query=None): r = self.http.get('/groups', query) return [Group.parse(g) for g in r['groups']]
def get_group(self): return Group.parse(self.http.get('/group/%s' % id)['group'])
def get_user_groups(self, id): r = self.http.get('/user/{}/groups'.format(id)) return [Group.parse(g) for g in r['groups']]
def get_user_groups(self, id): r = self.http.get(f'/user/{id}/groups') return [Group.parse(g) for g in r['groups']]