use of com.ibm.watson.assistant.v1.model.DialogNode in project java-sdk by watson-developer-cloud.
the class Assistant method getDialogNode.
/**
* Get dialog node.
*
* <p>Get information about a dialog node.
*
* @param getDialogNodeOptions the {@link GetDialogNodeOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a result of type {@link DialogNode}
*/
public ServiceCall<DialogNode> getDialogNode(GetDialogNodeOptions getDialogNodeOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(getDialogNodeOptions, "getDialogNodeOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
pathParamsMap.put("workspace_id", getDialogNodeOptions.workspaceId());
pathParamsMap.put("dialog_node", getDialogNodeOptions.dialogNode());
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/workspaces/{workspace_id}/dialog_nodes/{dialog_node}", pathParamsMap));
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "getDialogNode");
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 (getDialogNodeOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getDialogNodeOptions.includeAudit()));
}
ResponseConverter<DialogNode> responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<DialogNode>() {
}.getType());
return createServiceCall(builder.build(), responseConverter);
}
Aggregations