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));
}
Aggregations