CompareComply extends BaseService { public ServiceCall<BatchStatus> createBatch(CreateBatchOptions createBatchOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( createBatchOptions, "createBatchOptions cannot be null"); String[] pathSegments = {"v1/batches"}; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("compare-comply", "v1", "createBatch"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("function", createBatchOptions.function()); if (createBatchOptions.model() != null) { builder.query("model", createBatchOptions.model()); } MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); multipartBuilder.setType(MultipartBody.FORM); okhttp3.RequestBody inputCredentialsFileBody = RequestUtils.inputStreamBody(createBatchOptions.inputCredentialsFile(), "application/json"); multipartBuilder.addFormDataPart( "input_credentials_file", "filename", inputCredentialsFileBody); multipartBuilder.addFormDataPart( "input_bucket_location", createBatchOptions.inputBucketLocation()); multipartBuilder.addFormDataPart("input_bucket_name", createBatchOptions.inputBucketName()); okhttp3.RequestBody outputCredentialsFileBody = RequestUtils.inputStreamBody( createBatchOptions.outputCredentialsFile(), "application/json"); multipartBuilder.addFormDataPart( "output_credentials_file", "filename", outputCredentialsFileBody); multipartBuilder.addFormDataPart( "output_bucket_location", createBatchOptions.outputBucketLocation()); multipartBuilder.addFormDataPart("output_bucket_name", createBatchOptions.outputBucketName()); builder.body(multipartBuilder.build()); ResponseConverter<BatchStatus> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<BatchStatus>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } CompareComply(String versionDate);  CompareComply(String versionDate, Authenticator authenticator);  CompareComply(String versionDate, String serviceName);  CompareComply(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<HTMLReturn> convertToHtml(ConvertToHtmlOptions convertToHtmlOptions); ServiceCall<ClassifyReturn> classifyElements(
      ClassifyElementsOptions classifyElementsOptions); ServiceCall<TableReturn> extractTables(ExtractTablesOptions extractTablesOptions); ServiceCall<CompareReturn> compareDocuments(
      CompareDocumentsOptions compareDocumentsOptions); ServiceCall<FeedbackReturn> addFeedback(AddFeedbackOptions addFeedbackOptions); ServiceCall<FeedbackList> listFeedback(ListFeedbackOptions listFeedbackOptions); ServiceCall<FeedbackList> listFeedback(); ServiceCall<GetFeedback> getFeedback(GetFeedbackOptions getFeedbackOptions); ServiceCall<FeedbackDeleted> deleteFeedback(DeleteFeedbackOptions deleteFeedbackOptions); ServiceCall<BatchStatus> createBatch(CreateBatchOptions createBatchOptions); ServiceCall<Batches> listBatches(ListBatchesOptions listBatchesOptions); ServiceCall<Batches> listBatches(); ServiceCall<BatchStatus> getBatch(GetBatchOptions getBatchOptions); ServiceCall<BatchStatus> updateBatch(UpdateBatchOptions updateBatchOptions);  }
@Test public void testCreateBatch() throws FileNotFoundException, InterruptedException { server.enqueue(jsonResponse(batchStatusResponse)); CreateBatchOptions createBatchOptions = new CreateBatchOptions.Builder() .function(CreateBatchOptions.Function.ELEMENT_CLASSIFICATION) .inputCredentialsFile(CREDENTIALS_FILE) .inputBucketLocation(BUCKET_LOCATION) .inputBucketName(BUCKET_NAME) .outputCredentialsFile(CREDENTIALS_FILE) .outputBucketLocation(BUCKET_LOCATION) .outputBucketName(BUCKET_NAME) .build(); BatchStatus response = service.createBatch(createBatchOptions).execute().getResult(); RecordedRequest request = server.takeRequest(); assertEquals(CREATE_BATCH_PATH, request.getPath()); assertBatchStatusResponse(response); }