Search in sources :

Example 6 with ListEnvironmentsOptions

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

the class Discovery method listEnvironments.

/**
 * List environments.
 *
 * List existing environments for the service instance.
 *
 * @param listEnvironmentsOptions the {@link ListEnvironmentsOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link ListEnvironmentsResponse}
 */
public ServiceCall<ListEnvironmentsResponse> listEnvironments(ListEnvironmentsOptions listEnvironmentsOptions) {
    String[] pathSegments = { "v1/environments" };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
    builder.query(VERSION, versionDate);
    if (listEnvironmentsOptions != null) {
        if (listEnvironmentsOptions.name() != null) {
            builder.query("name", listEnvironmentsOptions.name());
        }
    }
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ListEnvironmentsResponse.class));
}
Also used : ListEnvironmentsResponse(com.ibm.watson.developer_cloud.discovery.v1.model.ListEnvironmentsResponse) RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder)

Aggregations

ListEnvironmentsResponse (com.ibm.watson.developer_cloud.discovery.v1.model.ListEnvironmentsResponse)5 ListEnvironmentsOptions (com.ibm.watson.developer_cloud.discovery.v1.model.ListEnvironmentsOptions)4 WatsonServiceTest (com.ibm.watson.developer_cloud.WatsonServiceTest)3 Environment (com.ibm.watson.developer_cloud.discovery.v1.model.Environment)3 Test (org.junit.Test)3 CreateEnvironmentOptions (com.ibm.watson.developer_cloud.discovery.v1.model.CreateEnvironmentOptions)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 AddDocumentOptions (com.ibm.watson.developer_cloud.discovery.v1.model.AddDocumentOptions)1 Collection (com.ibm.watson.developer_cloud.discovery.v1.model.Collection)1 Configuration (com.ibm.watson.developer_cloud.discovery.v1.model.Configuration)1 CreateCollectionOptions (com.ibm.watson.developer_cloud.discovery.v1.model.CreateCollectionOptions)1 DeleteCollectionOptions (com.ibm.watson.developer_cloud.discovery.v1.model.DeleteCollectionOptions)1 DocumentAccepted (com.ibm.watson.developer_cloud.discovery.v1.model.DocumentAccepted)1 DocumentStatus (com.ibm.watson.developer_cloud.discovery.v1.model.DocumentStatus)1 GetCollectionOptions (com.ibm.watson.developer_cloud.discovery.v1.model.GetCollectionOptions)1 GetDocumentStatusOptions (com.ibm.watson.developer_cloud.discovery.v1.model.GetDocumentStatusOptions)1 GetEnvironmentOptions (com.ibm.watson.developer_cloud.discovery.v1.model.GetEnvironmentOptions)1 ListConfigurationsOptions (com.ibm.watson.developer_cloud.discovery.v1.model.ListConfigurationsOptions)1 ListConfigurationsResponse (com.ibm.watson.developer_cloud.discovery.v1.model.ListConfigurationsResponse)1