VisualRecognition extends BaseService { public ServiceCall<TrainingEvents> getTrainingUsage( GetTrainingUsageOptions getTrainingUsageOptions) { String[] pathSegments = {"v4/training_usage"}; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("watson_vision_combined", "v4", "getTrainingUsage"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (getTrainingUsageOptions != null) { if (getTrainingUsageOptions.startTime() != null) { builder.query("start_time", getTrainingUsageOptions.startTime()); } if (getTrainingUsageOptions.endTime() != null) { builder.query("end_time", getTrainingUsageOptions.endTime()); } } ResponseConverter<TrainingEvents> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<TrainingEvents>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } VisualRecognition(String versionDate);  VisualRecognition(String versionDate, Authenticator authenticator);  VisualRecognition(String versionDate, String serviceName);  VisualRecognition(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<AnalyzeResponse> analyze(AnalyzeOptions analyzeOptions); ServiceCall<Collection> createCollection(CreateCollectionOptions createCollectionOptions); ServiceCall<Collection> createCollection(); ServiceCall<CollectionsList> listCollections(
      ListCollectionsOptions listCollectionsOptions); ServiceCall<CollectionsList> listCollections(); ServiceCall<Collection> getCollection(GetCollectionOptions getCollectionOptions); ServiceCall<Collection> updateCollection(UpdateCollectionOptions updateCollectionOptions); ServiceCall<Void> deleteCollection(DeleteCollectionOptions deleteCollectionOptions); ServiceCall<InputStream> getModelFile(GetModelFileOptions getModelFileOptions); ServiceCall<ImageDetailsList> addImages(AddImagesOptions addImagesOptions); ServiceCall<ImageSummaryList> listImages(ListImagesOptions listImagesOptions); ServiceCall<ImageDetails> getImageDetails(GetImageDetailsOptions getImageDetailsOptions); ServiceCall<Void> deleteImage(DeleteImageOptions deleteImageOptions); ServiceCall<InputStream> getJpegImage(GetJpegImageOptions getJpegImageOptions); ServiceCall<ObjectMetadataList> listObjectMetadata(
      ListObjectMetadataOptions listObjectMetadataOptions); ServiceCall<UpdateObjectMetadata> updateObjectMetadata(
      UpdateObjectMetadataOptions updateObjectMetadataOptions); ServiceCall<ObjectMetadata> getObjectMetadata(
      GetObjectMetadataOptions getObjectMetadataOptions); ServiceCall<Void> deleteObject(DeleteObjectOptions deleteObjectOptions); ServiceCall<Collection> train(TrainOptions trainOptions); ServiceCall<TrainingDataObjects> addImageTrainingData(
      AddImageTrainingDataOptions addImageTrainingDataOptions); ServiceCall<TrainingEvents> getTrainingUsage(
      GetTrainingUsageOptions getTrainingUsageOptions); ServiceCall<TrainingEvents> getTrainingUsage(); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testGetTrainingUsage() throws InterruptedException { server.enqueue(jsonResponse(trainingEvents)); GetTrainingUsageOptions options = new GetTrainingUsageOptions.Builder().build(); TrainingEvents response = service.getTrainingUsage(options).execute().getResult(); RecordedRequest request = server.takeRequest(); assertEquals("GET", request.getMethod()); assertEquals(testDate, response.getStartTime()); assertEquals(testDate, response.getEndTime()); assertEquals(COMPLETED_EVENTS, response.getCompletedEvents()); assertEquals(TRAINED_IMAGES, response.getTrainedImages()); assertEquals(TYPE, response.getEvents().get(0).getType()); assertEquals(COLLECTION_ID, response.getEvents().get(0).getCollectionId()); assertEquals(testDate, response.getEvents().get(0).getCompletionTime()); assertEquals(STATUS, response.getEvents().get(0).getStatus()); assertEquals(IMAGE_COUNT, response.getEvents().get(0).getImageCount()); }