Search in sources :

Example 1 with ListModelsResults

use of com.ibm.watson.developer_cloud.natural_language_understanding.v1.model.ListModelsResults in project java-sdk by watson-developer-cloud.

the class NaturalLanguageUnderstandingTest method testListModels.

/**
 * Test get models.
 *
 * @throws InterruptedException the interrupted exception
 */
@Test
public void testListModels() throws InterruptedException {
    server.enqueue(jsonResponse(models));
    final ListModelsResults response = service.listModels().execute();
    final RecordedRequest request = server.takeRequest();
    assertEquals(MODELS_PATH, request.getPath());
    assertEquals("GET", request.getMethod());
    assertEquals(models, response);
}
Also used : RecordedRequest(okhttp3.mockwebserver.RecordedRequest) ListModelsResults(com.ibm.watson.developer_cloud.natural_language_understanding.v1.model.ListModelsResults) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Example 2 with ListModelsResults

use of com.ibm.watson.developer_cloud.natural_language_understanding.v1.model.ListModelsResults in project java-sdk by watson-developer-cloud.

the class NaturalLanguageUnderstanding method listModels.

/**
 * List models.
 *
 * Lists available models for Relations and Entities features, including Watson Knowledge Studio custom models that
 * you have created and linked to your Natural Language Understanding service.
 *
 * @param listModelsOptions the {@link ListModelsOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link ListModelsResults}
 */
public ServiceCall<ListModelsResults> listModels(ListModelsOptions listModelsOptions) {
    String[] pathSegments = { "v1/models" };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
    builder.query(VERSION, versionDate);
    if (listModelsOptions != null) {
    }
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ListModelsResults.class));
}
Also used : RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder) ListModelsResults(com.ibm.watson.developer_cloud.natural_language_understanding.v1.model.ListModelsResults)

Aggregations

ListModelsResults (com.ibm.watson.developer_cloud.natural_language_understanding.v1.model.ListModelsResults)2 WatsonServiceUnitTest (com.ibm.watson.developer_cloud.WatsonServiceUnitTest)1 RequestBuilder (com.ibm.watson.developer_cloud.http.RequestBuilder)1 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)1 Test (org.junit.Test)1