updateChannelScheme method
Future<MmStatusOK?>
updateChannelScheme(
- String channelId,
- MmUpdateTeamSchemeRequest mmUpdateTeamSchemeRequest
Set a channel's scheme
Set a channel's scheme, more specifically sets the scheme_id value of a channel record. ##### Permissions Must have manage_system
permission. Minimum server version: 4.10
Parameters:
-
String channelId (required): Channel GUID
-
MmUpdateTeamSchemeRequest mmUpdateTeamSchemeRequest (required): Scheme GUID
Implementation
Future<MmStatusOK?> updateChannelScheme(
String channelId,
MmUpdateTeamSchemeRequest mmUpdateTeamSchemeRequest,
) async {
final response = await updateChannelSchemeWithHttpInfo(
channelId,
mmUpdateTeamSchemeRequest,
);
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),
'MmStatusOK',
) as MmStatusOK;
}
return null;
}