modifyUser method
Changes user password(s) and/or access string.
May throw UserNotFoundFault. May throw InvalidUserStateFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.
Parameter userId
:
The ID of the user.
Parameter accessString
:
Access permissions string used for this user.
Parameter appendAccessString
:
Adds additional user permissions to the access string.
Parameter noPasswordRequired
:
Indicates no password is required for the user.
Parameter passwords
:
The passwords belonging to the user. You are allowed up to two.
Implementation
Future<User> modifyUser({
required String userId,
String? accessString,
String? appendAccessString,
bool? noPasswordRequired,
List<String>? passwords,
}) async {
ArgumentError.checkNotNull(userId, 'userId');
_s.validateStringLength(
'userId',
userId,
1,
1152921504606846976,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['UserId'] = userId;
accessString?.also((arg) => $request['AccessString'] = arg);
appendAccessString?.also((arg) => $request['AppendAccessString'] = arg);
noPasswordRequired?.also((arg) => $request['NoPasswordRequired'] = arg);
passwords?.also((arg) => $request['Passwords'] = arg);
final $result = await _protocol.send(
$request,
action: 'ModifyUser',
version: '2015-02-02',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ModifyUserMessage'],
shapes: shapes,
resultWrapper: 'ModifyUserResult',
);
return User.fromXml($result);
}