updateSidebarCategoriesForTeamForUser method

Future<MmSidebarCategory?> updateSidebarCategoriesForTeamForUser(
  1. String teamId,
  2. String userId,
  3. List<MmSidebarCategory> mmSidebarCategory
)

Update user's sidebar categories

Update any number of sidebar categories for the user on the given team. This can be used to reorder the channels in these categories. Minimum server version: 5.26 ##### Permissions Must be authenticated and have the list_team_channels permission.

Parameters:

Implementation

Future<MmSidebarCategory?> updateSidebarCategoriesForTeamForUser(
  String teamId,
  String userId,
  List<MmSidebarCategory> mmSidebarCategory,
) async {
  final response = await updateSidebarCategoriesForTeamForUserWithHttpInfo(
    teamId,
    userId,
    mmSidebarCategory,
  );
  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),
      'MmSidebarCategory',
    ) as MmSidebarCategory;
  }
  return null;
}