updateTeamMemberSchemeRoles method
Future<MmStatusOK?>
updateTeamMemberSchemeRoles(
- String teamId,
- String userId,
- MmUpdateTeamMemberSchemeRolesRequest mmUpdateTeamMemberSchemeRolesRequest
Update the scheme-derived roles of a team member.
Update a team member's scheme_admin/scheme_user properties. Typically this should either be scheme_admin=false, scheme_user=true
for ordinary team member, or scheme_admin=true, scheme_user=true
for a team admin. Minimum server version: 5.0 ##### Permissions Must be authenticated and have the manage_team_roles
permission.
Parameters:
-
String teamId (required): Team GUID
-
String userId (required): User GUID
-
MmUpdateTeamMemberSchemeRolesRequest mmUpdateTeamMemberSchemeRolesRequest (required): Scheme properties.
Implementation
Future<MmStatusOK?> updateTeamMemberSchemeRoles(
String teamId,
String userId,
MmUpdateTeamMemberSchemeRolesRequest mmUpdateTeamMemberSchemeRolesRequest,
) async {
final response = await updateTeamMemberSchemeRolesWithHttpInfo(
teamId,
userId,
mmUpdateTeamMemberSchemeRolesRequest,
);
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;
}