code: public List<Role> getRoles(HashMap<String, String> queryParameters, int maxResults) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
  		ExtractionContext context = getResource(queryParameters, Constants.GET_ROLES_URL);
  
  		OneloginOAuthJSONResourceResponse oAuthResponse = null;
  		String afterCursor = null;
  		List<Role> roles = new ArrayList<Role>(maxResults);
  		while (oAuthResponse == null || (roles.size() < maxResults && afterCursor != null)) {
  			oAuthResponse = context.oAuthClient.resource(context.bearerRequest, OAuth.HttpMethod.GET, OneloginOAuthJSONResourceResponse.class);
  			if ((afterCursor = getRolesBatch(roles, context.url, context.bearerRequest, oAuthResponse)) == null) {
  				break;
  			}
  		}
  
  		return roles;
  	}
docs: Gets a list of Role resources.
  
  @param queryParameters Query parameters of the Resource
  Parameters to filter the result of the list
  @param maxResults
  Limit the number of roles returned (optional)
  
  @return List of Role
  
  @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 getResource call
  
  @see com.onelogin.sdk.model.Role
  @see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/roles/get-roles">Get Roles documentation</a>