LanguageTranslator extends BaseService { public ServiceCall<DocumentList> listDocuments(ListDocumentsOptions listDocumentsOptions) { String[] pathSegments = {"v3/documents"}; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("language_translator", "v3", "listDocuments"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (listDocumentsOptions != null) {} ResponseConverter<DocumentList> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<DocumentList>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } LanguageTranslator(String versionDate);  LanguageTranslator(String versionDate, Authenticator authenticator);  LanguageTranslator(String versionDate, String serviceName);  LanguageTranslator(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<Languages> listLanguages(ListLanguagesOptions listLanguagesOptions); ServiceCall<Languages> listLanguages(); ServiceCall<TranslationResult> translate(TranslateOptions translateOptions); ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(
      ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions); ServiceCall<IdentifiableLanguages> listIdentifiableLanguages(); ServiceCall<IdentifiedLanguages> identify(IdentifyOptions identifyOptions); ServiceCall<TranslationModels> listModels(ListModelsOptions listModelsOptions); ServiceCall<TranslationModels> listModels(); ServiceCall<TranslationModel> createModel(CreateModelOptions createModelOptions); ServiceCall<DeleteModelResult> deleteModel(DeleteModelOptions deleteModelOptions); ServiceCall<TranslationModel> getModel(GetModelOptions getModelOptions); ServiceCall<DocumentList> listDocuments(ListDocumentsOptions listDocumentsOptions); ServiceCall<DocumentList> listDocuments(); ServiceCall<DocumentStatus> translateDocument(
      TranslateDocumentOptions translateDocumentOptions); ServiceCall<DocumentStatus> getDocumentStatus(
      GetDocumentStatusOptions getDocumentStatusOptions); ServiceCall<Void> deleteDocument(DeleteDocumentOptions deleteDocumentOptions); ServiceCall<InputStream> getTranslatedDocument(
      GetTranslatedDocumentOptions getTranslatedDocumentOptions);  }
@Test public void testListDocuments() throws InterruptedException { server.enqueue(jsonResponse(documentList)); ListDocumentsOptions options = new ListDocumentsOptions.Builder().build(); DocumentList response = service.listDocuments(options).execute().getResult(); RecordedRequest request = server.takeRequest(); assertEquals(GET, request.getMethod()); assertEquals( documentList.getDocuments().get(0).getDocumentId(), response.getDocuments().get(0).getDocumentId()); assertEquals( documentList.getDocuments().get(0).getBaseModelId(), response.getDocuments().get(0).getBaseModelId()); assertEquals( documentList.getDocuments().get(0).getCharacterCount(), response.getDocuments().get(0).getCharacterCount()); assertEquals( documentList.getDocuments().get(0).getCompleted(), response.getDocuments().get(0).getCompleted()); assertEquals( documentList.getDocuments().get(0).getCreated(), response.getDocuments().get(0).getCreated()); assertEquals( documentList.getDocuments().get(0).getFilename(), response.getDocuments().get(0).getFilename()); assertEquals( documentList.getDocuments().get(0).getModelId(), response.getDocuments().get(0).getModelId()); assertEquals( documentList.getDocuments().get(0).getSource(), response.getDocuments().get(0).getSource()); assertEquals( documentList.getDocuments().get(0).getStatus(), response.getDocuments().get(0).getStatus()); assertEquals( documentList.getDocuments().get(0).getTarget(), response.getDocuments().get(0).getTarget()); assertEquals( documentList.getDocuments().get(0).getWordCount(), response.getDocuments().get(0).getWordCount()); }
@Test public void testListDocumentsNoOptions() throws InterruptedException { server.enqueue(jsonResponse(documentList)); DocumentList response = service.listDocuments().execute().getResult(); RecordedRequest request = server.takeRequest(); assertEquals(GET, request.getMethod()); assertEquals( documentList.getDocuments().get(0).getDocumentId(), response.getDocuments().get(0).getDocumentId()); assertEquals( documentList.getDocuments().get(0).getBaseModelId(), response.getDocuments().get(0).getBaseModelId()); assertEquals( documentList.getDocuments().get(0).getCharacterCount(), response.getDocuments().get(0).getCharacterCount()); assertEquals( documentList.getDocuments().get(0).getCompleted(), response.getDocuments().get(0).getCompleted()); assertEquals( documentList.getDocuments().get(0).getCreated(), response.getDocuments().get(0).getCreated()); assertEquals( documentList.getDocuments().get(0).getFilename(), response.getDocuments().get(0).getFilename()); assertEquals( documentList.getDocuments().get(0).getModelId(), response.getDocuments().get(0).getModelId()); assertEquals( documentList.getDocuments().get(0).getSource(), response.getDocuments().get(0).getSource()); assertEquals( documentList.getDocuments().get(0).getStatus(), response.getDocuments().get(0).getStatus()); assertEquals( documentList.getDocuments().get(0).getTarget(), response.getDocuments().get(0).getTarget()); assertEquals( documentList.getDocuments().get(0).getWordCount(), response.getDocuments().get(0).getWordCount()); }