public List < EventType > getEventTypes ( ) throws URISyntaxException , ClientProtocolException , IOException { URIBuilder url = new URIBuilder ( settings . getURL ( Constants . GET_EVENT_TYPES_URL ) ) ; CloseableHttpClient httpclient = HttpClients . createDefault ( ) ; HttpGet httpGet = new HttpGet ( url . toString ( ) ) ; httpGet . setHeader ( "Accept" , "application/json" ) ; CloseableHttpResponse response = httpclient . execute ( httpGet ) ; String json_string = EntityUtils . toString ( response . getEntity ( ) ) ; JSONObject json_object = new JSONObject ( json_string ) ; JSONArray data = json_object . getJSONArray ( "data" ) ; List < EventType > eventTypes = new ArrayList < EventType > ( ) ; for ( int i = 0 ; i < data . length ( ) ; i ++ ) { JSONObject j_object = data . getJSONObject ( i ) ; EventType eventType = new EventType ( j_object ) ; eventTypes . add ( eventType ) ; } return eventTypes ; }
List of all OneLogin event types available to the Events API .