addUserToGroup method

Future<void> addUserToGroup({
  1. required String groupName,
  2. required String userName,
})

Adds the specified user to the specified group.

May throw NoSuchEntityException. May throw LimitExceededException. May throw ServiceFailureException.

Parameter groupName : The name of the group to update.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Parameter userName : The name of the user to add.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Implementation

Future<void> addUserToGroup({
  required String groupName,
  required String userName,
}) async {
  ArgumentError.checkNotNull(groupName, 'groupName');
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userName, 'userName');
  _s.validateStringLength(
    'userName',
    userName,
    1,
    128,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['GroupName'] = groupName;
  $request['UserName'] = userName;
  await _protocol.send(
    $request,
    action: 'AddUserToGroup',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['AddUserToGroupRequest'],
    shapes: shapes,
  );
}