public void savePersonalFavorite ( Target target , String category ) throws WorkspaceApiException { TargetspersonalfavoritessaveData data = new TargetspersonalfavoritessaveData ( ) ; data . setCategory ( category ) ; data . setTarget ( toInformation ( target ) ) ; PersonalFavoriteData favData = new PersonalFavoriteData ( ) ; favData . setData ( data ) ; try { ApiSuccessResponse resp = targetsApi . savePersonalFavorite ( favData ) ; Util . throwIfNotOk ( resp ) ; } catch ( ApiException ex ) { throw new WorkspaceApiException ( "Cannot save personal favorites" , ex ) ; } }
Save a target to the agent s personal favorites in the specified category .