updateTeamPrivacy method
Future<MmTeam?>
updateTeamPrivacy(
- String teamId,
- MmUpdateTeamPrivacyRequest mmUpdateTeamPrivacyRequest
Update teams's privacy
Updates team's privacy allowing changing a team from Public (open) to Private (invitation only) and back. Minimum server version: 5.24 ##### Permissions manage_team
permission for the team of the team.
Parameters:
-
String teamId (required): Team GUID
-
MmUpdateTeamPrivacyRequest mmUpdateTeamPrivacyRequest (required):
Implementation
Future<MmTeam?> updateTeamPrivacy(
String teamId,
MmUpdateTeamPrivacyRequest mmUpdateTeamPrivacyRequest,
) async {
final response = await updateTeamPrivacyWithHttpInfo(
teamId,
mmUpdateTeamPrivacyRequest,
);
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),
'MmTeam',
) as MmTeam;
}
return null;
}