updateUser method

Future<UpdateUserResponse> updateUser({
  1. required String userName,
  2. String? accessString,
  3. AuthenticationMode? authenticationMode,
})

Changes user password(s) and/or access string.

May throw InvalidParameterCombinationException. May throw InvalidParameterValueException. May throw InvalidUserStateFault. May throw UserNotFoundFault.

Parameter userName : The name of the user

Parameter accessString : Access permissions string used for this user.

Parameter authenticationMode : Denotes the user's authentication properties, such as whether it requires a password to authenticate.

Implementation

Future<UpdateUserResponse> updateUser({
  required String userName,
  String? accessString,
  AuthenticationMode? authenticationMode,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonMemoryDB.UpdateUser'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'UserName': userName,
      if (accessString != null) 'AccessString': accessString,
      if (authenticationMode != null)
        'AuthenticationMode': authenticationMode,
    },
  );

  return UpdateUserResponse.fromJson(jsonResponse.body);
}