searchAllChannelsWithHttpInfo method

Future<Response> searchAllChannelsWithHttpInfo(
  1. MmSearchAllChannelsRequest mmSearchAllChannelsRequest, {
  2. bool? systemConsole,
})

Search all private and open type channels across all teams

Returns all private and open type channels where 'term' matches on the name, display name, or purpose of the channel. Configured 'default' channels (ex Town Square and Off-Topic) can be excluded from the results with the exclude_default_channels boolean parameter. Channels that are associated (via GroupChannel records) to a given group can be excluded from the results with the not_associated_to_group parameter and a group id string.

Note: This method returns the HTTP Response.

Parameters:

  • MmSearchAllChannelsRequest mmSearchAllChannelsRequest (required): The search terms and logic to use in the search.

  • bool systemConsole: Is the request from system_console. If this is set to true, it filters channels by the logged in user.

Implementation

Future<Response> searchAllChannelsWithHttpInfo(
  MmSearchAllChannelsRequest mmSearchAllChannelsRequest, {
  bool? systemConsole,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/channels/search';

  // ignore: prefer_final_locals
  Object? postBody = mmSearchAllChannelsRequest;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (systemConsole != null) {
    queryParams.addAll(_queryParams('', 'system_console', systemConsole));
  }

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}