deactivateUser method
Deactivates the specified user, which revokes the user's access to Amazon WorkDocs.
May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.
Parameter userId
:
The ID of the user.
Parameter authenticationToken
:
Amazon WorkDocs authentication token. Not required when using AWS
administrator credentials to access the API.
Implementation
Future<void> deactivateUser({
required String userId,
String? authenticationToken,
}) async {
ArgumentError.checkNotNull(userId, 'userId');
_s.validateStringLength(
'userId',
userId,
1,
256,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri: '/api/v1/users/${Uri.encodeComponent(userId)}/activation',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}