public Collection < BoxGroupMembership . Info > getMemberships ( ) { BoxAPIConnection api = this . getAPI ( ) ; URL url = USER_MEMBERSHIPS_URL_TEMPLATE . build ( this . getAPI ( ) . getBaseURL ( ) , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( api , url , "GET" ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject responseJSON = JsonObject . readFrom ( response . getJSON ( ) ) ; int entriesCount = responseJSON . get ( "total_count" ) . asInt ( ) ; Collection < BoxGroupMembership . Info > memberships = new ArrayList < BoxGroupMembership . Info > ( entriesCount ) ; JsonArray entries = responseJSON . get ( "entries" ) . asArray ( ) ; for ( JsonValue entry : entries ) { JsonObject entryObject = entry . asObject ( ) ; BoxGroupMembership membership = new BoxGroupMembership ( api , entryObject . get ( "id" ) . asString ( ) ) ; BoxGroupMembership . Info info = membership . new Info ( entryObject ) ; memberships . add ( info ) ; } return memberships ; }
Gets information about all of the group memberships for this user . Does not support paging .