deleteRole method

Future<void> deleteRole({
  1. required String roleName,
})

Deletes the specified role. The role must not have any policies attached. For more information about roles, go to Working with Roles.

May throw NoSuchEntityException. May throw DeleteConflictException. May throw LimitExceededException. May throw UnmodifiableEntityException. May throw ConcurrentModificationException. May throw ServiceFailureException.

Parameter roleName : The name of the role to delete.

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> deleteRole({
  required String roleName,
}) async {
  ArgumentError.checkNotNull(roleName, 'roleName');
  _s.validateStringLength(
    'roleName',
    roleName,
    1,
    64,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['RoleName'] = roleName;
  await _protocol.send(
    $request,
    action: 'DeleteRole',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteRoleRequest'],
    shapes: shapes,
  );
}