|
80 | 80 | import com.ibm.watson.assistant.v1.model.Synonym; |
81 | 81 | import com.ibm.watson.assistant.v1.model.SynonymCollection; |
82 | 82 | import com.ibm.watson.assistant.v1.model.UpdateCounterexampleOptions; |
| 83 | +import com.ibm.watson.assistant.v1.model.UpdateDialogNodeNullableOptions; |
83 | 84 | import com.ibm.watson.assistant.v1.model.UpdateDialogNodeOptions; |
84 | 85 | import com.ibm.watson.assistant.v1.model.UpdateEntityOptions; |
85 | 86 | import com.ibm.watson.assistant.v1.model.UpdateExampleOptions; |
|
109 | 110 | */ |
110 | 111 | public class Assistant extends BaseService { |
111 | 112 |
|
112 | | - public static final String DEFAULT_SERVICE_NAME = "conversation"; |
| 113 | + public static final String DEFAULT_SERVICE_NAME = "assistant"; |
113 | 114 |
|
114 | 115 | public static final String DEFAULT_SERVICE_URL = |
115 | 116 | "https://api.us-south.assistant.watson.cloud.ibm.com"; |
@@ -2292,6 +2293,52 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi |
2292 | 2293 | return createServiceCall(builder.build(), responseConverter); |
2293 | 2294 | } |
2294 | 2295 |
|
| 2296 | + /** |
| 2297 | + * Update dialog node. |
| 2298 | + * |
| 2299 | + * <p>Update an existing dialog node with new or modified data. |
| 2300 | + * |
| 2301 | + * <p>If you want to update multiple dialog nodes with a single API call, consider using the |
| 2302 | + * **[Update workspace](#update-workspace)** method instead. |
| 2303 | + * |
| 2304 | + * @param UpdateDialogNodeNullableOptions the {@link UpdateDialogNodeNullableOptions} containing |
| 2305 | + * the options for the call |
| 2306 | + * @return a {@link ServiceCall} with a result of type {@link DialogNode} |
| 2307 | + */ |
| 2308 | + public ServiceCall<DialogNode> updateDialogNodeNullable( |
| 2309 | + UpdateDialogNodeNullableOptions UpdateDialogNodeNullableOptions) { |
| 2310 | + com.ibm.cloud.sdk.core.util.Validator.notNull( |
| 2311 | + UpdateDialogNodeNullableOptions, "UpdateDialogNodeNullableOptions cannot be null"); |
| 2312 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 2313 | + pathParamsMap.put("workspace_id", UpdateDialogNodeNullableOptions.workspaceId()); |
| 2314 | + pathParamsMap.put("dialog_node", UpdateDialogNodeNullableOptions.dialogNode()); |
| 2315 | + RequestBuilder builder = |
| 2316 | + RequestBuilder.post( |
| 2317 | + RequestBuilder.resolveRequestUrl( |
| 2318 | + getServiceUrl(), |
| 2319 | + "/v1/workspaces/{workspace_id}/dialog_nodes/{dialog_node}", |
| 2320 | + pathParamsMap)); |
| 2321 | + Map<String, String> sdkHeaders = |
| 2322 | + SdkCommon.getSdkHeaders("conversation", "v1", "testUpdateDialogNode"); |
| 2323 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 2324 | + builder.header(header.getKey(), header.getValue()); |
| 2325 | + } |
| 2326 | + builder.header("Accept", "application/json"); |
| 2327 | + builder.query("version", String.valueOf(this.version)); |
| 2328 | + if (UpdateDialogNodeNullableOptions.includeAudit() != null) { |
| 2329 | + builder.query( |
| 2330 | + "include_audit", String.valueOf(UpdateDialogNodeNullableOptions.includeAudit())); |
| 2331 | + } |
| 2332 | + builder.bodyContent( |
| 2333 | + com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls() |
| 2334 | + .toJson(UpdateDialogNodeNullableOptions.body()), |
| 2335 | + "application/json"); |
| 2336 | + ResponseConverter<DialogNode> responseConverter = |
| 2337 | + ResponseConverterUtils.getValue( |
| 2338 | + new com.google.gson.reflect.TypeToken<DialogNode>() {}.getType()); |
| 2339 | + return createServiceCall(builder.build(), responseConverter); |
| 2340 | + } |
| 2341 | + |
2295 | 2342 | /** |
2296 | 2343 | * Delete dialog node. |
2297 | 2344 | * |
|
0 commit comments