searchAllChannels method
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.
Parameters:
inlineObject45
systemConsole
- Is the request from system_console. If this is set to true, it filters channels by the logged in user.cancelToken
- ACancelToken
that can be used to cancel the operationheaders
- Can be used to add additional headers to the requestextras
- Can be used to add flags to the requestvalidateStatus
- AValidateStatus
callback that can be used to determine request success based on the HTTP status of the responseonSendProgress
- AProgressCallback
that can be used to get the send progressonReceiveProgress
- AProgressCallback
that can be used to get the receive progress
Returns a Future containing a Response
with a InlineResponse2007 as data
Throws DioError
if API call or serialization fails
Implementation
Future<Response<InlineResponse2007>> searchAllChannels({
required InlineObject45 inlineObject45,
bool? systemConsole = true,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/channels/search';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'bearerAuth',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (systemConsole != null) r'system_console': encodeQueryParameter(_serializers, systemConsole, const FullType(bool)),
};
dynamic _bodyData;
try {
const _type = FullType(InlineObject45);
_bodyData = _serializers.serialize(inlineObject45, specifiedType: _type);
} catch(error, stackTrace) {
throw DioError(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
),
type: DioErrorType.other,
error: error,
)..stackTrace = stackTrace;
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
InlineResponse2007 _responseData;
try {
const _responseType = FullType(InlineResponse2007);
_responseData = _serializers.deserialize(
_response.data!,
specifiedType: _responseType,
) as InlineResponse2007;
} catch (error, stackTrace) {
throw DioError(
requestOptions: _response.requestOptions,
response: _response,
type: DioErrorType.other,
error: error,
)..stackTrace = stackTrace;
}
return Response<InlineResponse2007>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}