getTotalUsersStatsFilteredWithHttpInfo method
Get total count of users in the system matching the specified filters
Get a count of users in the system matching the specified filters. Minimum server version: 5.26 ##### Permissions Must have manage_system
permission.
Note: This method returns the HTTP Response
.
Parameters:
-
String inTeam: The ID of the team to get user stats for.
-
String inChannel: The ID of the channel to get user stats for.
-
bool includeDeleted: If deleted accounts should be included in the count.
-
bool includeBots: If bot accounts should be included in the count.
-
String roles: Comma separated string used to filter users based on any of the specified system roles Example:
?roles=system_admin,system_user
will include users that are either system admins or system users -
String channelRoles: Comma separated string used to filter users based on any of the specified channel roles, can only be used in conjunction with
in_channel
Example:?in_channel=4eb6axxw7fg3je5iyasnfudc5y&channel_roles=channel_user
will include users that are only channel users and not admins or guests -
String teamRoles: Comma separated string used to filter users based on any of the specified team roles, can only be used in conjunction with
in_team
Example:?in_team=4eb6axxw7fg3je5iyasnfudc5y&team_roles=team_user
will include users that are only team users and not admins or guests
Implementation
Future<Response> getTotalUsersStatsFilteredWithHttpInfo({
String? inTeam,
String? inChannel,
bool? includeDeleted,
bool? includeBots,
String? roles,
String? channelRoles,
String? teamRoles,
}) async {
// ignore: prefer_const_declarations
final path = r'/users/stats/filtered';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <MmQueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (inTeam != null) {
queryParams.addAll(_queryParams('', 'in_team', inTeam));
}
if (inChannel != null) {
queryParams.addAll(_queryParams('', 'in_channel', inChannel));
}
if (includeDeleted != null) {
queryParams.addAll(_queryParams('', 'include_deleted', includeDeleted));
}
if (includeBots != null) {
queryParams.addAll(_queryParams('', 'include_bots', includeBots));
}
if (roles != null) {
queryParams.addAll(_queryParams('', 'roles', roles));
}
if (channelRoles != null) {
queryParams.addAll(_queryParams('', 'channel_roles', channelRoles));
}
if (teamRoles != null) {
queryParams.addAll(_queryParams('', 'team_roles', teamRoles));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}