getAllChannelsWithHttpInfo method
Get a list of all channels
Permissions manage_system
Note: This method returns the HTTP Response
.
Parameters:
-
String notAssociatedToGroup: A group id to exclude channels that are associated with that group via GroupChannel records. This can also be left blank with
not_associated_to_group=
. -
int page:
-
int perPage:
-
bool excludeDefaultChannels: Whether to exclude default channels (ex Town Square, Off-Topic) from the results.
-
bool includeDeleted: Include channels that have been archived. This correlates to the
DeleteAt
flag being set in the database. -
bool includeTotalCount: Appends a total count of returned channels inside the response object - ex:
{ \"channels\": [], \"total_count\" : 0 }
. -
bool excludePolicyConstrained: If set to true, channels which are part of a data retention policy will be excluded. The
sysconsole_read_compliance
permission is required to use this parameter. Minimum server version: 5.35
Implementation
Future<Response> getAllChannelsWithHttpInfo({
String? notAssociatedToGroup,
int? page,
int? perPage,
bool? excludeDefaultChannels,
bool? includeDeleted,
bool? includeTotalCount,
bool? excludePolicyConstrained,
}) async {
// ignore: prefer_const_declarations
final path = r'/channels';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <MmQueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (notAssociatedToGroup != null) {
queryParams.addAll(_queryParams('', 'not_associated_to_group', notAssociatedToGroup));
}
if (page != null) {
queryParams.addAll(_queryParams('', 'page', page));
}
if (perPage != null) {
queryParams.addAll(_queryParams('', 'per_page', perPage));
}
if (excludeDefaultChannels != null) {
queryParams.addAll(_queryParams('', 'exclude_default_channels', excludeDefaultChannels));
}
if (includeDeleted != null) {
queryParams.addAll(_queryParams('', 'include_deleted', includeDeleted));
}
if (includeTotalCount != null) {
queryParams.addAll(_queryParams('', 'include_total_count', includeTotalCount));
}
if (excludePolicyConstrained != null) {
queryParams.addAll(_queryParams('', 'exclude_policy_constrained', excludePolicyConstrained));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}