getRole method

Future<GetRoleResponse> getRole({
  1. required String roleName,
})

Retrieves information about the specified role, including the role's path, GUID, ARN, and the role's trust policy that grants permission to assume the role. For more information about roles, see Working with Roles.

May throw NoSuchEntityException. May throw ServiceFailureException.

Parameter roleName : The name of the IAM role to get information about.

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