SpeechToText extends BaseService { public ServiceCall<AudioResources> listAudio(ListAudioOptions listAudioOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( listAudioOptions, "listAudioOptions cannot be null"); String[] pathSegments = {"v1/acoustic_customizations", "audio"}; String[] pathParameters = {listAudioOptions.customizationId()}; RequestBuilder builder = RequestBuilder.get( RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters)); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("speech_to_text", "v1", "listAudio"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); ResponseConverter<AudioResources> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<AudioResources>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } SpeechToText();  SpeechToText(Authenticator authenticator);  SpeechToText(String serviceName);  SpeechToText(String serviceName, Authenticator authenticator); ServiceCall<SpeechModels> listModels(ListModelsOptions listModelsOptions); ServiceCall<SpeechModels> listModels(); ServiceCall<SpeechModel> getModel(GetModelOptions getModelOptions); ServiceCall<SpeechRecognitionResults> recognize(RecognizeOptions recognizeOptions); WebSocket recognizeUsingWebSocket(
      RecognizeOptions recognizeOptions, RecognizeCallback callback); ServiceCall<RegisterStatus> registerCallback(
      RegisterCallbackOptions registerCallbackOptions); ServiceCall<Void> unregisterCallback(UnregisterCallbackOptions unregisterCallbackOptions); ServiceCall<RecognitionJob> createJob(CreateJobOptions createJobOptions); ServiceCall<RecognitionJobs> checkJobs(CheckJobsOptions checkJobsOptions); ServiceCall<RecognitionJobs> checkJobs(); ServiceCall<RecognitionJob> checkJob(CheckJobOptions checkJobOptions); ServiceCall<Void> deleteJob(DeleteJobOptions deleteJobOptions); ServiceCall<LanguageModel> createLanguageModel(
      CreateLanguageModelOptions createLanguageModelOptions); ServiceCall<LanguageModels> listLanguageModels(
      ListLanguageModelsOptions listLanguageModelsOptions); ServiceCall<LanguageModels> listLanguageModels(); ServiceCall<LanguageModel> getLanguageModel(
      GetLanguageModelOptions getLanguageModelOptions); ServiceCall<Void> deleteLanguageModel(
      DeleteLanguageModelOptions deleteLanguageModelOptions); ServiceCall<TrainingResponse> trainLanguageModel(
      TrainLanguageModelOptions trainLanguageModelOptions); ServiceCall<Void> resetLanguageModel(ResetLanguageModelOptions resetLanguageModelOptions); ServiceCall<Void> upgradeLanguageModel(
      UpgradeLanguageModelOptions upgradeLanguageModelOptions); ServiceCall<Corpora> listCorpora(ListCorporaOptions listCorporaOptions); ServiceCall<Void> addCorpus(AddCorpusOptions addCorpusOptions); ServiceCall<Corpus> getCorpus(GetCorpusOptions getCorpusOptions); ServiceCall<Void> deleteCorpus(DeleteCorpusOptions deleteCorpusOptions); ServiceCall<Words> listWords(ListWordsOptions listWordsOptions); ServiceCall<Void> addWords(AddWordsOptions addWordsOptions); ServiceCall<Void> addWord(AddWordOptions addWordOptions); ServiceCall<Word> getWord(GetWordOptions getWordOptions); ServiceCall<Void> deleteWord(DeleteWordOptions deleteWordOptions); ServiceCall<Grammars> listGrammars(ListGrammarsOptions listGrammarsOptions); ServiceCall<Void> addGrammar(AddGrammarOptions addGrammarOptions); ServiceCall<Grammar> getGrammar(GetGrammarOptions getGrammarOptions); ServiceCall<Void> deleteGrammar(DeleteGrammarOptions deleteGrammarOptions); ServiceCall<AcousticModel> createAcousticModel(
      CreateAcousticModelOptions createAcousticModelOptions); ServiceCall<AcousticModels> listAcousticModels(
      ListAcousticModelsOptions listAcousticModelsOptions); ServiceCall<AcousticModels> listAcousticModels(); ServiceCall<AcousticModel> getAcousticModel(
      GetAcousticModelOptions getAcousticModelOptions); ServiceCall<Void> deleteAcousticModel(
      DeleteAcousticModelOptions deleteAcousticModelOptions); ServiceCall<TrainingResponse> trainAcousticModel(
      TrainAcousticModelOptions trainAcousticModelOptions); ServiceCall<Void> resetAcousticModel(ResetAcousticModelOptions resetAcousticModelOptions); ServiceCall<Void> upgradeAcousticModel(
      UpgradeAcousticModelOptions upgradeAcousticModelOptions); ServiceCall<AudioResources> listAudio(ListAudioOptions listAudioOptions); ServiceCall<Void> addAudio(AddAudioOptions addAudioOptions); ServiceCall<AudioListing> getAudio(GetAudioOptions getAudioOptions); ServiceCall<Void> deleteAudio(DeleteAudioOptions deleteAudioOptions); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testListAudio() throws FileNotFoundException, InterruptedException { String resourcesAsString = getStringFromInputStream( new FileInputStream("src/test/resources/speech_to_text/audio-resources.json")); JsonObject audioResources = new JsonParser().parse(resourcesAsString).getAsJsonObject(); String id = "foo"; server.enqueue( new MockResponse() .addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON) .setBody(resourcesAsString)); ListAudioOptions listOptions = new ListAudioOptions.Builder().customizationId(id).build(); AudioResources result = service.listAudio(listOptions).execute().getResult(); final RecordedRequest request = server.takeRequest(); assertEquals("GET", request.getMethod()); assertEquals(String.format(PATH_ALL_AUDIO, id), request.getPath()); assertEquals(audioResources.get("audio").getAsJsonArray().size(), result.getAudio().size()); assertEquals(audioResources.get("audio"), GSON.toJsonTree(result.getAudio())); }