use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetVoiceModelOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsIT method assertModelsEqual.
private void assertModelsEqual(VoiceModel a, VoiceModel b) {
assertEquals(a.getCustomizationId(), b.getCustomizationId());
GetVoiceModelOptions getOptionsA = new GetVoiceModelOptions.Builder().customizationId(a.getCustomizationId()).build();
assertEquals((service.getVoiceModel(getOptionsA).execute()).getName(), b.getName());
assertEquals((service.getVoiceModel(getOptionsA).execute()).getLanguage(), b.getLanguage());
}
use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetVoiceModelOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsIT method testGetVoiceModelObject.
/**
* Test get voice model.
*/
@Test
public void testGetVoiceModelObject() {
model = createVoiceModel();
GetVoiceModelOptions getOptions = new GetVoiceModelOptions.Builder().customizationId(model.getCustomizationId()).build();
final VoiceModel model2 = service.getVoiceModel(getOptions).execute();
assertNotNull(model2);
assertModelsEqual(model, model2);
assertNotNull(model2.getOwner());
assertNotNull(model2.getCreated());
assertNotNull(model2.getLastModified());
}
use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetVoiceModelOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsTest method testGetVoiceModel.
/**
* Test get voice model.
*
* @throws InterruptedException the interrupted exception
*/
@Test
public void testGetVoiceModel() throws InterruptedException {
// Test with customization ID
server.enqueue(jsonResponse(voiceModelWords));
GetVoiceModelOptions getOptions = new GetVoiceModelOptions.Builder().customizationId(CUSTOMIZATION_ID).build();
VoiceModel result = service.getVoiceModel(getOptions).execute();
RecordedRequest request = server.takeRequest();
assertEquals(String.format(VOICE_MODEL_PATH, CUSTOMIZATION_ID), request.getPath());
assertEquals("GET", request.getMethod());
assertEquals(voiceModelWords, result);
assertNotNull(voiceModelWords.getWords());
assertEquals(voiceModelWords.getWords(), result.getWords());
}
use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetVoiceModelOptions in project java-sdk by watson-developer-cloud.
the class TextToSpeech method getVoiceModel.
/**
* Queries the contents of a custom voice model.
*
* Lists all information about the custom voice model with the specified `customization_id`. In addition to metadata
* such as the name and description of the voice model, the output includes the words in the model and their
* translations as defined in the model. To see just the metadata for a voice model, use the `GET /v1/customizations`
* method. You must use credentials for the instance of the service that owns a model to list information about it.
* **Note:** This method is currently a beta release.
*
* @param getVoiceModelOptions the {@link GetVoiceModelOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link VoiceModel}
*/
public ServiceCall<VoiceModel> getVoiceModel(GetVoiceModelOptions getVoiceModelOptions) {
Validator.notNull(getVoiceModelOptions, "getVoiceModelOptions cannot be null");
String[] pathSegments = { "v1/customizations" };
String[] pathParameters = { getVoiceModelOptions.customizationId() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(VoiceModel.class));
}
use of com.ibm.watson.developer_cloud.text_to_speech.v1.model.GetVoiceModelOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsIT method testGetVoiceModelString.
/**
* Test get voice model.
*/
@Test
public void testGetVoiceModelString() {
model = createVoiceModel();
GetVoiceModelOptions getOptions = new GetVoiceModelOptions.Builder().customizationId(model.getCustomizationId()).build();
final VoiceModel model2 = service.getVoiceModel(getOptions).execute();
assertNotNull(model2);
assertModelsEqual(model, model2);
assertNotNull(model2.getOwner());
assertNotNull(model2.getCreated());
assertNotNull(model2.getLastModified());
}
Aggregations