updateGroup method

Future<void> updateGroup({
  1. required String groupName,
  2. String? newGroupName,
  3. String? newPath,
})

Updates the name and/or the path of the specified IAM group.

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

Parameter groupName : Name of the IAM group to update. If you're changing the name of the group, this is the original name.

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 newGroupName : New name for the IAM group. Only include this if changing the group's name.

IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".

Parameter newPath : New path for the IAM group. Only include this if changing the group's path.

This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

Implementation

Future<void> updateGroup({
  required String groupName,
  String? newGroupName,
  String? newPath,
}) async {
  ArgumentError.checkNotNull(groupName, 'groupName');
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'newGroupName',
    newGroupName,
    1,
    128,
  );
  _s.validateStringLength(
    'newPath',
    newPath,
    1,
    512,
  );
  final $request = <String, dynamic>{};
  $request['GroupName'] = groupName;
  newGroupName?.also((arg) => $request['NewGroupName'] = arg);
  newPath?.also((arg) => $request['NewPath'] = arg);
  await _protocol.send(
    $request,
    action: 'UpdateGroup',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['UpdateGroupRequest'],
    shapes: shapes,
  );
}