Search in sources :

Example 6 with ValueCollection

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

the class Assistant method listValues.

/**
 * List entity values.
 *
 * List the values for an entity. This operation is limited to 2500 requests per 30 minutes. For more information, see
 * **Rate limiting**.
 *
 * @param listValuesOptions the {@link ListValuesOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link ValueCollection}
 */
public ServiceCall<ValueCollection> listValues(ListValuesOptions listValuesOptions) {
    Validator.notNull(listValuesOptions, "listValuesOptions cannot be null");
    String[] pathSegments = { "v1/workspaces", "entities", "values" };
    String[] pathParameters = { listValuesOptions.workspaceId(), listValuesOptions.entity() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
    builder.query(VERSION, versionDate);
    if (listValuesOptions.export() != null) {
        builder.query("export", String.valueOf(listValuesOptions.export()));
    }
    if (listValuesOptions.pageLimit() != null) {
        builder.query("page_limit", String.valueOf(listValuesOptions.pageLimit()));
    }
    if (listValuesOptions.includeCount() != null) {
        builder.query("include_count", String.valueOf(listValuesOptions.includeCount()));
    }
    if (listValuesOptions.sort() != null) {
        builder.query("sort", listValuesOptions.sort());
    }
    if (listValuesOptions.cursor() != null) {
        builder.query("cursor", listValuesOptions.cursor());
    }
    if (listValuesOptions.includeAudit() != null) {
        builder.query("include_audit", String.valueOf(listValuesOptions.includeAudit()));
    }
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueCollection.class));
}
Also used : RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder) ValueCollection(com.ibm.watson.developer_cloud.assistant.v1.model.ValueCollection)

Aggregations

NotFoundException (com.ibm.watson.developer_cloud.service.exception.NotFoundException)4 Test (org.junit.Test)4 ValueCollection (com.ibm.watson.developer_cloud.assistant.v1.model.ValueCollection)3 ValueCollection (com.ibm.watson.developer_cloud.conversation.v1.model.ValueCollection)3 CreateEntityOptions (com.ibm.watson.developer_cloud.assistant.v1.model.CreateEntityOptions)2 CreateValueOptions (com.ibm.watson.developer_cloud.assistant.v1.model.CreateValueOptions)2 DeleteValueOptions (com.ibm.watson.developer_cloud.assistant.v1.model.DeleteValueOptions)2 ListValuesOptions (com.ibm.watson.developer_cloud.assistant.v1.model.ListValuesOptions)2 CreateEntityOptions (com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntityOptions)2 CreateValueOptions (com.ibm.watson.developer_cloud.conversation.v1.model.CreateValueOptions)2 DeleteValueOptions (com.ibm.watson.developer_cloud.conversation.v1.model.DeleteValueOptions)2 ListValuesOptions (com.ibm.watson.developer_cloud.conversation.v1.model.ListValuesOptions)2 RequestBuilder (com.ibm.watson.developer_cloud.http.RequestBuilder)2 ValueExport (com.ibm.watson.developer_cloud.assistant.v1.model.ValueExport)1 ValueExport (com.ibm.watson.developer_cloud.conversation.v1.model.ValueExport)1