code: public List<Event> getEvents(HashMap<String, String> queryParameters, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
  		ExtractionContext context = getResource(queryParameters, Constants.GET_EVENTS_URL);
  
  		OneloginOAuthJSONResourceResponse oAuthResponse = null;
  		String afterCursor = null;
  		List<Event> events = new ArrayList<Event>(maxResults);
  		while (oAuthResponse == null || (events.size() < maxResults && afterCursor != null)) {
  			oAuthResponse = context.oAuthClient.resource(context.bearerRequest, OAuth.HttpMethod.GET, OneloginOAuthJSONResourceResponse.class);
  			if ((afterCursor = getEventsBatch(events, context.url, context.bearerRequest, oAuthResponse)) == null) {
  				break;
  			}
  		}
  
  		return events;
  	}
docs: Gets a list of Event resources.
  
  @param queryParameters Query parameters of the Resource
  Parameters to filter the result of the list
  @param maxResults
  Limit the number of events returned (optional)
  
  @return List of Event
  
  @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
  @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
  @throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
  
  @see com.onelogin.sdk.model.Event
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/events/get-events">Get Events documentation</a>