Skip to content

Commit

Permalink
feat(assistant-v1): add updateDialogNodeNullable as a new function
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkowa committed Apr 21, 2021
1 parent bd6ae8b commit 90e3ea5
Show file tree
Hide file tree
Showing 3 changed files with 952 additions and 0 deletions.
46 changes: 46 additions & 0 deletions assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import com.ibm.watson.assistant.v1.model.Synonym;
import com.ibm.watson.assistant.v1.model.SynonymCollection;
import com.ibm.watson.assistant.v1.model.UpdateCounterexampleOptions;
import com.ibm.watson.assistant.v1.model.UpdateDialogNodeNullableOptions;
import com.ibm.watson.assistant.v1.model.UpdateDialogNodeOptions;
import com.ibm.watson.assistant.v1.model.UpdateEntityOptions;
import com.ibm.watson.assistant.v1.model.UpdateExampleOptions;
Expand Down Expand Up @@ -2289,6 +2290,51 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi
return createServiceCall(builder.build(), responseConverter);
}

/**
* Update dialog node.
*
* <p>Update an existing dialog node with new or modified data.
*
* <p>If you want to update multiple dialog nodes with a single API call, consider using the
* **[Update workspace](#update-workspace)** method instead.
*
* @param UpdateDialogNodeNullableOptions the {@link UpdateDialogNodeNullableOptions} containing the
* options for the call
* @return a {@link ServiceCall} with a result of type {@link DialogNode}
*/
public ServiceCall<DialogNode> updateDialogNodeNullable(
UpdateDialogNodeNullableOptions UpdateDialogNodeNullableOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(
UpdateDialogNodeNullableOptions, "UpdateDialogNodeNullableOptions cannot be null");
Map<String, String> pathParamsMap = new HashMap<String, String>();
pathParamsMap.put("workspace_id", UpdateDialogNodeNullableOptions.workspaceId());
pathParamsMap.put("dialog_node", UpdateDialogNodeNullableOptions.dialogNode());
RequestBuilder builder =
RequestBuilder.post(
RequestBuilder.resolveRequestUrl(
getServiceUrl(),
"/v1/workspaces/{workspace_id}/dialog_nodes/{dialog_node}",
pathParamsMap));
Map<String, String> sdkHeaders =
SdkCommon.getSdkHeaders("conversation", "v1", "testUpdateDialogNode");
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 (UpdateDialogNodeNullableOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(UpdateDialogNodeNullableOptions.includeAudit()));
}
builder.bodyContent(
com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls()
.toJson(UpdateDialogNodeNullableOptions.body()),
"application/json");
ResponseConverter<DialogNode> responseConverter =
ResponseConverterUtils.getValue(
new com.google.gson.reflect.TypeToken<DialogNode>() {}.getType());
return createServiceCall(builder.build(), responseConverter);
}

/**
* Delete dialog node.
*
Expand Down
Loading

0 comments on commit 90e3ea5

Please sign in to comment.