use of com.ibm.watson.assistant.v1.model.ListDialogNodesOptions in project java-sdk by watson-developer-cloud.
the class Assistant method listDialogNodes.
/**
* List dialog nodes.
*
* <p>List the dialog nodes for a workspace.
*
* @param listDialogNodesOptions the {@link ListDialogNodesOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a result of type {@link DialogNodeCollection}
*/
public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions listDialogNodesOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(listDialogNodesOptions, "listDialogNodesOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
pathParamsMap.put("workspace_id", listDialogNodesOptions.workspaceId());
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/workspaces/{workspace_id}/dialog_nodes", pathParamsMap));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "listDialogNodes");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.query("version", String.valueOf(this.version));
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", String.valueOf(listDialogNodesOptions.sort()));
}
if (listDialogNodesOptions.cursor() != null) {
builder.query("cursor", String.valueOf(listDialogNodesOptions.cursor()));
}
if (listDialogNodesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listDialogNodesOptions.includeAudit()));
}
ResponseConverter<DialogNodeCollection> responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<DialogNodeCollection>() {
}.getType());
return createServiceCall(builder.build(), responseConverter);
}
Aggregations