autocompleteUsers method
Autocomplete users
Get a list of users for the purpose of autocompleting based on the provided search term. Specify a combination of team_id
and channel_id
to filter results further. ##### Permissions Requires an active session and view_team
and read_channel
on any teams or channels used to filter the results further.
Parameters:
Implementation
Future<MmUserAutocomplete?> autocompleteUsers(
String name, {
String? teamId,
String? channelId,
int? limit,
}) async {
final response = await autocompleteUsersWithHttpInfo(
name,
teamId: teamId,
channelId: channelId,
limit: limit,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'MmUserAutocomplete',
) as MmUserAutocomplete;
}
return null;
}