createUserGroup method

Future<UserGroup> createUserGroup({
  1. required String engine,
  2. required String userGroupId,
  3. List<String>? userIds,
})

For Redis engine version 6.x onwards: Creates a Redis user group. For more information, see Using Role Based Access Control (RBAC)

May throw UserNotFoundFault. May throw DuplicateUserNameFault. May throw UserGroupAlreadyExistsFault. May throw DefaultUserRequired. May throw UserGroupQuotaExceededFault. May throw InvalidParameterValueException.

Parameter engine : The current supported value is Redis.

Parameter userGroupId : The ID of the user group.

Parameter userIds : The list of user IDs that belong to the user group.

Implementation

Future<UserGroup> createUserGroup({
  required String engine,
  required String userGroupId,
  List<String>? userIds,
}) async {
  ArgumentError.checkNotNull(engine, 'engine');
  ArgumentError.checkNotNull(userGroupId, 'userGroupId');
  final $request = <String, dynamic>{};
  $request['Engine'] = engine;
  $request['UserGroupId'] = userGroupId;
  userIds?.also((arg) => $request['UserIds'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateUserGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateUserGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateUserGroupResult',
  );
  return UserGroup.fromXml($result);
}