VisualRecognition extends BaseService { public ServiceCall<InputStream> getCoreMlModel(GetCoreMlModelOptions getCoreMlModelOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( getCoreMlModelOptions, "getCoreMlModelOptions cannot be null"); String[] pathSegments = {"v3/classifiers", "core_ml_model"}; String[] pathParameters = {getCoreMlModelOptions.classifierId()}; RequestBuilder builder = RequestBuilder.get( RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("watson_vision_combined", "v3", "getCoreMlModel"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/octet-stream"); ResponseConverter<InputStream> responseConverter = ResponseConverterUtils.getInputStream(); 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<ClassifiedImages> classify(ClassifyOptions classifyOptions); ServiceCall<ClassifiedImages> classify(); ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions); ServiceCall<Classifiers> listClassifiers(ListClassifiersOptions listClassifiersOptions); ServiceCall<Classifiers> listClassifiers(); ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions); ServiceCall<Classifier> updateClassifier(UpdateClassifierOptions updateClassifierOptions); ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions); ServiceCall<InputStream> getCoreMlModel(GetCoreMlModelOptions getCoreMlModelOptions); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testGetCoreMlModel() throws IOException, InterruptedException { final File model = new File("src/test/resources/visual_recognition/v3/custom_model.mlmodel"); @SuppressWarnings("resource") final Buffer buffer = new Buffer().write(Files.toByteArray(model)); server.enqueue( new MockResponse() .addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_OCTET_STREAM) .setBody(buffer)); String classifierId = "classifier_id"; GetCoreMlModelOptions options = new GetCoreMlModelOptions.Builder().classifierId(classifierId).build(); InputStream modelFile = service.getCoreMlModel(options).execute().getResult(); RecordedRequest request = server.takeRequest(); String path = String.format(PATH_CORE_ML, classifierId) + "?" + VERSION_KEY + "=" + VERSION; assertEquals(path, request.getPath()); assertEquals("GET", request.getMethod()); File outputFile = new File("src/test/resources/visual_recognition/v3/model_result.mlmodel"); outputFile.createNewFile(); writeInputStreamToFile(modelFile, outputFile); }