示例#1
0
 def update_me(self, **kwargs):
     data = {
         'name': kwargs.get('name'),
         'email': kwargs.get('email'),
         'password': kwargs.get('password'),
         'status': kwargs.get('status'),
         'attributes': kwargs.get('attributes', None) or dict(),
         'text': kwargs.get('text')
     }
     r = self.http.put('/user/me', data)
     return User.parse(r['user'])
示例#2
0
 def create_user(self, name, email, password, status, roles=None, attributes=None, text='', email_verified=False):
     data = {
         'name': name,
         'email': email,
         'password': password,
         'status': status,
         'roles': roles or list(),
         'attributes': attributes or dict(),
         'text': text,
         'email_verified': email_verified
     }
     r = self.http.post('/user', data)
     return User.parse(r['user'])
示例#3
0
 def update_user(self, id, **kwargs):
     data = {
         'name': kwargs.get('name'),
         'email': kwargs.get('email'),
         'password': kwargs.get('password'),
         'status': kwargs.get('status'),
         'roles': kwargs.get('roles', None) or list(),
         'attributes': kwargs.get('attributes', None) or dict(),
         'text': kwargs.get('text'),
         'email_verified': kwargs.get('email_verified')
     }
     r = self.http.put('/user/{}'.format(id), data)
     return User.parse(r['user'])
示例#4
0
 def create_user(self, name, email, password, status, roles=None, attributes=None, text='', email_verified=False):
     data = {
         'name': name,
         'email': email,
         'password': password,
         'status': status,
         'roles': roles or list(),
         'attributes': attributes or dict(),
         'text': text,
         'email_verified': email_verified
     }
     r = self.http.post('/user', data)
     return User.parse(r['user'])
示例#5
0
 def get_users(self, query=None):
     r = self.http.get('/users', query)
     return [User.parse(u) for u in r['users']]
示例#6
0
 def get_group_users(self, id):
     r = self.http.get('/group/{}/users'.format(id))
     return [User.parse(u) for u in r['users']]
示例#7
0
 def get_users(self, query=None):
     r = self.http.get('/users', query)
     return [User.parse(u) for u in r['users']]
示例#8
0
 def get_me(self):
     return User.parse(self.http.get('/user/me')['user'])
示例#9
0
 def get_group_users(self, id):
     r = self.http.get('/group/{}/users'.format(id))
     return [User.parse(u) for u in r['users']]
示例#10
0
 def get_me(self):
     return User.parse(self.http.get('/user/me')['user'])
示例#11
0
 def get_user(self):
     return User.parse(self.http.get('/user/%s' % id)['user'])
示例#12
0
 def get_group_users(self, id):
     r = self.http.get(f'/group/{id}/users')
     return [User.parse(u) for u in r['users']]