@@ 57-81 (lines=25) @@ | ||
54 | } |
|
55 | ) |
|
56 | ||
57 | def update(self, user_id, name=None, department=None, position=None, |
|
58 | mobile=None, gender=None, tel=None, email=None, |
|
59 | weixin_id=None, enable=None, extattr=None, **kwargs): |
|
60 | """ |
|
61 | 更新成员 |
|
62 | ||
63 | https://work.weixin.qq.com/api/doc#90000/90135/90197 |
|
64 | """ |
|
65 | user_data = optionaldict() |
|
66 | user_data['userid'] = user_id |
|
67 | user_data['name'] = name |
|
68 | user_data['gender'] = gender |
|
69 | user_data['department'] = department |
|
70 | user_data['position'] = position |
|
71 | user_data['mobile'] = mobile |
|
72 | user_data['tel'] = tel |
|
73 | user_data['email'] = email |
|
74 | user_data['weixinid'] = weixin_id |
|
75 | user_data['extattr'] = extattr |
|
76 | user_data['enable'] = enable |
|
77 | user_data.update(kwargs) |
|
78 | ||
79 | return self._post( |
|
80 | 'user/update', |
|
81 | data=user_data |
|
82 | ) |
|
83 | ||
84 | def delete(self, user_id): |
|
@@ 18-41 (lines=24) @@ | ||
15 | 邀请成员接口位于 `WeChatBatch.invite` |
|
16 | """ |
|
17 | ||
18 | def create(self, user_id, name, department=None, position=None, |
|
19 | mobile=None, gender=0, tel=None, email=None, |
|
20 | weixin_id=None, extattr=None, **kwargs): |
|
21 | """ |
|
22 | 创建成员 |
|
23 | ||
24 | https://work.weixin.qq.com/api/doc#90000/90135/90195 |
|
25 | """ |
|
26 | user_data = optionaldict() |
|
27 | user_data['userid'] = user_id |
|
28 | user_data['name'] = name |
|
29 | user_data['gender'] = gender |
|
30 | user_data['department'] = department |
|
31 | user_data['position'] = position |
|
32 | user_data['mobile'] = mobile |
|
33 | user_data['tel'] = tel |
|
34 | user_data['email'] = email |
|
35 | user_data['weixinid'] = weixin_id |
|
36 | user_data['extattr'] = extattr |
|
37 | user_data.update(kwargs) |
|
38 | ||
39 | return self._post( |
|
40 | 'user/create', |
|
41 | data=user_data |
|
42 | ) |
|
43 | ||
44 | def get(self, user_id): |