library/src/main/java/com/kdgregory/aws/utils/iam/IAMUtil.java
/**
     *  Retrieves all roles for the account, internally handling pagination.
     */
Retrieves all roles for the account, internally handling pagination.
Retrieves all roles for the account internally handling pagination .
public static List<Role> retrieveAllRoles(AmazonIdentityManagement iamClient)
    {
        List<Role> result = new ArrayList<>();
        ListRolesRequest request = new ListRolesRequest();
        ListRolesResult response = null;
        do
        {
            response = iamClient.listRoles(request);
            result.addAll(response.getRoles());
            request.setMarker(response.getMarker());
        } while ((response.isTruncated() != null) && response.isTruncated().booleanValue());
        return result;
    }
public static List < Role > retrieveAllRoles ( AmazonIdentityManagement iamClient ) { List < Role > result = new ArrayList < > ( ) ; ListRolesRequest request = new ListRolesRequest ( ) ; ListRolesResult response = null ; do { response = iamClient . listRoles ( request ) ; result . addAll ( response . getRoles ( ) ) ; request . setMarker ( response . getMarker ( ) ) ; } while ( ( response . isTruncated ( ) != null ) && response . isTruncated ( ) . booleanValue ( ) ) ; return result ; }
Retrieves all roles for the account, internally handling pagination.
Retrieves all roles for the account internally handling pagination .