activateUser method
Activates the specified user. Only active users can access 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<ActivateUserResponse> activateUser({
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(),
};
final response = await _protocol.send(
payload: null,
method: 'POST',
requestUri: '/api/v1/users/${Uri.encodeComponent(userId)}/activation',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ActivateUserResponse.fromJson(response);
}