NIM PC Cross Platform SDK
nim_qchat_role_cpp_def.h
Go to the documentation of this file.
1
11#ifndef __NIM_QCHAT_IDENTITY_CPP_DEF_H__
12#define __NIM_QCHAT_IDENTITY_CPP_DEF_H__
13
14#include <iostream>
17#include "nim_qchat_helper.h"
18#include "nim_qchat_role_def.h"
19
20namespace nim_qchat {
21
23using QChatPermission = std::map<uint32_t, NIMQChatPermissionsOption>;
24
26struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRoleMemberInfo {
28 QChatMemberInfo member_info{};
30 uint64_t role_id{0};
31 QChatRoleMemberInfo() = default;
33 member_info = c_param.member_info;
34 role_id = c_param.role_id;
35 }
36 const NIMQChatRoleMemberInfo ToCParam() const {
37 NIMQChatRoleMemberInfo c_param = {};
38 c_param.member_info = member_info.ToCParam();
39 c_param.role_id = role_id;
40 return c_param;
41 }
42};
43
45struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRoleInfoBase {
47 uint64_t server_id = 0;
49 uint64_t role_id = 0;
51 std::string role_name;
53 std::string role_icon;
55 std::string extension;
57 QChatPermission permissions{};
61 uint64_t create_time = 0;
63 uint64_t update_time = 0;
64 QChatRoleInfoBase() = default;
66 server_id = info.server_id;
67 role_id = info.role_id;
68 role_name = info.role_name;
69 role_icon = info.role_icon;
70 extension = info.extension;
71 for (size_t i = 0; i < info.permissions_count; i++) {
72 auto permission = info.permissions[i].permission;
73 auto option = info.permissions[i].option;
74 permissions.emplace(permission, option);
75 }
76 role_type = info.role_type;
77 create_time = info.create_time;
78 update_time = info.update_time;
79 }
80 const NIMQChatRoleInfo ToCParam() const {
81 NIMQChatRoleInfo c_param;
82 c_param.server_id = server_id;
83 c_param.role_id = role_id;
84 c_param.role_type = role_type;
85 c_param.role_name = const_cast<char*>(role_name.c_str());
86 c_param.role_icon = const_cast<char*>(role_icon.c_str());
87 c_param.extension = const_cast<char*>(extension.c_str());
88 vec_permissions.clear();
89 for (auto&& permission : permissions) {
91 perms.permission = permission.first;
92 perms.option = permission.second;
93 vec_permissions.push_back(perms);
94 }
95 c_param.permissions = vec_permissions.data();
96 c_param.permissions_count = vec_permissions.size();
97 c_param.create_time = create_time;
98 c_param.update_time = update_time;
99 return c_param;
100 }
101
102protected:
103 mutable std::vector<NIMQChatPermissionGroup> vec_permissions;
104};
105
107struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatServerRoleInfo : public QChatRoleInfoBase {
109 uint32_t member_count = 0;
111 uint64_t priority = 0;
112 QChatServerRoleInfo() = default;
114 : QChatRoleInfoBase(info) {
115 member_count = info.server_role.member_count;
116 priority = info.server_role.priority;
117 }
118 const NIMQChatRoleInfo ToCParam() const {
119 auto c_param = QChatRoleInfoBase::ToCParam();
120 c_param.server_role.member_count = member_count;
121 c_param.server_role.priority = priority;
122 return c_param;
123 }
124};
125
127struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatChannelRoleInfo : public QChatRoleInfoBase {
129 uint64_t channel_id = 0;
131 uint64_t parent_role_id = 0;
132 QChatChannelRoleInfo() = default;
134 : QChatRoleInfoBase(info) {
135 channel_id = info.channel_role.channel_id;
136 parent_role_id = info.channel_role.parent_role_id;
137 }
138 const NIMQChatRoleInfo ToCParam() const {
139 auto c_param = QChatRoleInfoBase::ToCParam();
140 c_param.channel_role.channel_id = channel_id;
141 c_param.channel_role.parent_role_id = parent_role_id;
142 return c_param;
143 }
144};
145
147struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatChannelCategoryRoleInfo : public QChatRoleInfoBase {
149 uint64_t category_id{0};
151 uint64_t parent_role_id{0};
153 bool valid_flag{true};
156 : QChatRoleInfoBase(info) {
157 category_id = info.channel_category_role.category_id;
158 parent_role_id = info.channel_category_role.parent_role_id;
159 valid_flag = info.channel_category_role.valid_flag;
160 }
161 const NIMQChatRoleInfo ToCParam() const {
162 auto c_param = QChatRoleInfoBase::ToCParam();
163 c_param.channel_category_role.category_id = category_id;
164 c_param.channel_category_role.parent_role_id = parent_role_id;
165 c_param.channel_category_role.valid_flag = valid_flag;
166 return c_param;
167 }
168};
169
171struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatMemberRoleInfo {
173 uint64_t channel_id{0};
175 uint64_t role_id{0};
177 QChatMemberInfo member_info{};
179 QChatPermission permissions{};
181 uint64_t create_time{0};
183 uint64_t update_time{0};
184 QChatMemberRoleInfo() = default;
186 : member_info(info.member_info) {
187 channel_id = info.channel_id;
188 role_id = info.role_id;
189 for (size_t i = 0; i < info.permissions_count; i++) {
190 permissions.emplace(info.permissions[i].permission, info.permissions[i].option);
191 }
192 create_time = info.create_time;
193 update_time = info.update_time;
194 }
195 const NIMQChatMemberRoleInfo ToCParam() const {
197 c_param.channel_id = channel_id;
198 c_param.role_id = role_id;
199 c_param.member_info = member_info.ToCParam();
200 vec_permissions.clear();
201 for (auto&& permission : permissions) {
203 perms.permission = permission.first;
204 perms.option = permission.second;
205 vec_permissions.push_back(perms);
206 }
207 c_param.permissions = vec_permissions.data();
208 c_param.permissions_count = vec_permissions.size();
209 c_param.create_time = create_time;
210 c_param.update_time = update_time;
211 return c_param;
212 }
213
214protected:
215 mutable std::vector<NIMQChatPermissionGroup> vec_permissions;
216};
217
219struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatChannelCategoryMemberRoleInfo {
221 uint64_t category_id{0};
223 uint64_t role_id{0};
225 QChatMemberInfo member_info{};
227 QChatPermission permissions{};
229 uint64_t create_time{0};
231 uint64_t update_time{0};
234 : member_info(info.member_info) {
235 category_id = info.category_id;
236 role_id = info.role_id;
237 for (size_t i = 0; i < info.permissions_count; i++) {
238 permissions.emplace(info.permissions[i].permission, info.permissions[i].option);
239 }
240 create_time = info.create_time;
241 update_time = info.update_time;
242 }
243 const NIMQChatChannelCategoryMemberRoleInfo ToCParam() const {
245 c_param.category_id = category_id;
246 c_param.role_id = role_id;
247 c_param.member_info = member_info.ToCParam();
248 vec_permissions.clear();
249 for (auto&& permission : permissions) {
251 perms.permission = permission.first;
252 perms.option = permission.second;
253 vec_permissions.push_back(perms);
254 }
255 c_param.permissions = vec_permissions.data();
256 c_param.permissions_count = vec_permissions.size();
257 c_param.create_time = create_time;
258 c_param.update_time = update_time;
259 return c_param;
260 }
261
262protected:
263 mutable std::vector<NIMQChatPermissionGroup> vec_permissions;
264};
265
266/* ---------------------------------------------------------- */
267
269struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCreateServerRoleResp {
272 QChatServerRoleInfo role_info;
273 QChatCreateServerRoleResp() = default;
275 res_code = c_resp.res_code;
276 if (c_resp.res_code != kNIMResSuccess)
277 return;
278 role_info = QChatServerRoleInfo(c_resp.role_info);
279 }
280 const NIMQChatCreateServerRoleResp ToCParam() const {
282 c_resp.res_code = res_code;
283 c_resp.role_info = role_info.ToCParam();
284 return c_resp;
285 }
286
287protected:
288 mutable std::vector<NIMQChatPermissionGroup> permissions_;
289 mutable NIMQChatServerRoleInfo server_role_info_;
290};
291
293struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateServerRoleResp {
296 QChatServerRoleInfo role_info;
297 QChatUpdateServerRoleResp() = default;
299 res_code = c_resp.res_code;
300 if (c_resp.res_code != kNIMResSuccess)
301 return;
302 role_info = QChatServerRoleInfo(c_resp.role_info);
303 }
304};
305
307using QChatDeleteServerRoleResp = QChatBaseResp;
308
310struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetServerRolesResp {
314 std::list<QChatServerRoleInfo> role_infos;
316 std::list<QChatServerRoleInfo> joined_roles;
317 QChatGetServerRolesResp() = default;
319 res_code = c_resp.res_code;
320 if (c_resp.res_code != kNIMResSuccess)
321 return;
322 for (size_t i = 0; i < c_resp.role_count; i++) {
323 role_infos.push_back(QChatServerRoleInfo(c_resp.roles[i]));
324 }
325 for (size_t i = 0; i < c_resp.joined_role_count; i++) {
326 joined_roles.push_back(QChatServerRoleInfo(c_resp.joined_roles[i]));
327 }
328 }
329 const NIMQChatGetServerRolesResp ToCParam() const {
330 NIMQChatGetServerRolesResp c_response{};
331 c_response.res_code = res_code;
332 roles_vec.clear();
333 joined_roles_vec.clear();
334 for (auto&& role : role_infos) {
335 auto&& role_info = role.ToCParam();
336 roles_vec.push_back(role_info);
337 }
338 for (auto&& role : joined_roles) {
339 auto&& role_info = role.ToCParam();
340 joined_roles_vec.push_back(role_info);
341 }
342 c_response.roles = roles_vec.data();
343 c_response.role_count = roles_vec.size();
344 c_response.joined_roles = joined_roles_vec.data();
345 c_response.joined_role_count = joined_roles_vec.size();
346 return c_response;
347 }
348
349protected:
350 mutable std::vector<NIMQChatRoleInfo> roles_vec;
351 mutable std::vector<NIMQChatRoleInfo> joined_roles_vec;
352};
353
355using QChatUpdateServerRolePrioritiesResp = QChatGetServerRolesResp;
356
358struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMembersFromServerRoleResp {
361 std::list<QChatRoleMemberInfo> members;
364 res_code = c_resp.res_code;
365 if (c_resp.res_code != kNIMResSuccess)
366 return;
367 for (size_t i = 0; i < c_resp.member_count; i++) {
368 QChatRoleMemberInfo member(c_resp.members[i]);
369 members.push_back(member);
370 }
371 }
372 const NIMQChatGetMembersFromServerRoleResp ToCParam() const {
374 c_response.res_code = res_code;
375 c_response.member_count = members.size();
376 members_.clear();
377 for (auto&& member : members) {
378 members_.push_back(member.ToCParam());
379 }
380 c_response.members = members_.data();
381 return c_response;
382 }
383
384protected:
385 mutable std::vector<NIMQChatRoleMemberInfo> members_;
386};
387
389struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddMembersToServerRoleResp {
393 std::list<std::string> succeed_list;
395 std::list<std::string> failed_list;
396
399 res_code = c_resp.res_code;
400 if (c_resp.res_code != kNIMResSuccess)
401 return;
402 for (size_t i = 0; i < c_resp.succeed_count; i++) {
403 succeed_list.push_back(c_resp.succeed_list[i]);
404 }
405 for (size_t i = 0; i < c_resp.failed_count; i++) {
406 failed_list.push_back(c_resp.failed_list[i]);
407 }
408 }
409 const NIMQChatAddMembersToServerRoleResp ToCParam() const {
411 c_response.res_code = res_code;
412 succeed_members_.clear();
413 failed_members_.clear();
414 for (auto&& member : succeed_list)
415 succeed_members_.push_back(const_cast<char*>(member.c_str()));
416 c_response.succeed_count = succeed_members_.size();
417 c_response.succeed_list = succeed_members_.data();
418 for (auto&& member : failed_list)
419 failed_members_.push_back(const_cast<char*>(member.c_str()));
420 c_response.failed_count = failed_members_.size();
421 c_response.failed_list = failed_members_.data();
422 return c_response;
423 }
424
425protected:
426 mutable std::vector<char*> succeed_members_;
427 mutable std::vector<char*> failed_members_;
428};
429
431using QChatRemoveMembersFromServerRoleResp = QChatAddMembersToServerRoleResp;
432
434struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelRoleResp {
437 QChatChannelRoleInfo role_info{};
438 QChatAddChannelRoleResp() = default;
440 res_code = c_resp.res_code;
441 if (c_resp.res_code != kNIMResSuccess)
442 return;
443 role_info = QChatChannelRoleInfo(c_resp.role_info);
444 }
445 const NIMQChatAddChannelRoleResp ToCParam() const {
447 c_response.res_code = res_code;
448 c_response.role_info = role_info.ToCParam();
449 return c_response;
450 }
451};
452
454using QChatUpdateChannelRoleResp = QChatAddChannelRoleResp;
456using QChatRemoveChannelRoleResp = QChatBaseResp;
457
459struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelCategoryRoleResp {
466 res_code = c_resp.res_code;
467 if (c_resp.res_code != kNIMResSuccess)
468 return;
469 role_info = QChatChannelCategoryRoleInfo(c_resp.role_info);
470 }
471 const NIMQChatAddChannelCategoryRoleResp ToCParam() const {
473 c_response.res_code = res_code;
474 c_response.role_info = role_info.ToCParam();
475 return c_response;
476 }
477};
479using QChatUpdateChannelCategoryRoleResp = QChatAddChannelCategoryRoleResp;
481using QChatRemoveChannelCategoryRoleResp = QChatBaseResp;
482
484struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelRolesResp {
487 std::list<QChatChannelRoleInfo> role_infos;
488
489 QChatGetChannelRolesResp() = default;
491 res_code = c_resp.res_code;
492
493 if (c_resp.res_code != kNIMResSuccess)
494 return;
495 for (size_t i = 0; i < c_resp.role_count; i++) {
496 role_infos.push_back(QChatChannelRoleInfo(c_resp.role_infos[i]));
497 }
498 }
499 const NIMQChatGetChannelRolesResp ToCParam() const {
501 c_response.res_code = res_code;
502 channel_role_infos_.clear();
503 for (auto&& role_info : role_infos) {
504 channel_role_infos_.push_back(role_info.ToCParam());
505 }
506 c_response.role_count = channel_role_infos_.size();
507 c_response.role_infos = channel_role_infos_.data();
508 return c_response;
509 }
510
511protected:
512 mutable std::vector<NIMQChatRoleInfo> channel_role_infos_;
513};
514
516struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelCategoryRolesPageResp {
519 std::list<QChatChannelCategoryRoleInfo> role_infos;
522 res_code = c_resp.res_code;
523 if (c_resp.res_code != kNIMResSuccess)
524 return;
525 for (size_t i = 0; i < c_resp.role_count; i++) {
526 role_infos.push_back(QChatChannelCategoryRoleInfo(c_resp.role_infos[i]));
527 }
528 }
529 const NIMQChatGetChannelCategoryRolesPageResp ToCParam() const {
531 c_response.res_code = res_code;
532 vec_role_infos_.clear();
533 for (auto&& role_info : role_infos) {
534 vec_role_infos_.push_back(role_info.ToCParam());
535 }
536 c_response.role_count = vec_role_infos_.size();
537 c_response.role_infos = vec_role_infos_.data();
538 return c_response;
539 }
540
541protected:
542 mutable std::vector<NIMQChatRoleInfo> vec_role_infos_;
543};
544
546struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddMemberRoleResp {
549 QChatMemberRoleInfo role_info{};
550 QChatAddMemberRoleResp() = default;
552 : role_info(c_resp.role_info) {
553 res_code = c_resp.res_code;
554 }
555 const NIMQChatAddMemberRoleResp ToCParam() const {
556 NIMQChatAddMemberRoleResp c_response{};
557 c_response.res_code = res_code;
558 c_response.role_info = role_info.ToCParam();
559 return c_response;
560 }
561};
562
564using QChatUpdateMemberRoleResp = QChatAddMemberRoleResp;
566using QChatRemoveMemberRoleResp = QChatBaseResp;
567
569struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelCategoryMemberRoleResp {
576 res_code = c_resp.res_code;
577 if (c_resp.res_code != kNIMResSuccess)
578 return;
579 role_info = QChatChannelCategoryMemberRoleInfo(c_resp.role_info);
580 }
581 const NIMQChatAddChannelCategoryMemberRoleResp ToCParam() const {
583 c_response.res_code = res_code;
584 c_response.role_info = role_info.ToCParam();
585 return c_response;
586 }
587};
588
590using QChatUpdateChannelCategoryMemberRoleResp = QChatAddChannelCategoryMemberRoleResp;
592using QChatRemoveChannelCategoryMemberRoleResp = QChatBaseResp;
593
595struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMemberRolesResp {
598 std::list<QChatMemberRoleInfo> role_infos;
599 QChatGetMemberRolesResp() = default;
601 res_code = c_resp.res_code;
602 if (c_resp.res_code != kNIMResSuccess)
603 return;
604 for (size_t i = 0; i < c_resp.member_role_count; i++) {
605 role_infos.push_back(QChatMemberRoleInfo(c_resp.role_infos[i]));
606 }
607 }
608 const NIMQChatGetMemberRolesResp ToCParam() const {
610 c_response.res_code = res_code;
611 role_infos_.clear();
612 for (auto&& channel_member_role : role_infos) {
613 role_infos_.push_back(channel_member_role.ToCParam());
614 }
615
616 c_response.member_role_count = role_infos_.size();
617 c_response.role_infos = role_infos_.data();
618 return c_response;
619 }
620
621protected:
622 mutable std::vector<NIMQChatMemberRoleInfo> role_infos_;
623};
624
626struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelCategoryMemberRolesPageResp {
629 std::list<QChatChannelCategoryMemberRoleInfo> role_infos;
632 res_code = c_resp.res_code;
633 if (c_resp.res_code != kNIMResSuccess)
634 return;
635 for (size_t i = 0; i < c_resp.member_role_count; i++) {
636 role_infos.push_back(QChatChannelCategoryMemberRoleInfo(c_resp.role_infos[i]));
637 }
638 }
639 const NIMQChatGetChannelCategoryMemberRolesPageResp ToCParam() const {
641 c_response.res_code = res_code;
642 role_infos_.clear();
643 for (auto&& channel_member_role : role_infos) {
644 role_infos_.push_back(channel_member_role.ToCParam());
645 }
646 c_response.member_role_count = role_infos_.size();
647 c_response.role_infos = role_infos_.data();
648 return c_response;
649 }
650
651protected:
652 mutable std::vector<NIMQChatChannelCategoryMemberRoleInfo> role_infos_;
653};
654
656using QChatGetRolesByAccidResp = QChatGetServerRolesResp;
657
659struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingServerRolesByAccidsResp {
662 std::map<std::string, std::list<QChatServerRoleInfo>> roles_of_member_ids;
665 res_code = c_response.res_code;
666 if (c_response.res_code != kNIMResSuccess)
667 return;
668 for (size_t i = 0; i < c_response.count; i++) {
669 auto& role_info_of_member = c_response.roles_of_member[i];
670 std::list<QChatServerRoleInfo> roles;
671 for (auto j = 0; j < role_info_of_member.role_count; j++) {
672 QChatServerRoleInfo role_info = role_info_of_member.roles[j];
673 roles.push_back(role_info);
674 }
675 roles_of_member_ids[role_info_of_member.member_id] = roles;
676 }
677 }
678 const NIMQChatGetServerRolesByMemberIdsResp ToCParam() const {
680 c_response.res_code = res_code;
681 c_response.count = roles_of_member_ids.size();
682 role_info_of_members_.clear();
683 c_role_info_of_members_.clear();
684 for (auto& roles_of_member : roles_of_member_ids) {
685 std::vector<NIMQChatRoleInfo> roles;
686 NIMQChatRoleInfoOfMember role_info_of_member;
687 role_info_of_member.member_id = const_cast<char*>(roles_of_member.first.c_str());
688 role_info_of_member.role_count = roles_of_member.second.size();
689 for (auto& role_info : roles_of_member.second) {
690 roles.push_back(role_info.ToCParam());
691 }
692 role_info_of_member.roles = roles.data();
693 c_role_info_of_members_.push_back(std::move(roles));
694 role_info_of_members_.push_back(std::move(role_info_of_member));
695 }
696 c_response.roles_of_member = role_info_of_members_.data();
697 return c_response;
698 }
699
700protected:
701 mutable std::vector<NIMQChatRoleInfoOfMember> role_info_of_members_;
702 mutable std::list<std::vector<NIMQChatRoleInfo>> c_role_info_of_members_;
703};
704
706using QChatGetExistingChannelRolesByServerRoleIdsResp = QChatGetChannelRolesResp;
707
709struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingAccidsOfMemberRolesResp {
712 std::list<std::string> member_ids_result;
715 res_code = c_resp.res_code;
716 if (c_resp.res_code != kNIMResSuccess)
717 return;
718 for (size_t i = 0; i < c_resp.member_ids_count; i++) {
719 member_ids_result.push_back(c_resp.member_ids[i]);
720 }
721 }
722 const NIMQChatGetExistingAccidsOfMemberRolesResp ToCParam() const {
724 c_response.res_code = res_code;
725 member_query_accids_.clear();
726 for (auto&& member_id : member_ids_result) {
727 member_query_accids_.push_back(const_cast<char*>(member_id.c_str()));
728 }
729 c_response.member_ids_count = member_query_accids_.size();
730 c_response.member_ids = member_query_accids_.data();
731 return c_response;
732 }
733
734protected:
735 mutable std::vector<QChatMemberAccountId> member_query_accids_;
736};
737
739using QChatGetExistingAccidsInServerRoleResp = QChatGetExistingAccidsOfMemberRolesResp;
740
742struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCheckPermissionResp {
745 bool has_permission{false};
746 QChatCheckPermissionResp() = default;
748 res_code = c_resp.res_code;
749 if (c_resp.res_code != kNIMResSuccess)
750 return;
751 has_permission = c_resp.has_permission;
752 }
753 const NIMQChatCheckPermissionResp ToCParam() const {
755 c_response.res_code = res_code;
756 c_response.has_permission = has_permission;
757 return c_response;
758 }
759};
760
762struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCheckPermissionsResp {
766 std::map<uint32_t, NIMQChatPermissionsOption> permissions;
767 QChatCheckPermissionsResp() = default;
769 res_code = c_resp.res_code;
770 if (c_resp.res_code != kNIMResSuccess)
771 return;
772 permissions.clear();
773 for (size_t i = 0; i < c_resp.permissions_count; i++) {
774 permissions.emplace(c_resp.permissions[i], c_resp.options[i]);
775 }
776 }
777 const NIMQChatCheckPermissionsResp ToCParam() const {
779 c_response.res_code = res_code;
780 permissions_.clear();
781 options_.clear();
782 for (auto&& permission : permissions) {
783 permissions_.push_back(permission.first);
784 options_.push_back(permission.second);
785 }
786 c_response.permissions_count = permissions_.size();
787 c_response.permissions = permissions_.data();
788 c_response.options = const_cast<NIMQChatPermissionsOption*>(options_.data());
789 return c_response;
790 }
791
792protected:
793 mutable std::vector<uint32_t> permissions_;
794 mutable std::vector<NIMQChatPermissionsOption> options_;
795};
796
797// callbacks
798using QChatCreateServerRoleCallback = std::function<void(const QChatCreateServerRoleResp&)>;
799using QChatUpdateServerRoleCallback = std::function<void(const QChatUpdateServerRoleResp&)>;
800using QChatBatchUpdateServerRolePrioritiesCallback = std::function<void(const QChatUpdateServerRolePrioritiesResp&)>;
801using QChatDeleteServerRoleCallback = QChatBaseCallback;
802using QChatGetServerRolesCallback = std::function<void(const QChatGetServerRolesResp&)>;
803using QChatAddMembersToServerRoleCallback = std::function<void(const QChatAddMembersToServerRoleResp&)>;
804using QChatRemoveMembersFromServerRoleCallback = std::function<void(const QChatRemoveMembersFromServerRoleResp&)>;
805using QChatGetMembersFromServerRoleCallback = std::function<void(const QChatGetMembersFromServerRoleResp&)>;
806using QChatAddChannelRoleCallback = std::function<void(const QChatAddChannelRoleResp&)>;
807using QChatUpdateChannelRoleCallback = std::function<void(const QChatUpdateChannelRoleResp&)>;
808using QChatRemoveChannelRoleCallback = QChatBaseCallback;
809using QChatGetChannelRolesCallback = std::function<void(const QChatGetChannelRolesResp&)>;
810using QChatAddMemberRoleCallback = std::function<void(const QChatAddMemberRoleResp&)>;
811using QChatUpdateMemberRoleCallback = std::function<void(const QChatUpdateMemberRoleResp&)>;
812using QChatRemoveMemberRoleCallback = QChatBaseCallback;
813using QChatGetMemberRoleInChannelCallback = std::function<void(const QChatGetMemberRolesResp&)>;
814using QChatGetRolesByMemberIdCallback = std::function<void(const QChatGetRolesByAccidResp&)>;
815using QChatGetRolesByMemberIdsCallback = std::function<void(const QChatGetExistingServerRolesByAccidsResp&)>;
816using QChatGetExistingRolesInChannelCallback = std::function<void(const QChatGetExistingChannelRolesByServerRoleIdsResp&)>;
817using QChatGetExistingAccidsOfMemberRolesCallback = std::function<void(const QChatGetExistingAccidsOfMemberRolesResp&)>;
818using QChatGetExistingAccidsInServerRoleCallback = std::function<void(const QChatGetExistingAccidsInServerRoleResp&)>;
819using QChatCheckPermissionCallback = std::function<void(const QChatCheckPermissionResp&)>;
820using QChatCheckPermissionsCallback = std::function<void(const QChatCheckPermissionsResp&)>;
821using QChatAddChannelCategoryRoleCallback = std::function<void(const QChatAddChannelCategoryRoleResp&)>;
822using QChatUpdateChannelCategoryRoleCallback = std::function<void(const QChatUpdateChannelCategoryRoleResp&)>;
823using QChatRemoveChannelCategoryRoleCallback = QChatBaseCallback;
824using QChatGetChannelCategoryRolesPageCallback = std::function<void(const QChatGetChannelCategoryRolesPageResp&)>;
825using QChatAddChannelCategoryMemberRoleCallback = std::function<void(const QChatAddChannelCategoryMemberRoleResp&)>;
826using QChatUpdateChannelCategoryMemberRoleCallback = std::function<void(const QChatUpdateChannelCategoryMemberRoleResp&)>;
827using QChatRemoveChannelCategoryMemberRoleCallback = QChatBaseCallback;
828using QChatGetChannelCategoryMemberRolesPageCallback = std::function<void(const QChatGetChannelCategoryMemberRolesPageResp&)>;
829
831struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCreateServerRoleParam {
832 QChatCreateServerRoleCallback cb;
833 QChatServerRoleInfo info{};
836 QChatCreateServerRoleParam() = default;
838 info = param.role_info;
839 anti_spam_info = param.anti_spam_info;
840 cb = [c_callback = param.cb, user_data = param.user_data](const QChatCreateServerRoleResp& response) {
841 auto c_response = response.ToCParam();
842 c_response.user_data = user_data;
843 c_callback(&c_response);
844 };
845 }
846 const NIMQChatCreateServerRoleParam ToCParam() const {
847 auto cb_holder = new QChatCreateServerRoleCallback(cb);
849 c_param.user_data = cb_holder;
850 c_param.role_info = info.ToCParam();
851 c_param.anti_spam_info = anti_spam_info.ToCParam();
852 c_param.cb = [](const NIMQChatCreateServerRoleResp* resp) {
853 InvokeCallback<QChatCreateServerRoleCallback, NIMQChatCreateServerRoleResp>(*resp);
854 };
855 return c_param;
856 }
857};
858
860struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateServerRoleParam {
861 QChatUpdateServerRoleCallback cb;
865 QChatUpdateServerRoleParam() = default;
867 info = param.role_info;
868 anti_spam_info = param.anti_spam_info;
869 cb = [c_callback = param.cb, user_data = param.user_data](const QChatUpdateServerRoleResp& response) {
871 c_response.res_code = response.res_code;
872 c_response.user_data = user_data;
873 c_response.role_info = response.role_info.ToCParam();
874 c_callback(&c_response);
875 };
876 }
877 const NIMQChatUpdateServerRoleParam ToCParam() const {
878 auto cb_holder = new QChatUpdateServerRoleCallback(cb);
880 c_param.user_data = cb_holder;
881 c_param.role_info = info.ToCParam();
882 c_param.anti_spam_info = anti_spam_info.ToCParam();
883 c_param.cb = [](const NIMQChatUpdateServerRoleResp* resp) {
884 InvokeCallback<QChatUpdateServerRoleCallback, NIMQChatUpdateServerRoleResp>(*resp);
885 };
886
887 return c_param;
888 }
889};
890
892struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateServerRolePrioritiesParam {
893 QChatBatchUpdateServerRolePrioritiesCallback cb;
894 uint64_t server_id = 0;
896 std::map<uint64_t, uint64_t> priority_map;
899 server_id = param.server_id;
900 for (size_t i = 0; i < param.update_count; i++) {
901 priority_map.emplace(param.update_priority_info[i].role_id, param.update_priority_info[i].priority);
902 }
903 cb = [c_callback = param.cb, user_data = param.user_data, this](const QChatUpdateServerRolePrioritiesResp& response) {
904 NIMQChatUpdateServerRolePrioritiesResp c_response = response.ToCParam();
905 c_response.user_data = user_data;
906 c_callback(&c_response);
907 };
908 }
909 const NIMQChatBatchUpdateServerRolePrioritiesParam ToCParam() const {
910 auto cb_holder = new QChatBatchUpdateServerRolePrioritiesCallback(cb);
912 c_param.user_data = cb_holder;
913 c_param.server_id = server_id;
914 c_role_infos_.clear();
915 for (auto& priority_item : priority_map) {
917 priority_group.role_id = priority_item.first;
918 priority_group.priority = priority_item.second;
919 c_role_infos_.push_back(priority_group);
920 }
921 c_param.update_priority_info = c_role_infos_.data();
922 c_param.update_count = c_role_infos_.size();
923 c_param.cb = [](const NIMQChatUpdateServerRolePrioritiesResp* resp) {
924 InvokeCallback<QChatBatchUpdateServerRolePrioritiesCallback, NIMQChatUpdateServerRolePrioritiesResp>(*resp);
925 };
926
927 return c_param;
928 }
929
930protected:
931 mutable std::vector<NIMQChatBatchUpdateServeRolePriorityGroup> c_role_infos_;
932};
933
935struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatDeleteServerRoleParam {
936 QChatDeleteServerRoleCallback cb;
938 uint64_t server_id = 0;
940 uint64_t role_id = 0;
941 QChatDeleteServerRoleParam() = default;
943 server_id = param.server_id;
944 role_id = param.role_id;
945 cb = [c_callback = param.cb, user_data = param.user_data](const QChatDeleteServerRoleResp& response) {
946 auto c_response = response.ToCParam();
947 c_response.user_data = user_data;
948 c_callback(&c_response);
949 };
950 }
951 const NIMQChatDeleteServerRoleParam ToCParam() const {
952 auto cb_holder = new QChatDeleteServerRoleCallback(cb);
954 c_param.user_data = cb_holder;
955 c_param.server_id = server_id;
956 c_param.role_id = role_id;
957 c_param.cb = [](const NIMQChatDeleteServerRoleResp* resp) {
958 InvokeCallback<QChatDeleteServerRoleCallback, NIMQChatDeleteServerRoleResp>(*resp);
959 };
960
961 return c_param;
962 }
963};
964struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetServerRolesParam {
965 QChatGetServerRolesCallback cb;
967 uint64_t server_id = 0;
969 uint32_t limit = 0;
971 uint64_t priority = 0;
973 uint64_t channel_id = 0;
975 uint64_t channel_category_id = 0;
976 QChatGetServerRolesParam() = default;
978 server_id = param.server_id;
979 limit = param.limit;
980 priority = param.priority;
981 channel_id = param.channel_id;
982 channel_category_id = param.channel_category_id;
983 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetServerRolesResp& response) {
984 auto c_response = response.ToCParam();
985 c_response.user_data = user_data;
986 c_callback(&c_response);
987 };
988 }
989 const NIMQChatGetServerRolesParam ToCParam() const {
990 auto cb_holder = new QChatGetServerRolesCallback(cb);
992 c_param.user_data = cb_holder;
993 c_param.server_id = server_id;
994 c_param.limit = limit;
995 c_param.priority = priority;
996 c_param.channel_id = channel_id;
997 c_param.channel_category_id = channel_category_id;
998 c_param.cb = [](const NIMQChatGetServerRolesResp* resp) {
999 InvokeCallback<QChatGetServerRolesCallback, NIMQChatGetServerRolesResp>(*resp);
1000 };
1001
1002 return c_param;
1003 }
1004};
1005
1007struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddMembersToServerRoleParam {
1008 QChatAddMembersToServerRoleCallback cb;
1010 uint64_t server_id = 0;
1012 uint64_t role_id = 0;
1014 std::list<std::string> members_accids;
1017 server_id = param.server_id;
1018 role_id = param.role_id;
1019 for (size_t i = 0; i < param.member_count; i++)
1020 members_accids.push_back(param.members[i]);
1021 cb = [c_callback = param.cb, user_data = param.user_data](const QChatAddMembersToServerRoleResp& response) {
1022 auto c_response = response.ToCParam();
1023 c_response.user_data = user_data;
1024 c_callback(&c_response);
1025 };
1026 }
1027 const NIMQChatAddMembersToServerRoleParam ToCParam() const {
1028 auto cb_holder = new QChatAddMembersToServerRoleCallback(cb);
1030 c_param.user_data = cb_holder;
1031 c_param.server_id = server_id;
1032 c_param.role_id = role_id;
1033 vec_members.clear();
1034 for (auto&& member_accid : members_accids)
1035 vec_members.push_back(const_cast<char*>(member_accid.c_str()));
1036 c_param.member_count = vec_members.size();
1037 c_param.members = vec_members.data();
1038 c_param.cb = [](const NIMQChatAddMembersToServerRoleResp* resp) {
1039 InvokeCallback<QChatAddMembersToServerRoleCallback, NIMQChatAddMembersToServerRoleResp>(*resp);
1040 };
1041
1042 return c_param;
1043 }
1044
1045protected:
1046 mutable std::vector<char*> vec_members;
1047};
1048
1050struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRemoveMembersFromServerRoleParam {
1051 QChatAddMembersToServerRoleCallback cb;
1053 uint64_t server_id = 0;
1055 uint64_t role_id = 0;
1057 std::list<std::string> members_accids;
1060 server_id = param.server_id;
1061 role_id = param.role_id;
1062 for (size_t i = 0; i < param.member_count; i++)
1063 members_accids.push_back(param.members[i]);
1064 cb = [c_callback = param.cb, user_data = param.user_data](const QChatRemoveMembersFromServerRoleResp& response) {
1065 auto c_response = response.ToCParam();
1066 c_response.user_data = user_data;
1067 c_callback(&c_response);
1068 };
1069 }
1070 const NIMQChatRemoveMembersFromServerRoleParam ToCParam() const {
1071 auto cb_holder = new QChatRemoveMembersFromServerRoleCallback(cb);
1073 c_param.user_data = cb_holder;
1074 c_param.server_id = server_id;
1075 c_param.role_id = role_id;
1076 vec_members.clear();
1077 for (auto&& member_accid : members_accids)
1078 vec_members.push_back(const_cast<char*>(member_accid.c_str()));
1079 c_param.member_count = vec_members.size();
1080 c_param.members = vec_members.data();
1081 c_param.cb = [](const NIMQChatRemoveMembersFromServerRoleResp* resp) {
1082 InvokeCallback<QChatRemoveMembersFromServerRoleCallback, NIMQChatRemoveMembersFromServerRoleResp>(*resp);
1083 };
1084
1085 return c_param;
1086 }
1087
1088protected:
1089 mutable std::vector<char*> vec_members;
1090};
1091
1093struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMembersFromServerRoleParam {
1094 QChatGetMembersFromServerRoleCallback cb;
1096 uint64_t server_id = 0;
1098 uint64_t role_id = 0;
1100 uint64_t timestamp = 0;
1102 uint32_t limit = 0;
1104 std::string begin_accid;
1107 server_id = param.server_id;
1108 role_id = param.role_id;
1109 timestamp = param.timestamp;
1110 limit = param.limit;
1111 begin_accid = param.begin_accid;
1112 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetMembersFromServerRoleResp& response) {
1113 auto c_response = response.ToCParam();
1114 c_response.user_data = user_data;
1115 c_callback(&c_response);
1116 };
1117 }
1118 const NIMQChatGetMembersFromServerRoleParam ToCParam() const {
1119 auto cb_holder = new QChatGetMembersFromServerRoleCallback(cb);
1121 c_param.user_data = cb_holder;
1122 c_param.server_id = server_id;
1123 c_param.role_id = role_id;
1124 c_param.timestamp = timestamp;
1125 c_param.limit = limit;
1126 c_param.begin_accid = const_cast<char*>(begin_accid.c_str());
1127 c_param.cb = [](const NIMQChatGetMembersFromServerRoleResp* resp) {
1128 InvokeCallback<QChatGetMembersFromServerRoleCallback, NIMQChatGetMembersFromServerRoleResp>(*resp);
1129 };
1130
1131 return c_param;
1132 }
1133};
1134
1136struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelRoleParam {
1137 QChatAddChannelRoleCallback cb;
1138 uint64_t server_id = 0;
1139 uint64_t parent_role_id = 0;
1140 uint64_t channel_id = 0;
1141 QChatAddChannelRoleParam() = default;
1143 server_id = param.server_id;
1144 parent_role_id = param.parent_role_id;
1145 channel_id = param.channel_id;
1146 cb = [c_callback = param.cb, user_data = param.user_data](const QChatAddChannelRoleResp& response) {
1147 auto c_response = response.ToCParam();
1148 c_response.user_data = user_data;
1149 c_callback(&c_response);
1150 };
1151 }
1152 const NIMQChatAddChannelRoleParam ToCParam() const {
1153 auto cb_holder = new QChatAddChannelRoleCallback(cb);
1155 c_param.user_data = cb_holder;
1156 c_param.server_id = server_id;
1157 c_param.parent_role_id = parent_role_id;
1158 c_param.channel_id = channel_id;
1159 c_param.cb = [](const NIMQChatAddChannelRoleResp* resp) {
1160 InvokeCallback<QChatAddChannelRoleCallback, NIMQChatAddChannelRoleResp>(*resp);
1161 };
1162 return c_param;
1163 }
1164};
1165
1167struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateChannelRoleParam {
1168 QChatUpdateChannelRoleCallback cb;
1169 uint64_t server_id = 0;
1170 uint64_t role_id = 0;
1171 uint64_t channel_id = 0;
1172 QChatPermission permissions{};
1173 QChatUpdateChannelRoleParam() = default;
1175 server_id = param.server_id;
1176 role_id = param.role_id;
1177 channel_id = param.channel_id;
1178 for (size_t i = 0; i < param.permission_count; i++) {
1179 auto permission = param.permissions[i].permission;
1180 auto option = param.permissions[i].option;
1181 permissions.emplace(permission, option);
1182 }
1183 cb = [c_callback = param.cb, user_data = param.user_data](const QChatUpdateChannelRoleResp& response) {
1184 auto c_response = response.ToCParam();
1185 c_response.user_data = user_data;
1186 c_callback(&c_response);
1187 };
1188 }
1189 const NIMQChatUpdateChannelRoleParam ToCParam() const {
1190 auto cb_holder = new QChatUpdateChannelRoleCallback(cb);
1192 c_param.user_data = cb_holder;
1193 c_param.server_id = server_id;
1194 c_param.role_id = role_id;
1195 c_param.channel_id = channel_id;
1196 vec_permissions_.clear();
1197 for (auto&& permission : permissions) {
1198 vec_permissions_.push_back({permission.first, permission.second});
1199 }
1200 c_param.permission_count = vec_permissions_.size();
1201 c_param.permissions = vec_permissions_.data();
1202 c_param.cb = [](const NIMQChatUpdateChannelRoleResp* resp) {
1203 InvokeCallback<QChatUpdateChannelRoleCallback, NIMQChatUpdateChannelRoleResp>(*resp);
1204 };
1205 return c_param;
1206 }
1207
1208protected:
1209 mutable std::vector<NIMQChatPermissionGroup> vec_permissions_;
1210};
1211
1213struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRemoveChannelRoleParam {
1214 QChatRemoveChannelRoleCallback cb;
1216 uint64_t server_id = 0;
1218 uint64_t role_id = 0;
1220 uint64_t channel_id = 0;
1221 QChatRemoveChannelRoleParam() = default;
1223 server_id = param.server_id;
1224 role_id = param.role_id;
1225 channel_id = param.channel_id;
1226 cb = [c_callback = param.cb, user_data = param.user_data](const QChatRemoveChannelRoleResp& response) {
1227 auto c_response = response.ToCParam();
1228 c_response.user_data = user_data;
1229 c_callback(&c_response);
1230 };
1231 }
1232 const NIMQChatRemoveChannelRoleParam ToCParam() const {
1233 auto cb_holder = new QChatRemoveChannelRoleCallback(cb);
1235 c_param.user_data = cb_holder;
1236 c_param.server_id = server_id;
1237 c_param.channel_id = channel_id;
1238 c_param.role_id = role_id;
1239 c_param.cb = [](const NIMQChatRemoveChannelRoleResp* resp) {
1240 InvokeCallback<QChatRemoveChannelRoleCallback, NIMQChatRemoveChannelRoleResp>(*resp);
1241 };
1242 return c_param;
1243 }
1244};
1245
1247struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelRolesParam {
1248 QChatGetChannelRolesCallback cb;
1250 uint64_t server_id = 0;
1252 uint64_t channel_id = 0;
1254 uint64_t timestamp = 0;
1256 uint32_t limit = 0;
1257 QChatGetChannelRolesParam() = default;
1259 server_id = param.server_id;
1260 channel_id = param.channel_id;
1261 timestamp = param.timestamp;
1262 limit = param.limit;
1263 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetChannelRolesResp& response) {
1264 auto c_response = response.ToCParam();
1265 c_response.user_data = user_data;
1266 c_callback(&c_response);
1267 };
1268 }
1269 const NIMQChatGetChannelRolesParam ToCParam() const {
1270 auto cb_holder = new QChatGetChannelRolesCallback(cb);
1272 c_param.user_data = cb_holder;
1273 c_param.server_id = server_id;
1274 c_param.channel_id = channel_id;
1275 c_param.timestamp = timestamp;
1276 c_param.limit = limit;
1277 c_param.cb = [](const NIMQChatGetChannelRolesResp* resp) {
1278 InvokeCallback<QChatGetChannelRolesCallback, NIMQChatGetChannelRolesResp>(*resp);
1279 };
1280 return c_param;
1281 }
1282};
1283
1285struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddMemberRoleParam {
1286 QChatAddMemberRoleCallback cb;
1287 uint64_t server_id = 0;
1288 uint64_t channel_id = 0;
1289 std::string accid;
1290 QChatAddMemberRoleParam() = default;
1292 server_id = param.server_id;
1293 channel_id = param.channel_id;
1294 accid = param.accid;
1295 cb = [c_callback = param.cb, user_data = param.user_data](const QChatAddMemberRoleResp& response) {
1296 auto c_response = response.ToCParam();
1297 c_response.user_data = user_data;
1298 c_callback(&c_response);
1299 };
1300 }
1301 const NIMQChatAddMemberRoleParam ToCParam() const {
1302 auto cb_holder = new QChatAddMemberRoleCallback(cb);
1304 c_param.user_data = cb_holder;
1305 c_param.server_id = server_id;
1306 c_param.channel_id = channel_id;
1307 c_param.accid = const_cast<char*>(accid.c_str());
1308 c_param.cb = [](const NIMQChatAddMemberRoleResp* resp) {
1309 InvokeCallback<QChatAddMemberRoleCallback, NIMQChatAddMemberRoleResp>(*resp);
1310 };
1311 return c_param;
1312 }
1313};
1314
1316struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateMemberRoleParam {
1317 QChatUpdateMemberRoleCallback cb;
1318 uint64_t server_id = 0;
1319 uint64_t channel_id = 0;
1320 std::string accid;
1321 QChatPermission permissions{};
1322 QChatUpdateMemberRoleParam() = default;
1324 server_id = param.server_id;
1325 channel_id = param.channel_id;
1326 accid = param.accid;
1327 for (size_t i = 0; i < param.permission_count; i++)
1328 permissions.emplace(param.permissions[i].permission, param.permissions[i].option);
1329 cb = [c_callback = param.cb, user_data = param.user_data](const QChatUpdateMemberRoleResp& response) {
1330 auto c_response = response.ToCParam();
1331 c_response.user_data = user_data;
1332 c_callback(&c_response);
1333 };
1334 }
1335 const NIMQChatUpdateMemberRoleParam ToCParam() const {
1336 auto cb_holder = new QChatUpdateMemberRoleCallback(cb);
1338 c_param.user_data = cb_holder;
1339 c_param.server_id = server_id;
1340 c_param.channel_id = channel_id;
1341 c_param.accid = const_cast<char*>(accid.c_str());
1342 permissions_.clear();
1343 for (auto&& permission : permissions)
1344 permissions_.push_back({permission.first, permission.second});
1345 c_param.permission_count = permissions_.size();
1346 c_param.permissions = permissions_.data();
1347 c_param.cb = [](const NIMQChatUpdateMemberRoleResp* resp) {
1348 InvokeCallback<QChatUpdateMemberRoleCallback, NIMQChatUpdateMemberRoleResp>(*resp);
1349 };
1350 return c_param;
1351 }
1352
1353protected:
1354 mutable std::vector<NIMQChatPermissionGroup> permissions_;
1355};
1356
1358struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRemoveMemberRoleParam {
1359 QChatRemoveMemberRoleCallback cb;
1361 uint64_t server_id = 0;
1363 uint64_t channel_id = 0;
1365 std::string accid;
1366 QChatRemoveMemberRoleParam() = default;
1368 server_id = param.server_id;
1369 channel_id = param.channel_id;
1370 accid = param.accid;
1371 cb = [c_callback = param.cb, user_data = param.user_data](const QChatRemoveMemberRoleResp& response) {
1372 auto c_response = response.ToCParam();
1373 c_response.user_data = user_data;
1374 c_callback(&c_response);
1375 };
1376 }
1377 const NIMQChatRemoveMemberRoleParam ToCParam() const {
1378 auto cb_holder = new QChatRemoveMemberRoleCallback(cb);
1380 c_param.user_data = cb_holder;
1381 c_param.server_id = server_id;
1382 c_param.channel_id = channel_id;
1383 c_param.accid = const_cast<char*>(accid.c_str());
1384 c_param.cb = [](const NIMQChatRemoveMemberRoleResp* resp) {
1385 InvokeCallback<QChatRemoveMemberRoleCallback, NIMQChatRemoveMemberRoleResp>(*resp);
1386 };
1387 return c_param;
1388 }
1389};
1390
1392struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetMemberRolesParam {
1393 QChatGetMemberRoleInChannelCallback cb;
1395 uint64_t server_id = 0;
1397 uint64_t channel_id = 0;
1399 uint64_t timestamp = 0;
1401 uint32_t limit = 0;
1402 QChatGetMemberRolesParam() = default;
1404 server_id = param.server_id;
1405 channel_id = param.channel_id;
1406 timestamp = param.timestamp;
1407 limit = param.limit;
1408 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetMemberRolesResp& response) {
1409 auto c_response = response.ToCParam();
1410 c_response.user_data = user_data;
1411 c_callback(&c_response);
1412 };
1413 }
1414 const NIMQChatGetMemberRolesParam ToCParam() const {
1415 auto cb_holder = new QChatGetMemberRoleInChannelCallback(cb);
1417 c_param.user_data = cb_holder;
1418 c_param.server_id = server_id;
1419 c_param.channel_id = channel_id;
1420 c_param.timestamp = timestamp;
1421 c_param.limit = limit;
1422 c_param.cb = [](const NIMQChatGetMemberRolesResp* resp) {
1423 InvokeCallback<QChatGetMemberRoleInChannelCallback, NIMQChatGetMemberRolesResp>(*resp);
1424 };
1425 return c_param;
1426 }
1427};
1428
1430struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetRolesByAccidParam {
1431 QChatGetRolesByMemberIdCallback cb;
1433 uint64_t server_id = 0;
1435 std::string accid;
1437 uint64_t timestamp = 0;
1439 uint32_t limit = 0;
1440 QChatGetRolesByAccidParam() = default;
1442 server_id = param.server_id;
1443 accid = param.accid;
1444 timestamp = param.timestamp;
1445 limit = param.limit;
1446 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetRolesByAccidResp& response) {
1447 auto c_response = response.ToCParam();
1448 c_response.user_data = user_data;
1449 c_callback(&c_response);
1450 };
1451 }
1452 const NIMQChatGetServerRolesByMembersIdParam ToCParam() const {
1453 auto cb_holder = new QChatGetRolesByMemberIdCallback(cb);
1455 c_param.user_data = cb_holder;
1456 c_param.server_id = server_id;
1457 c_param.accid = const_cast<char*>(accid.c_str());
1458 c_param.timestamp = timestamp;
1459 c_param.limit = limit;
1460 c_param.cb = [](const NIMQChatGetServerRolesByMembersIdResp* resp) {
1461 InvokeCallback<QChatGetRolesByMemberIdCallback, NIMQChatGetServerRolesByMembersIdResp>(*resp);
1462 };
1463 return c_param;
1464 }
1465};
1466
1468struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingServerRolesByAccidsParam {
1469 QChatGetRolesByMemberIdsCallback cb;
1470 uint64_t server_id{0};
1471 std::list<std::string> accids;
1474 server_id = param.server_id;
1475 for (size_t i = 0; i < param.account_count; i++) {
1476 accids.push_back(param.accids[i]);
1477 }
1478 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetExistingServerRolesByAccidsResp& response) {
1479 auto c_response = response.ToCParam();
1480 c_response.user_data = user_data;
1481 c_callback(&c_response);
1482 };
1483 }
1484 const NIMQChatGetServerRolesByMemberIdsParam ToCParam() const {
1485 auto cb_holder = new QChatGetRolesByMemberIdsCallback(cb);
1487 c_param.user_data = cb_holder;
1488 c_param.server_id = server_id;
1489 c_param.account_count = accids.size();
1490 accids_.clear();
1491 for (auto& accid : accids)
1492 accids_.push_back(const_cast<char*>(accid.c_str()));
1493 c_param.accids = accids_.data();
1494 c_param.cb = [](const NIMQChatGetServerRolesByMemberIdsResp* resp) {
1495 InvokeCallback<QChatGetRolesByMemberIdsCallback, NIMQChatGetServerRolesByMemberIdsResp>(*resp);
1496 };
1497 return c_param;
1498 }
1499
1500protected:
1501 mutable std::vector<QChatMemberAccountId> accids_;
1502};
1503
1505struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingChannelRolesByServerRoleIdsParam {
1506 QChatGetExistingRolesInChannelCallback cb;
1507 uint64_t server_id{0};
1508 uint64_t channel_id{0};
1509 std::list<uint64_t> role_ids;
1512 server_id = param.server_id;
1513 channel_id = param.channel_id;
1514 for (size_t i = 0; i < param.role_count; i++) {
1515 role_ids.push_back(param.role_ids[i]);
1516 }
1517 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetExistingChannelRolesByServerRoleIdsResp& response) {
1518 auto c_response = response.ToCParam();
1519 c_response.user_data = user_data;
1520 c_callback(&c_response);
1521 };
1522 }
1523 const NIMQChatGetExistingRolesInChannelParam ToCParam() const {
1524 auto cb_holder = new QChatGetExistingRolesInChannelCallback(cb);
1526 c_param.user_data = cb_holder;
1527 c_param.server_id = server_id;
1528 c_param.channel_id = channel_id;
1529 c_param.role_count = role_ids.size();
1530 role_ids_.clear();
1531 for (auto& roleid : role_ids)
1532 role_ids_.push_back(roleid);
1533 c_param.role_ids = role_ids_.data();
1534 c_param.cb = [](const NIMQChatGetExistingRolesInChannelResp* resp) {
1535 InvokeCallback<QChatGetExistingRolesInChannelCallback, NIMQChatGetExistingRolesInChannelResp>(*resp);
1536 };
1537 return c_param;
1538 }
1539
1540protected:
1541 mutable std::vector<uint64_t> role_ids_;
1542};
1543
1545struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingAccidsOfMemberRolesParam {
1546 QChatGetExistingAccidsOfMemberRolesCallback cb;
1547 uint64_t server_id{0};
1548 uint64_t channel_id{0};
1549 std::list<std::string> accids;
1552 server_id = param.server_id;
1553 channel_id = param.channel_id;
1554 for (size_t i = 0; i < param.account_count; i++) {
1555 accids.push_back(param.accids[i]);
1556 }
1557 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetExistingAccidsOfMemberRolesResp& response) {
1558 auto c_response = response.ToCParam();
1559 c_response.user_data = user_data;
1560 c_callback(&c_response);
1561 };
1562 }
1563 const NIMQChatGetExistingAccidsOfMemberRolesParam ToCParam() const {
1564 auto cb_holder = new QChatGetExistingAccidsOfMemberRolesCallback(cb);
1566 c_param.user_data = cb_holder;
1567 c_param.server_id = server_id;
1568 c_param.channel_id = channel_id;
1569 c_param.account_count = accids.size();
1570 accids_.clear();
1571 for (auto& accid : accids)
1572 accids_.push_back(const_cast<char*>(accid.c_str()));
1573 c_param.accids = accids_.data();
1574 c_param.cb = [](const NIMQChatGetExistingAccidsOfMemberRolesResp* resp) {
1575 InvokeCallback<QChatGetExistingAccidsOfMemberRolesCallback, NIMQChatGetExistingAccidsOfMemberRolesResp>(*resp);
1576 };
1577 return c_param;
1578 }
1579
1580protected:
1581 mutable std::vector<QChatMemberAccountId> accids_;
1582};
1583
1585struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetExistingAccidsInServerRoleParam {
1586 QChatGetExistingAccidsInServerRoleCallback cb;
1587 uint64_t server_id{0};
1588 uint64_t role_id{0};
1589 std::list<std::string> accids;
1592 server_id = param.server_id;
1593 role_id = param.role_id;
1594 for (size_t i = 0; i < param.account_count; i++) {
1595 accids.push_back(param.accids[i]);
1596 }
1597 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetExistingAccidsInServerRoleResp& response) {
1598 auto c_response = response.ToCParam();
1599 c_response.user_data = user_data;
1600 c_callback(&c_response);
1601 };
1602 }
1603 const NIMQChatGetExistingAccidsInServerRoleParam ToCParam() const {
1604 auto cb_holder = new QChatGetExistingAccidsInServerRoleCallback(cb);
1606 c_param.user_data = cb_holder;
1607 c_param.server_id = server_id;
1608 c_param.role_id = role_id;
1609 c_param.account_count = accids.size();
1610 accids_.clear();
1611 for (auto& accid : accids)
1612 accids_.push_back(const_cast<char*>(accid.c_str()));
1613 c_param.accids = accids_.data();
1614 c_param.cb = [](const NIMQChatGetExistingAccidsInServerRoleResp* resp) {
1615 InvokeCallback<QChatGetExistingAccidsInServerRoleCallback, NIMQChatGetExistingAccidsInServerRoleResp>(*resp);
1616 };
1617 return c_param;
1618 }
1619
1620protected:
1621 mutable std::vector<QChatMemberAccountId> accids_;
1622};
1623
1625struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCheckPermissionParam {
1626 QChatCheckPermissionCallback cb;
1628 uint64_t server_id{0};
1630 uint64_t channel_id{0};
1632 uint32_t permission{kPermissionManageServer};
1633 QChatCheckPermissionParam() = default;
1635 server_id = param.server_id;
1636 channel_id = param.channel_id;
1637 permission = param.permission;
1638 cb = [c_callback = param.cb, user_data = param.user_data](const QChatCheckPermissionResp& response) {
1639 auto c_response = response.ToCParam();
1640 c_response.user_data = user_data;
1641 c_callback(&c_response);
1642 };
1643 }
1644 const NIMQChatCheckPermissionParam ToCParam() const {
1645 auto cb_holder = new QChatCheckPermissionCallback(cb);
1647 c_param.user_data = cb_holder;
1648 c_param.server_id = server_id;
1649 c_param.channel_id = channel_id;
1650 c_param.permission = permission;
1651 c_param.cb = [](const NIMQChatCheckPermissionResp* resp) {
1652 InvokeCallback<QChatCheckPermissionCallback, NIMQChatCheckPermissionResp>(*resp);
1653 };
1654 return c_param;
1655 }
1656};
1657
1659struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatCheckPermissionsParam {
1660 QChatCheckPermissionsCallback cb;
1662 uint64_t server_id{0};
1664 uint64_t channel_id{0};
1666 std::vector<uint32_t> permissions;
1667 QChatCheckPermissionsParam() = default;
1669 server_id = param.server_id;
1670 channel_id = param.channel_id;
1671 for (size_t i = 0; i < param.permission_count; i++) {
1672 permissions.push_back(param.permissions[i]);
1673 }
1674 cb = [c_callback = param.cb, user_data = param.user_data](const QChatCheckPermissionsResp& response) {
1675 auto c_response = response.ToCParam();
1676 c_response.user_data = user_data;
1677 c_callback(&c_response);
1678 };
1679 }
1680 const NIMQChatCheckPermissionsParam ToCParam() const {
1681 auto cb_holder = new QChatCheckPermissionsCallback(cb);
1683 c_param.user_data = cb_holder;
1684 c_param.server_id = server_id;
1685 c_param.channel_id = channel_id;
1686 c_param.permission_count = permissions.size();
1687 c_param.permissions = const_cast<uint32_t*>(permissions.data());
1688 c_param.cb = [](const NIMQChatCheckPermissionsResp* resp) {
1689 InvokeCallback<QChatCheckPermissionsCallback, NIMQChatCheckPermissionsResp>(*resp);
1690 };
1691 return c_param;
1692 }
1693};
1694
1696struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelCategoryRoleParam {
1697 QChatAddChannelCategoryRoleCallback cb;
1699 uint64_t server_id{0};
1701 uint64_t category_id{0};
1703 uint64_t parent_role_id{0};
1706 server_id = param.server_id;
1707 category_id = param.category_id;
1708 parent_role_id = param.parent_role_id;
1709 cb = [c_callback = param.cb, user_data = param.user_data](const QChatAddChannelCategoryRoleResp& response) {
1710 auto c_response = response.ToCParam();
1711 c_response.user_data = user_data;
1712 c_callback(&c_response);
1713 };
1714 }
1715 const NIMQChatAddChannelCategoryRoleParam ToCParam() const {
1716 auto cb_holder = new QChatAddChannelCategoryRoleCallback(cb);
1718 c_param.user_data = cb_holder;
1719 c_param.server_id = server_id;
1720 c_param.category_id = category_id;
1721 c_param.parent_role_id = parent_role_id;
1722 c_param.cb = [](const NIMQChatAddChannelCategoryRoleResp* resp) {
1723 InvokeCallback<QChatAddChannelCategoryRoleCallback, NIMQChatAddChannelCategoryRoleResp>(*resp);
1724 };
1725 return c_param;
1726 }
1727};
1728
1730struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateChannelCategoryRoleParam {
1731 QChatUpdateChannelCategoryRoleCallback cb;
1733 uint64_t server_id{0};
1735 uint64_t category_id{0};
1737 uint64_t role_id{0};
1739 QChatPermission permissions{};
1742 server_id = param.server_id;
1743 category_id = param.category_id;
1744 role_id = param.role_id;
1745 for (size_t i = 0; i < param.permission_count; i++)
1746 permissions.emplace(param.permissions[i].permission, param.permissions[i].option);
1747 cb = [c_callback = param.cb, user_data = param.user_data](const QChatUpdateChannelCategoryRoleResp& response) {
1748 auto c_response = response.ToCParam();
1749 c_response.user_data = user_data;
1750 c_callback(&c_response);
1751 };
1752 }
1753 const NIMQChatUpdateChannelCategoryRoleParam ToCParam() const {
1754 auto cb_holder = new QChatUpdateChannelCategoryRoleCallback(cb);
1756 c_param.user_data = cb_holder;
1757 c_param.server_id = server_id;
1758 c_param.category_id = category_id;
1759 c_param.role_id = role_id;
1760 permissions_.clear();
1761 for (auto&& permission : permissions)
1762 permissions_.push_back({permission.first, permission.second});
1763 c_param.permission_count = permissions_.size();
1764 c_param.permissions = permissions_.data();
1765 c_param.cb = [](const NIMQChatUpdateChannelCategoryRoleResp* resp) {
1766 InvokeCallback<QChatUpdateChannelCategoryRoleCallback, NIMQChatUpdateChannelCategoryRoleResp>(*resp);
1767 };
1768 return c_param;
1769 }
1770
1771protected:
1772 mutable std::vector<NIMQChatPermissionGroup> permissions_;
1773};
1774
1776struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRemoveChannelCategoryRoleParam {
1777 QChatRemoveChannelCategoryRoleCallback cb;
1778 uint64_t server_id{0};
1779 uint64_t category_id{0};
1780 uint64_t role_id{0};
1783 server_id = param.server_id;
1784 category_id = param.category_id;
1785 role_id = param.role_id;
1786 cb = [c_callback = param.cb, user_data = param.user_data](const QChatRemoveChannelCategoryRoleResp& response) {
1787 auto c_response = response.ToCParam();
1788 c_response.user_data = user_data;
1789 c_callback(&c_response);
1790 };
1791 }
1792 const NIMQChatRemoveChannelCategoryRoleParam ToCParam() const {
1793 auto cb_holder = new QChatRemoveChannelCategoryRoleCallback(cb);
1795 c_param.user_data = cb_holder;
1796 c_param.server_id = server_id;
1797 c_param.category_id = category_id;
1798 c_param.role_id = role_id;
1799 c_param.cb = [](const NIMQChatRemoveChannelCategoryRoleResp* resp) {
1800 InvokeCallback<QChatRemoveChannelCategoryRoleCallback, NIMQChatRemoveChannelCategoryRoleResp>(*resp);
1801 };
1802 return c_param;
1803 }
1804};
1805
1807struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelCategoryRolesPageParam {
1808 QChatGetChannelCategoryRolesPageCallback cb;
1809 uint64_t server_id{0};
1810 uint64_t category_id{0};
1811 uint64_t timestamp{0};
1812 uint32_t limit{100};
1815 server_id = param.server_id;
1816 category_id = param.category_id;
1817 timestamp = param.timestamp;
1818 limit = param.limit;
1819 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetChannelCategoryRolesPageResp& response) {
1820 auto c_response = response.ToCParam();
1821 c_response.user_data = user_data;
1822 c_callback(&c_response);
1823 };
1824 }
1825 const NIMQChatGetChannelCategoryRolesPageParam ToCParam() const {
1826 auto cb_holder = new QChatGetChannelCategoryRolesPageCallback(cb);
1828 c_param.user_data = cb_holder;
1829 c_param.server_id = server_id;
1830 c_param.category_id = category_id;
1831 c_param.timestamp = timestamp;
1832 c_param.limit = limit;
1833 c_param.cb = [](const NIMQChatGetChannelCategoryRolesPageResp* resp) {
1834 InvokeCallback<QChatGetChannelCategoryRolesPageCallback, NIMQChatGetChannelCategoryRolesPageResp>(*resp);
1835 };
1836 return c_param;
1837 }
1838};
1839
1841struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatAddChannelCategoryMemberRoleParam {
1842 QChatAddChannelCategoryMemberRoleCallback cb;
1843 uint64_t server_id{0};
1844 uint64_t category_id{0};
1845 std::string accid;
1848 server_id = param.server_id;
1849 category_id = param.category_id;
1850 accid = param.accid;
1851 cb = [c_callback = param.cb, user_data = param.user_data](const QChatAddChannelCategoryMemberRoleResp& response) {
1852 auto c_response = response.ToCParam();
1853 c_response.user_data = user_data;
1854 c_callback(&c_response);
1855 };
1856 }
1857 const NIMQChatAddChannelCategoryMemberRoleParam ToCParam() const {
1858 auto cb_holder = new QChatAddChannelCategoryMemberRoleCallback(cb);
1860 c_param.user_data = cb_holder;
1861 c_param.server_id = server_id;
1862 c_param.category_id = category_id;
1863 c_param.accid = const_cast<char*>(accid.c_str());
1864 c_param.cb = [](const NIMQChatAddChannelCategoryMemberRoleResp* resp) {
1865 InvokeCallback<QChatAddChannelCategoryMemberRoleCallback, NIMQChatAddChannelCategoryMemberRoleResp>(*resp);
1866 };
1867 return c_param;
1868 }
1869};
1870
1872struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatUpdateChannelCategoryMemberRoleParam {
1873 QChatUpdateChannelCategoryMemberRoleCallback cb;
1875 uint64_t server_id{0};
1877 uint64_t category_id{0};
1879 std::string accid;
1881 QChatPermission permissions{};
1884 server_id = param.server_id;
1885 category_id = param.category_id;
1886 accid = param.accid;
1887 for (size_t i = 0; i < param.permission_count; i++)
1888 permissions.emplace(param.permissions[i].permission, param.permissions[i].option);
1889 cb = [c_callback = param.cb, user_data = param.user_data](const QChatUpdateChannelCategoryMemberRoleResp& response) {
1890 auto c_response = response.ToCParam();
1891 c_response.user_data = user_data;
1892 c_callback(&c_response);
1893 };
1894 }
1895 const NIMQChatUpdateChannelCategoryMemberRoleParam ToCParam() const {
1896 auto cb_holder = new QChatUpdateChannelCategoryMemberRoleCallback(cb);
1898 c_param.user_data = cb_holder;
1899 c_param.server_id = server_id;
1900 c_param.category_id = category_id;
1901 c_param.accid = const_cast<char*>(accid.c_str());
1902 permissions_.clear();
1903 for (auto&& permission : permissions)
1904 permissions_.push_back({permission.first, permission.second});
1905 c_param.permission_count = permissions_.size();
1906 c_param.permissions = permissions_.data();
1907 c_param.cb = [](const NIMQChatUpdateChannelCategoryMemberRoleResp* resp) {
1908 InvokeCallback<QChatUpdateChannelCategoryMemberRoleCallback, NIMQChatUpdateChannelCategoryMemberRoleResp>(*resp);
1909 };
1910 return c_param;
1911 }
1912
1913protected:
1914 mutable std::vector<NIMQChatPermissionGroup> permissions_;
1915};
1916
1918struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatRemoveChannelCategoryMemberRoleParam {
1919 QChatRemoveChannelCategoryMemberRoleCallback cb;
1920 uint64_t server_id{0};
1921 uint64_t category_id{0};
1922 std::string accid;
1925 server_id = param.server_id;
1926 category_id = param.category_id;
1927 accid = param.accid;
1928 cb = [c_callback = param.cb, user_data = param.user_data](const QChatRemoveChannelCategoryMemberRoleResp& response) {
1929 auto c_response = response.ToCParam();
1930 c_response.user_data = user_data;
1931 c_callback(&c_response);
1932 };
1933 }
1934 const NIMQChatRemoveChannelCategoryMemberRoleParam ToCParam() const {
1935 auto cb_holder = new QChatRemoveChannelCategoryMemberRoleCallback(cb);
1937 c_param.user_data = cb_holder;
1938 c_param.server_id = server_id;
1939 c_param.category_id = category_id;
1940 c_param.accid = const_cast<char*>(accid.c_str());
1941 c_param.cb = [](const NIMQChatRemoveChannelCategoryMemberRoleResp* resp) {
1942 InvokeCallback<QChatRemoveChannelCategoryMemberRoleCallback, NIMQChatRemoveChannelCategoryMemberRoleResp>(*resp);
1943 };
1944 return c_param;
1945 }
1946};
1947
1949struct NIM_QCHAT_SDK_CPPWRAPPER_DLL_API QChatGetChannelCategoryMemberRolesPageParam {
1950 QChatGetChannelCategoryMemberRolesPageCallback cb;
1951 uint64_t server_id{0};
1952 uint64_t category_id{0};
1953 uint64_t timestamp{0};
1954 uint32_t limit{100};
1957 server_id = param.server_id;
1958 category_id = param.category_id;
1959 timestamp = param.timestamp;
1960 limit = param.limit;
1961 cb = [c_callback = param.cb, user_data = param.user_data](const QChatGetChannelCategoryMemberRolesPageResp& response) {
1962 auto c_response = response.ToCParam();
1963 c_response.user_data = user_data;
1964 c_callback(&c_response);
1965 };
1966 }
1967 const NIMQChatGetChannelCategoryMemberRolesPageParam ToCParam() const {
1968 auto cb_holder = new QChatGetChannelCategoryMemberRolesPageCallback(cb);
1970 c_param.user_data = cb_holder;
1971 c_param.server_id = server_id;
1972 c_param.category_id = category_id;
1973 c_param.timestamp = timestamp;
1974 c_param.limit = limit;
1975 c_param.cb = [](const NIMQChatGetChannelCategoryMemberRolesPageResp* resp) {
1976 InvokeCallback<QChatGetChannelCategoryMemberRolesPageCallback, NIMQChatGetChannelCategoryMemberRolesPageResp>(*resp);
1977 };
1978 return c_param;
1979 }
1980};
1981
1982} // namespace nim_qchat
1983
1984#endif // __NIM_QCHAT_IDENTITY_CPP_DEF_H__
namespace nim_qchat
std::function< void(const QChatBaseResp &)> QChatBaseCallback
通用回调模板
Definition: nim_qchat_public_cpp_def.h:95
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
@ kNIMResSuccess
Definition: nim_chatroom_res_code_def.h:18
圈组CPP wrapper helpers
圈组身份组相关数据结构声明
@ kPermissionManageServer
管理服务器,Server
Definition: nim_qchat_role_def.h:22
NIMQChatRoleType
Definition: nim_qchat_role_def.h:96
@ kRoleTypeUnkonwn
未知
Definition: nim_qchat_role_def.h:98
NIMQChatPermissionsOption
Definition: nim_qchat_role_def.h:78
Definition: nim_qchat_role_def.h:767
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:773
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:771
char * accid
用户 ID
Definition: nim_qchat_role_def.h:775
Definition: nim_qchat_role_def.h:299
Definition: nim_qchat_role_def.h:713
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:719
uint64_t parent_role_id
服务器身份组ID
Definition: nim_qchat_role_def.h:721
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:717
Definition: nim_qchat_role_def.h:546
Definition: nim_qchat_role_def.h:259
Definition: nim_qchat_role_def.h:592
Definition: nim_qchat_role_def.h:292
Definition: nim_qchat_role_def.h:513
size_t member_count
要加入的用户数量
Definition: nim_qchat_role_def.h:523
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:519
char ** members
用户数据指针首地址
Definition: nim_qchat_role_def.h:521
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:517
Definition: nim_qchat_role_def.h:238
Definition: nim_qchat_role_def.h:471
Definition: nim_qchat_role_def.h:477
NIMQChatBatchUpdateServeRolePriorityGroup * update_priority_info
要更新的身份组 ID 及优先级组合
Definition: nim_qchat_role_def.h:482
Definition: nim_qchat_role_def.h:190
uint64_t update_time
身份组修改时间
Definition: nim_qchat_role_def.h:204
uint64_t role_id
该定制权限所在的身份组 ID
Definition: nim_qchat_role_def.h:194
uint64_t create_time
身份组创建时间
Definition: nim_qchat_role_def.h:202
size_t permissions_count
身份组权限组合数量
Definition: nim_qchat_role_def.h:200
NIMQChatPermissionGroup * permissions
身份组权限设定
Definition: nim_qchat_role_def.h:198
uint64_t category_id
该定制权限所在的频道分组 ID
Definition: nim_qchat_role_def.h:192
NIMQChatMemberInfo member_info
定制权限的用户信息
Definition: nim_qchat_role_def.h:196
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:132
bool valid_flag
有效标志
Definition: nim_qchat_role_def.h:136
uint64_t parent_role_id
继承的服务器身份组 ID
Definition: nim_qchat_role_def.h:134
uint64_t channel_id
频道 ID
Definition: nim_qchat_role_def.h:124
uint64_t parent_role_id
继承的服务器身份组 ID
Definition: nim_qchat_role_def.h:126
Definition: nim_qchat_role_def.h:687
uint32_t permission
权限
Definition: nim_qchat_role_def.h:695
uint64_t channel_id
channel_id == 0 means check permission in server
Definition: nim_qchat_role_def.h:693
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:691
Definition: nim_qchat_role_def.h:366
Definition: nim_qchat_role_def.h:699
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:703
uint32_t * permissions
权限列表
Definition: nim_qchat_role_def.h:709
size_t permission_count
权限列表长度
Definition: nim_qchat_role_def.h:707
uint64_t channel_id
channel_id == 0 means check permission in server
Definition: nim_qchat_role_def.h:705
Definition: nim_qchat_role_def.h:373
size_t permissions_count
身份组权限组合数量
Definition: nim_qchat_role_def.h:377
NIMQChatPermissionsOption * options
身份组权限开关
Definition: nim_qchat_role_def.h:381
uint32_t * permissions
身份组权限类型
Definition: nim_qchat_role_def.h:379
Definition: nim_qchat_role_def.h:451
NIMQChatRoleInfo role_info
服务器身份组信息结构体
Definition: nim_qchat_role_def.h:455
NIMQChatBusinessAntiSpamInfo anti_spam_info
反垃圾信息
Definition: nim_qchat_role_def.h:457
Definition: nim_qchat_role_def.h:208
Definition: nim_qchat_role_def.h:487
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:493
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:491
Definition: nim_qchat_role_def.h:807
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:811
uint64_t timestamp
时间戳,查询最新指定为 0
Definition: nim_qchat_role_def.h:815
uint32_t limit
限制返回数量
Definition: nim_qchat_role_def.h:817
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:813
Definition: nim_qchat_role_def.h:326
Definition: nim_qchat_role_def.h:753
uint32_t limit
限制查询返回数量
Definition: nim_qchat_role_def.h:763
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:759
uint64_t timestamp
时间戳,查询最新指定为 0
Definition: nim_qchat_role_def.h:761
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:757
Definition: nim_qchat_role_def.h:578
uint64_t channel_id
频道 ID
Definition: nim_qchat_role_def.h:584
uint32_t limit
限制查询返回数量
Definition: nim_qchat_role_def.h:588
uint64_t timestamp
时间戳,查询最新指定为 0
Definition: nim_qchat_role_def.h:586
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:582
Definition: nim_qchat_role_def.h:281
Definition: nim_qchat_role_def.h:677
Definition: nim_qchat_role_def.h:667
Definition: nim_qchat_role_def.h:358
Definition: nim_qchat_role_def.h:657
Definition: nim_qchat_role_def.h:624
uint64_t timestamp
时间戳,查询最新指定为 0
Definition: nim_qchat_role_def.h:632
uint64_t channel_id
频道 ID
Definition: nim_qchat_role_def.h:630
uint32_t limit
限制返回数量
Definition: nim_qchat_role_def.h:634
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:628
Definition: nim_qchat_role_def.h:318
Definition: nim_qchat_role_def.h:530
uint32_t limit
限制返回数量
Definition: nim_qchat_role_def.h:540
char * begin_accid
起查 account ID
Definition: nim_qchat_role_def.h:542
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:534
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:536
uint64_t timestamp
时间戳,从最新起查使用 0
Definition: nim_qchat_role_def.h:538
Definition: nim_qchat_role_def.h:251
Definition: nim_qchat_role_def.h:648
Definition: nim_qchat_role_def.h:344
Definition: nim_qchat_role_def.h:638
Definition: nim_qchat_role_def.h:497
uint64_t channel_id
频道 ID, 如果非空,则只需要有该channel的管理权限即可,否则需要有server的管理权限
Definition: nim_qchat_role_def.h:507
uint64_t channel_category_id
频道分组 ID, 如果非空,则只需要有该channel_category的管理权限即可,否则需要有server的管理权限
Definition: nim_qchat_role_def.h:509
uint64_t priority
起查的身份组优先级
Definition: nim_qchat_role_def.h:505
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:501
uint32_t limit
限制返回数量
Definition: nim_qchat_role_def.h:503
Definition: nim_qchat_role_def.h:225
Definition: nim_qchat_role_def.h:172
size_t permissions_count
身份组权限组合数量
Definition: nim_qchat_role_def.h:182
uint64_t create_time
身份组创建时间
Definition: nim_qchat_role_def.h:184
uint64_t role_id
该定制权限所在的身份组 ID
Definition: nim_qchat_role_def.h:176
NIMQChatMemberInfo member_info
定制权限的用户信息
Definition: nim_qchat_role_def.h:178
uint64_t update_time
身份组修改时间
Definition: nim_qchat_role_def.h:186
uint64_t channel_id
该定制权限所在的频道 ID
Definition: nim_qchat_role_def.h:174
NIMQChatPermissionGroup * permissions
身份组权限设定
Definition: nim_qchat_role_def.h:180
Definition: nim_qchat_role_def.h:88
uint32_t permission
权限, 见 NIMQChatPermissions 以及自定义权限
Definition: nim_qchat_role_def.h:90
NIMQChatPermissionsOption option
开关
Definition: nim_qchat_role_def.h:92
Definition: nim_qchat_role_def.h:795
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:801
char * accid
用户账号
Definition: nim_qchat_role_def.h:803
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:799
Definition: nim_qchat_role_def.h:741
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:747
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:745
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:749
Definition: nim_qchat_role_def.h:566
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:574
uint64_t channel_id
频道 ID
Definition: nim_qchat_role_def.h:572
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:570
Definition: nim_qchat_role_def.h:612
uint64_t channel_id
身份组 ID
Definition: nim_qchat_role_def.h:618
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:616
char * accid
用户账号
Definition: nim_qchat_role_def.h:620
Definition: nim_qchat_role_def.h:140
char * role_icon
身份组图片 URL
Definition: nim_qchat_role_def.h:148
uint64_t role_id
身份组id
Definition: nim_qchat_role_def.h:144
NIMQChatChannelCategoryRoleInfo channel_category_role
仅频道分组拥有的身份组字段
Definition: nim_qchat_role_def.h:167
NIMQChatServerRoleInfo server_role
仅服务器拥有的身份组字段
Definition: nim_qchat_role_def.h:163
char * role_name
身份组名称
Definition: nim_qchat_role_def.h:146
uint64_t update_time
身份组修改时间
Definition: nim_qchat_role_def.h:160
NIMQChatRoleType role_type
身份组类型 1 表示 Everyone,2 表示定制身份组
Definition: nim_qchat_role_def.h:156
size_t permissions_count
身份组权限组合数量
Definition: nim_qchat_role_def.h:154
uint64_t create_time
身份组创建时间
Definition: nim_qchat_role_def.h:158
NIMQChatChannelRoleInfo channel_role
仅频道拥有的身份组字段
Definition: nim_qchat_role_def.h:165
uint64_t server_id
服务器ID
Definition: nim_qchat_role_def.h:142
char * extension
身份组扩展字段
Definition: nim_qchat_role_def.h:150
NIMQChatPermissionGroup * permissions
身份组权限设定
Definition: nim_qchat_role_def.h:152
Definition: nim_qchat_role_def.h:337
Definition: nim_qchat_role_def.h:106
uint64_t role_id
所在身份组role id
Definition: nim_qchat_role_def.h:110
NIMQChatMemberInfo member_info
member info
Definition: nim_qchat_role_def.h:108
Definition: nim_qchat_role_def.h:114
uint32_t member_count
该身份组的成员数量,Everyone 身份组数量为 -1
Definition: nim_qchat_role_def.h:116
uint64_t priority
身份组优先级,Everyone 最低为 0,数字越大优先级越低
Definition: nim_qchat_role_def.h:118
Definition: nim_qchat_role_def.h:779
NIMQChatPermissionGroup * permissions
身份组权限设定
Definition: nim_qchat_role_def.h:789
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:783
size_t permission_count
权限设定数量
Definition: nim_qchat_role_def.h:791
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:785
char * accid
用户 ID
Definition: nim_qchat_role_def.h:787
Definition: nim_qchat_role_def.h:725
NIMQChatPermissionGroup * permissions
身份组权限设定
Definition: nim_qchat_role_def.h:735
size_t permission_count
权限设定数量
Definition: nim_qchat_role_def.h:737
uint64_t server_id
服务器 ID
Definition: nim_qchat_role_def.h:729
uint64_t category_id
频道分组 ID
Definition: nim_qchat_role_def.h:731
uint64_t role_id
身份组 ID
Definition: nim_qchat_role_def.h:733
Definition: nim_qchat_role_def.h:555
Definition: nim_qchat_role_def.h:601
Definition: nim_qchat_role_def.h:461
NIMQChatRoleInfo role_info
服务器身份组信息结构体
Definition: nim_qchat_role_def.h:465
NIMQChatBusinessAntiSpamInfo anti_spam_info
反垃圾信息
Definition: nim_qchat_role_def.h:467
Definition: nim_qchat_role_def.h:215
Definition: nim_qchat_role_cpp_def.h:1841
Definition: nim_qchat_role_cpp_def.h:569
QChatChannelCategoryMemberRoleInfo role_info
频道分组成员身份组信息
Definition: nim_qchat_role_cpp_def.h:573
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:571
Definition: nim_qchat_role_cpp_def.h:1696
Definition: nim_qchat_role_cpp_def.h:459
QChatChannelCategoryRoleInfo role_info
频道分组身份组信息
Definition: nim_qchat_role_cpp_def.h:463
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:461
Definition: nim_qchat_role_cpp_def.h:1136
Definition: nim_qchat_role_cpp_def.h:434
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:436
Definition: nim_qchat_role_cpp_def.h:1285
Definition: nim_qchat_role_cpp_def.h:546
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:548
Definition: nim_qchat_role_cpp_def.h:1007
std::list< std::string > members_accids
要添加的成员列表
Definition: nim_qchat_role_cpp_def.h:1014
Definition: nim_qchat_role_cpp_def.h:389
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:391
std::list< std::string > failed_list
加入失败的用户列表
Definition: nim_qchat_role_cpp_def.h:395
std::list< std::string > succeed_list
加入成功的用户列表
Definition: nim_qchat_role_cpp_def.h:393
Definition: nim_qchat_public_cpp_def.h:40
Definition: nim_qchat_public_cpp_def.h:53
Definition: nim_qchat_role_cpp_def.h:219
Definition: nim_qchat_role_cpp_def.h:147
Definition: nim_qchat_role_cpp_def.h:127
Definition: nim_qchat_role_cpp_def.h:1625
Definition: nim_qchat_role_cpp_def.h:742
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:744
Definition: nim_qchat_role_cpp_def.h:1659
std::vector< uint32_t > permissions
查询的权限列表
Definition: nim_qchat_role_cpp_def.h:1666
Definition: nim_qchat_role_cpp_def.h:762
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:764
std::map< uint32_t, NIMQChatPermissionsOption > permissions
权限列表
Definition: nim_qchat_role_cpp_def.h:766
Definition: nim_qchat_role_cpp_def.h:831
Definition: nim_qchat_role_cpp_def.h:269
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:271
Definition: nim_qchat_role_cpp_def.h:935
Definition: nim_qchat_role_cpp_def.h:1949
Definition: nim_qchat_role_cpp_def.h:626
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:628
Definition: nim_qchat_role_cpp_def.h:1807
Definition: nim_qchat_role_cpp_def.h:516
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:518
Definition: nim_qchat_role_cpp_def.h:1247
Definition: nim_qchat_role_cpp_def.h:484
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:486
Definition: nim_qchat_role_cpp_def.h:1585
Definition: nim_qchat_role_cpp_def.h:1545
Definition: nim_qchat_role_cpp_def.h:709
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:711
Definition: nim_qchat_role_cpp_def.h:1505
Definition: nim_qchat_role_cpp_def.h:1468
Definition: nim_qchat_role_cpp_def.h:659
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:661
Definition: nim_qchat_role_cpp_def.h:1392
Definition: nim_qchat_role_cpp_def.h:595
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:597
Definition: nim_qchat_role_cpp_def.h:1093
std::string begin_accid
起查 accid,成员可能在同一个时间点被添加到某个身份组中
Definition: nim_qchat_role_cpp_def.h:1104
Definition: nim_qchat_role_cpp_def.h:358
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:360
Definition: nim_qchat_role_cpp_def.h:1430
std::string accid
用户账号
Definition: nim_qchat_role_cpp_def.h:1435
Definition: nim_qchat_role_cpp_def.h:964
Definition: nim_qchat_role_cpp_def.h:310
std::list< QChatServerRoleInfo > role_infos
返回查询的所有身份组信息
Definition: nim_qchat_role_cpp_def.h:314
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:312
std::list< QChatServerRoleInfo > joined_roles
自己已经加入的身份组列表
Definition: nim_qchat_role_cpp_def.h:316
Definition: nim_qchat_member_cpp_def.h:20
Definition: nim_qchat_role_cpp_def.h:171
Definition: nim_qchat_role_cpp_def.h:1918
Definition: nim_qchat_role_cpp_def.h:1776
Definition: nim_qchat_role_cpp_def.h:1213
Definition: nim_qchat_role_cpp_def.h:1358
std::string accid
用户账号列表
Definition: nim_qchat_role_cpp_def.h:1365
Definition: nim_qchat_role_cpp_def.h:1050
std::list< std::string > members_accids
要移除的成员列表
Definition: nim_qchat_role_cpp_def.h:1057
Definition: nim_qchat_role_cpp_def.h:45
std::string role_name
身份组名称
Definition: nim_qchat_role_cpp_def.h:51
std::string role_icon
身份组图片 URL
Definition: nim_qchat_role_cpp_def.h:53
std::string extension
身份组扩展字段
Definition: nim_qchat_role_cpp_def.h:55
Definition: nim_qchat_role_cpp_def.h:26
Definition: nim_qchat_role_cpp_def.h:107
Definition: nim_qchat_role_cpp_def.h:1872
std::string accid
用户 ID
Definition: nim_qchat_role_cpp_def.h:1879
Definition: nim_qchat_role_cpp_def.h:1730
Definition: nim_qchat_role_cpp_def.h:1167
Definition: nim_qchat_role_cpp_def.h:1316
Definition: nim_qchat_role_cpp_def.h:860
Definition: nim_qchat_role_cpp_def.h:892
std::map< uint64_t, uint64_t > priority_map
要批量更新的身份组信息,key: role_id, value: priority
Definition: nim_qchat_role_cpp_def.h:896
Definition: nim_qchat_role_cpp_def.h:293
NIMResCode res_code
操作结果,
Definition: nim_qchat_role_cpp_def.h:295