TextToSpeech extends BaseService { public ServiceCall<Voice> getVoice(GetVoiceOptions getVoiceOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( getVoiceOptions, "getVoiceOptions cannot be null"); String[] pathSegments = {"v1/voices"}; String[] pathParameters = {getVoiceOptions.voice()}; RequestBuilder builder = RequestBuilder.get( RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters)); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("text_to_speech", "v1", "getVoice"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (getVoiceOptions.customizationId() != null) { builder.query("customization_id", getVoiceOptions.customizationId()); } ResponseConverter<Voice> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<Voice>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } TextToSpeech();  TextToSpeech(Authenticator authenticator);  TextToSpeech(String serviceName);  TextToSpeech(String serviceName, Authenticator authenticator); ServiceCall<Voices> listVoices(ListVoicesOptions listVoicesOptions); ServiceCall<Voices> listVoices(); ServiceCall<Voice> getVoice(GetVoiceOptions getVoiceOptions); ServiceCall<InputStream> synthesize(SynthesizeOptions synthesizeOptions); WebSocket synthesizeUsingWebSocket(
      SynthesizeOptions synthesizeOptions, SynthesizeCallback callback); ServiceCall<Pronunciation> getPronunciation(
      GetPronunciationOptions getPronunciationOptions); ServiceCall<VoiceModel> createVoiceModel(CreateVoiceModelOptions createVoiceModelOptions); ServiceCall<VoiceModels> listVoiceModels(ListVoiceModelsOptions listVoiceModelsOptions); ServiceCall<VoiceModels> listVoiceModels(); ServiceCall<Void> updateVoiceModel(UpdateVoiceModelOptions updateVoiceModelOptions); ServiceCall<VoiceModel> getVoiceModel(GetVoiceModelOptions getVoiceModelOptions); ServiceCall<Void> deleteVoiceModel(DeleteVoiceModelOptions deleteVoiceModelOptions); ServiceCall<Void> addWords(AddWordsOptions addWordsOptions); ServiceCall<Words> listWords(ListWordsOptions listWordsOptions); ServiceCall<Void> addWord(AddWordOptions addWordOptions); ServiceCall<Translation> getWord(GetWordOptions getWordOptions); ServiceCall<Void> deleteWord(DeleteWordOptions deleteWordOptions); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testGetVoice() { server.enqueue( new MockResponse() .addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON) .setBody(GSON.toJson(getVoiceResponse))); GetVoiceOptions getOptions = new GetVoiceOptions.Builder().voice("en-US_TestMaleVoice").build(); Voice result = service.getVoice(getOptions).execute().getResult(); assertNotNull(result); assertEquals(result, getVoiceResponse); try { TestUtils.assertNoExceptionsOnGetters(result); } catch (final Exception e) { Assert.fail(e.getMessage()); } }