deleteUser method

Future<User> deleteUser({
  1. required String userId,
})

For Redis engine version 6.x onwards: Deletes a user. The user will be removed from all user groups and in turn removed from all replication groups. For more information, see Using Role Based Access Control (RBAC).

May throw InvalidUserStateFault. May throw UserNotFoundFault. May throw InvalidParameterValueException. May throw DefaultUserAssociatedToUserGroupFault.

Parameter userId : The ID of the user.

Implementation

Future<User> deleteUser({
  required String userId,
}) async {
  ArgumentError.checkNotNull(userId, 'userId');
  _s.validateStringLength(
    'userId',
    userId,
    1,
    1152921504606846976,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['UserId'] = userId;
  final $result = await _protocol.send(
    $request,
    action: 'DeleteUser',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteUserMessage'],
    shapes: shapes,
    resultWrapper: 'DeleteUserResult',
  );
  return User.fromXml($result);
}