Search in sources :

Example 6 with DialogNodeCollection

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

the class Assistant method listDialogNodes.

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

Aggregations

NotFoundException (com.ibm.watson.developer_cloud.service.exception.NotFoundException)4 UnauthorizedException (com.ibm.watson.developer_cloud.service.exception.UnauthorizedException)4 Test (org.junit.Test)4 DialogNodeCollection (com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeCollection)3 DialogNodeCollection (com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeCollection)3 CreateDialogNodeOptions (com.ibm.watson.developer_cloud.assistant.v1.model.CreateDialogNodeOptions)2 DeleteDialogNodeOptions (com.ibm.watson.developer_cloud.assistant.v1.model.DeleteDialogNodeOptions)2 ListDialogNodesOptions (com.ibm.watson.developer_cloud.assistant.v1.model.ListDialogNodesOptions)2 CreateDialogNodeOptions (com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions)2 DeleteDialogNodeOptions (com.ibm.watson.developer_cloud.conversation.v1.model.DeleteDialogNodeOptions)2 ListDialogNodesOptions (com.ibm.watson.developer_cloud.conversation.v1.model.ListDialogNodesOptions)2 RequestBuilder (com.ibm.watson.developer_cloud.http.RequestBuilder)2 Date (java.util.Date)2 DialogNode (com.ibm.watson.developer_cloud.assistant.v1.model.DialogNode)1 DialogNode (com.ibm.watson.developer_cloud.conversation.v1.model.DialogNode)1