ibm_watson 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ibm_watson/assistant_v1.rb +791 -736
  3. data/lib/ibm_watson/assistant_v2.rb +12 -8
  4. data/lib/ibm_watson/common.rb +2 -1
  5. data/lib/ibm_watson/compare_comply_v1.rb +171 -169
  6. data/lib/ibm_watson/discovery_v1.rb +778 -689
  7. data/lib/ibm_watson/language_translator_v3.rb +65 -63
  8. data/lib/ibm_watson/natural_language_classifier_v1.rb +36 -35
  9. data/lib/ibm_watson/natural_language_understanding_v1.rb +28 -25
  10. data/lib/ibm_watson/personality_insights_v3.rb +10 -10
  11. data/lib/ibm_watson/speech_to_text_v1.rb +764 -702
  12. data/lib/ibm_watson/text_to_speech_v1.rb +215 -200
  13. data/lib/ibm_watson/tone_analyzer_v3.rb +10 -9
  14. data/lib/ibm_watson/version.rb +1 -1
  15. data/lib/ibm_watson/visual_recognition_v3.rb +94 -95
  16. data/lib/ibm_watson/websocket/speech_to_text_websocket_listener.rb +1 -1
  17. data/test/integration/test_assistant_v1.rb +18 -289
  18. data/test/integration/test_assistant_v2.rb +21 -31
  19. data/test/integration/test_discovery_v1.rb +21 -18
  20. data/test/integration/test_language_translator_v3.rb +3 -3
  21. data/test/integration/test_natural_language_classifier_v1.rb +3 -3
  22. data/test/integration/test_natural_language_understanding_v1.rb +16 -20
  23. data/test/integration/test_personality_insights_v3.rb +12 -40
  24. data/test/integration/test_speech_to_text_v1.rb +3 -3
  25. data/test/integration/test_text_to_speech_v1.rb +3 -3
  26. data/test/integration/test_tone_analyzer_v3.rb +14 -31
  27. data/test/integration/test_visual_recognition_v3.rb +3 -3
  28. data/test/unit/test_compare_comply_v1.rb +3 -7
  29. data/test/unit/test_discovery_v1.rb +21 -7
  30. data/test/unit/test_language_translator_v3.rb +1 -3
  31. data/test/unit/test_natural_language_classifier_v1.rb +1 -3
  32. data/test/unit/test_speech_to_text_v1.rb +25 -7
  33. data/test/unit/test_text_to_speech_v1.rb +0 -4
  34. data/test/unit/test_visual_recognition_v3.rb +2 -6
  35. metadata +2 -2
@@ -21,7 +21,6 @@
21
21
  require "concurrent"
22
22
  require "erb"
23
23
  require "json"
24
-
25
24
  require "ibm_cloud_sdk_core"
26
25
  require_relative "./common.rb"
27
26
 
@@ -90,34 +89,35 @@ module IBMWatson
90
89
  #########################
91
90
 
92
91
  ##
93
- # @!method message(workspace_id:, input: nil, alternate_intents: nil, context: nil, entities: nil, intents: nil, output: nil, nodes_visited_details: nil)
92
+ # @!method message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, nodes_visited_details: nil)
94
93
  # Get response to user input.
95
94
  # Send user input to a workspace and receive a response.
96
95
  #
97
96
  # There is no rate limit for this operation.
98
97
  # @param workspace_id [String] Unique identifier of the workspace.
99
- # @param input [InputData] An input object that includes the input text.
100
- # @param alternate_intents [Boolean] Whether to return more than one intent. Set to `true` to return all matching
101
- # intents.
102
- # @param context [Context] State information for the conversation. To maintain state, include the context
103
- # from the previous response.
104
- # @param entities [Array[RuntimeEntity]] Entities to use when evaluating the message. Include entities from the previous
105
- # response to continue using those entities rather than detecting entities in the
106
- # new input.
98
+ # @param input [MessageInput] An input object that includes the input text.
107
99
  # @param intents [Array[RuntimeIntent]] Intents to use when evaluating the user input. Include intents from the previous
108
100
  # response to continue using those intents rather than trying to recognize intents
109
101
  # in the new input.
102
+ # @param entities [Array[RuntimeEntity]] Entities to use when evaluating the message. Include entities from the previous
103
+ # response to continue using those entities rather than detecting entities in the
104
+ # new input.
105
+ # @param alternate_intents [Boolean] Whether to return more than one intent. A value of `true` indicates that all
106
+ # matching intents are returned.
107
+ # @param context [Context] State information for the conversation. To maintain state, include the context
108
+ # from the previous response.
110
109
  # @param output [OutputData] An output object that includes the response to the user, the dialog nodes that
111
110
  # were triggered, and messages from the log.
112
111
  # @param nodes_visited_details [Boolean] Whether to include additional diagnostic information about the dialog nodes that
113
112
  # were visited during processing of the message.
114
113
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
115
- def message(workspace_id:, input: nil, alternate_intents: nil, context: nil, entities: nil, intents: nil, output: nil, nodes_visited_details: nil)
114
+ def message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, nodes_visited_details: nil)
116
115
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
117
116
 
118
117
  headers = {
119
118
  }
120
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "message")
119
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "message")
120
+ headers.merge!(sdk_headers)
121
121
 
122
122
  params = {
123
123
  "version" => @version,
@@ -126,10 +126,10 @@ module IBMWatson
126
126
 
127
127
  data = {
128
128
  "input" => input,
129
+ "intents" => intents,
130
+ "entities" => entities,
129
131
  "alternate_intents" => alternate_intents,
130
132
  "context" => context,
131
- "entities" => entities,
132
- "intents" => intents,
133
133
  "output" => output
134
134
  }
135
135
 
@@ -150,48 +150,7 @@ module IBMWatson
150
150
  #########################
151
151
 
152
152
  ##
153
- # @!method list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
154
- # List workspaces.
155
- # List the workspaces associated with a Watson Assistant service instance.
156
- #
157
- # This operation is limited to 500 requests per 30 minutes. For more information,
158
- # see **Rate limiting**.
159
- # @param page_limit [Fixnum] The number of records to return in each page of results.
160
- # @param include_count [Boolean] Whether to include information about the number of records returned.
161
- # @param sort [String] The attribute by which returned workspaces will be sorted. To reverse the sort
162
- # order, prefix the value with a minus sign (`-`).
163
- # @param cursor [String] A token identifying the page of results to retrieve.
164
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
165
- # the response.
166
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
167
- def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
168
- headers = {
169
- }
170
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_workspaces")
171
-
172
- params = {
173
- "version" => @version,
174
- "page_limit" => page_limit,
175
- "include_count" => include_count,
176
- "sort" => sort,
177
- "cursor" => cursor,
178
- "include_audit" => include_audit
179
- }
180
-
181
- method_url = "/v1/workspaces"
182
-
183
- response = request(
184
- method: "GET",
185
- url: method_url,
186
- headers: headers,
187
- params: params,
188
- accept_json: true
189
- )
190
- response
191
- end
192
-
193
- ##
194
- # @!method create_workspace(name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil)
153
+ # @!method create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil)
195
154
  # Create workspace.
196
155
  # Create a workspace based on component objects. You must provide workspace
197
156
  # components defining the content of the new workspace.
@@ -203,20 +162,22 @@ module IBMWatson
203
162
  # @param description [String] The description of the workspace. This string cannot contain carriage return,
204
163
  # newline, or tab characters, and it must be no longer than 128 characters.
205
164
  # @param language [String] The language of the workspace.
165
+ # @param metadata [Hash] Any metadata related to the workspace.
166
+ # @param learning_opt_out [Boolean] Whether training data from the workspace (including artifacts such as intents and
167
+ # entities) can be used by IBM for general service improvements. `true` indicates
168
+ # that workspace training data is not to be used.
169
+ # @param system_settings [WorkspaceSystemSettings] Global settings for the workspace.
206
170
  # @param intents [Array[CreateIntent]] An array of objects defining the intents for the workspace.
207
- # @param entities [Array[CreateEntity]] An array of objects defining the entities for the workspace.
208
- # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the dialog.
209
- # @param counterexamples [Array[CreateCounterexample]] An array of objects defining input examples that have been marked as irrelevant
171
+ # @param entities [Array[CreateEntity]] An array of objects describing the entities for the workspace.
172
+ # @param dialog_nodes [Array[DialogNode]] An array of objects describing the dialog nodes in the workspace.
173
+ # @param counterexamples [Array[Counterexample]] An array of objects defining input examples that have been marked as irrelevant
210
174
  # input.
211
- # @param metadata [Object] Any metadata related to the workspace.
212
- # @param learning_opt_out [Boolean] Whether training data from the workspace can be used by IBM for general service
213
- # improvements. `true` indicates that workspace training data is not to be used.
214
- # @param system_settings [WorkspaceSystemSettings] Global settings for the workspace.
215
175
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
216
- def create_workspace(name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil)
176
+ def create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil)
217
177
  headers = {
218
178
  }
219
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_workspace")
179
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_workspace")
180
+ headers.merge!(sdk_headers)
220
181
 
221
182
  params = {
222
183
  "version" => @version
@@ -226,13 +187,13 @@ module IBMWatson
226
187
  "name" => name,
227
188
  "description" => description,
228
189
  "language" => language,
190
+ "metadata" => metadata,
191
+ "learning_opt_out" => learning_opt_out,
192
+ "system_settings" => system_settings,
229
193
  "intents" => intents,
230
194
  "entities" => entities,
231
195
  "dialog_nodes" => dialog_nodes,
232
- "counterexamples" => counterexamples,
233
- "metadata" => metadata,
234
- "learning_opt_out" => learning_opt_out,
235
- "system_settings" => system_settings
196
+ "counterexamples" => counterexamples
236
197
  }
237
198
 
238
199
  method_url = "/v1/workspaces"
@@ -248,6 +209,39 @@ module IBMWatson
248
209
  response
249
210
  end
250
211
 
212
+ ##
213
+ # @!method delete_workspace(workspace_id:)
214
+ # Delete workspace.
215
+ # Delete a workspace from the service instance.
216
+ #
217
+ # This operation is limited to 30 requests per 30 minutes. For more information, see
218
+ # **Rate limiting**.
219
+ # @param workspace_id [String] Unique identifier of the workspace.
220
+ # @return [nil]
221
+ def delete_workspace(workspace_id:)
222
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
223
+
224
+ headers = {
225
+ }
226
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_workspace")
227
+ headers.merge!(sdk_headers)
228
+
229
+ params = {
230
+ "version" => @version
231
+ }
232
+
233
+ method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
234
+
235
+ request(
236
+ method: "DELETE",
237
+ url: method_url,
238
+ headers: headers,
239
+ params: params,
240
+ accept_json: true
241
+ )
242
+ nil
243
+ end
244
+
251
245
  ##
252
246
  # @!method get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
253
247
  # Get information about a workspace.
@@ -271,7 +265,8 @@ module IBMWatson
271
265
 
272
266
  headers = {
273
267
  }
274
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_workspace")
268
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_workspace")
269
+ headers.merge!(sdk_headers)
275
270
 
276
271
  params = {
277
272
  "version" => @version,
@@ -293,7 +288,49 @@ module IBMWatson
293
288
  end
294
289
 
295
290
  ##
296
- # @!method update_workspace(workspace_id:, name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, append: nil)
291
+ # @!method list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
292
+ # List workspaces.
293
+ # List the workspaces associated with a Watson Assistant service instance.
294
+ #
295
+ # This operation is limited to 500 requests per 30 minutes. For more information,
296
+ # see **Rate limiting**.
297
+ # @param page_limit [Fixnum] The number of records to return in each page of results.
298
+ # @param include_count [Boolean] Whether to include information about the number of records returned.
299
+ # @param sort [String] The attribute by which returned workspaces will be sorted. To reverse the sort
300
+ # order, prefix the value with a minus sign (`-`).
301
+ # @param cursor [String] A token identifying the page of results to retrieve.
302
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
303
+ # the response.
304
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
305
+ def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
306
+ headers = {
307
+ }
308
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_workspaces")
309
+ headers.merge!(sdk_headers)
310
+
311
+ params = {
312
+ "version" => @version,
313
+ "page_limit" => page_limit,
314
+ "include_count" => include_count,
315
+ "sort" => sort,
316
+ "cursor" => cursor,
317
+ "include_audit" => include_audit
318
+ }
319
+
320
+ method_url = "/v1/workspaces"
321
+
322
+ response = request(
323
+ method: "GET",
324
+ url: method_url,
325
+ headers: headers,
326
+ params: params,
327
+ accept_json: true
328
+ )
329
+ response
330
+ end
331
+
332
+ ##
333
+ # @!method update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, append: nil)
297
334
  # Update workspace.
298
335
  # Update an existing workspace with new or modified data. You must provide component
299
336
  # objects defining the content of the updated workspace.
@@ -306,15 +343,16 @@ module IBMWatson
306
343
  # @param description [String] The description of the workspace. This string cannot contain carriage return,
307
344
  # newline, or tab characters, and it must be no longer than 128 characters.
308
345
  # @param language [String] The language of the workspace.
346
+ # @param metadata [Hash] Any metadata related to the workspace.
347
+ # @param learning_opt_out [Boolean] Whether training data from the workspace (including artifacts such as intents and
348
+ # entities) can be used by IBM for general service improvements. `true` indicates
349
+ # that workspace training data is not to be used.
350
+ # @param system_settings [WorkspaceSystemSettings] Global settings for the workspace.
309
351
  # @param intents [Array[CreateIntent]] An array of objects defining the intents for the workspace.
310
- # @param entities [Array[CreateEntity]] An array of objects defining the entities for the workspace.
311
- # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the dialog.
312
- # @param counterexamples [Array[CreateCounterexample]] An array of objects defining input examples that have been marked as irrelevant
352
+ # @param entities [Array[CreateEntity]] An array of objects describing the entities for the workspace.
353
+ # @param dialog_nodes [Array[DialogNode]] An array of objects describing the dialog nodes in the workspace.
354
+ # @param counterexamples [Array[Counterexample]] An array of objects defining input examples that have been marked as irrelevant
313
355
  # input.
314
- # @param metadata [Object] Any metadata related to the workspace.
315
- # @param learning_opt_out [Boolean] Whether training data from the workspace can be used by IBM for general service
316
- # improvements. `true` indicates that workspace training data is not to be used.
317
- # @param system_settings [WorkspaceSystemSettings] Global settings for the workspace.
318
356
  # @param append [Boolean] Whether the new data is to be appended to the existing data in the workspace. If
319
357
  # **append**=`false`, elements included in the new data completely replace the
320
358
  # corresponding existing elements, including all subelements. For example, if the
@@ -325,12 +363,13 @@ module IBMWatson
325
363
  # added. If any elements in the new data collide with existing elements, the update
326
364
  # request fails.
327
365
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
328
- def update_workspace(workspace_id:, name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, append: nil)
366
+ def update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, append: nil)
329
367
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
330
368
 
331
369
  headers = {
332
370
  }
333
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_workspace")
371
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_workspace")
372
+ headers.merge!(sdk_headers)
334
373
 
335
374
  params = {
336
375
  "version" => @version,
@@ -341,13 +380,13 @@ module IBMWatson
341
380
  "name" => name,
342
381
  "description" => description,
343
382
  "language" => language,
383
+ "metadata" => metadata,
384
+ "learning_opt_out" => learning_opt_out,
385
+ "system_settings" => system_settings,
344
386
  "intents" => intents,
345
387
  "entities" => entities,
346
388
  "dialog_nodes" => dialog_nodes,
347
- "counterexamples" => counterexamples,
348
- "metadata" => metadata,
349
- "learning_opt_out" => learning_opt_out,
350
- "system_settings" => system_settings
389
+ "counterexamples" => counterexamples
351
390
  }
352
391
 
353
392
  method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
@@ -362,91 +401,10 @@ module IBMWatson
362
401
  )
363
402
  response
364
403
  end
365
-
366
- ##
367
- # @!method delete_workspace(workspace_id:)
368
- # Delete workspace.
369
- # Delete a workspace from the service instance.
370
- #
371
- # This operation is limited to 30 requests per 30 minutes. For more information, see
372
- # **Rate limiting**.
373
- # @param workspace_id [String] Unique identifier of the workspace.
374
- # @return [nil]
375
- def delete_workspace(workspace_id:)
376
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
377
-
378
- headers = {
379
- }
380
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_workspace")
381
-
382
- params = {
383
- "version" => @version
384
- }
385
-
386
- method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
387
-
388
- request(
389
- method: "DELETE",
390
- url: method_url,
391
- headers: headers,
392
- params: params,
393
- accept_json: true
394
- )
395
- nil
396
- end
397
404
  #########################
398
405
  # Intents
399
406
  #########################
400
407
 
401
- ##
402
- # @!method list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
403
- # List intents.
404
- # List the intents for a workspace.
405
- #
406
- # With **export**=`false`, this operation is limited to 2000 requests per 30
407
- # minutes. With **export**=`true`, the limit is 400 requests per 30 minutes. For
408
- # more information, see **Rate limiting**.
409
- # @param workspace_id [String] Unique identifier of the workspace.
410
- # @param export [Boolean] Whether to include all element content in the returned data. If
411
- # **export**=`false`, the returned data includes only information about the element
412
- # itself. If **export**=`true`, all content, including subelements, is included.
413
- # @param page_limit [Fixnum] The number of records to return in each page of results.
414
- # @param include_count [Boolean] Whether to include information about the number of records returned.
415
- # @param sort [String] The attribute by which returned intents will be sorted. To reverse the sort order,
416
- # prefix the value with a minus sign (`-`).
417
- # @param cursor [String] A token identifying the page of results to retrieve.
418
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
419
- # the response.
420
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
421
- def list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
422
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
423
-
424
- headers = {
425
- }
426
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_intents")
427
-
428
- params = {
429
- "version" => @version,
430
- "export" => export,
431
- "page_limit" => page_limit,
432
- "include_count" => include_count,
433
- "sort" => sort,
434
- "cursor" => cursor,
435
- "include_audit" => include_audit
436
- }
437
-
438
- method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
439
-
440
- response = request(
441
- method: "GET",
442
- url: method_url,
443
- headers: headers,
444
- params: params,
445
- accept_json: true
446
- )
447
- response
448
- end
449
-
450
408
  ##
451
409
  # @!method create_intent(workspace_id:, intent:, description: nil, examples: nil)
452
410
  # Create intent.
@@ -462,7 +420,7 @@ module IBMWatson
462
420
  # - It must be no longer than 128 characters.
463
421
  # @param description [String] The description of the intent. This string cannot contain carriage return,
464
422
  # newline, or tab characters, and it must be no longer than 128 characters.
465
- # @param examples [Array[CreateExample]] An array of user input examples for the intent.
423
+ # @param examples [Array[Example]] An array of user input examples for the intent.
466
424
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
467
425
  def create_intent(workspace_id:, intent:, description: nil, examples: nil)
468
426
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
@@ -471,7 +429,8 @@ module IBMWatson
471
429
 
472
430
  headers = {
473
431
  }
474
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_intent")
432
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_intent")
433
+ headers.merge!(sdk_headers)
475
434
 
476
435
  params = {
477
436
  "version" => @version
@@ -496,6 +455,42 @@ module IBMWatson
496
455
  response
497
456
  end
498
457
 
458
+ ##
459
+ # @!method delete_intent(workspace_id:, intent:)
460
+ # Delete intent.
461
+ # Delete an intent from a workspace.
462
+ #
463
+ # This operation is limited to 2000 requests per 30 minutes. For more information,
464
+ # see **Rate limiting**.
465
+ # @param workspace_id [String] Unique identifier of the workspace.
466
+ # @param intent [String] The intent name.
467
+ # @return [nil]
468
+ def delete_intent(workspace_id:, intent:)
469
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
470
+
471
+ raise ArgumentError.new("intent must be provided") if intent.nil?
472
+
473
+ headers = {
474
+ }
475
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_intent")
476
+ headers.merge!(sdk_headers)
477
+
478
+ params = {
479
+ "version" => @version
480
+ }
481
+
482
+ method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
483
+
484
+ request(
485
+ method: "DELETE",
486
+ url: method_url,
487
+ headers: headers,
488
+ params: params,
489
+ accept_json: true
490
+ )
491
+ nil
492
+ end
493
+
499
494
  ##
500
495
  # @!method get_intent(workspace_id:, intent:, export: nil, include_audit: nil)
501
496
  # Get intent.
@@ -519,7 +514,8 @@ module IBMWatson
519
514
 
520
515
  headers = {
521
516
  }
522
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_intent")
517
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_intent")
518
+ headers.merge!(sdk_headers)
523
519
 
524
520
  params = {
525
521
  "version" => @version,
@@ -540,11 +536,61 @@ module IBMWatson
540
536
  end
541
537
 
542
538
  ##
543
- # @!method update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
544
- # Update intent.
545
- # Update an existing intent with new or modified data. You must provide component
546
- # objects defining the content of the updated intent.
547
- #
539
+ # @!method list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
540
+ # List intents.
541
+ # List the intents for a workspace.
542
+ #
543
+ # With **export**=`false`, this operation is limited to 2000 requests per 30
544
+ # minutes. With **export**=`true`, the limit is 400 requests per 30 minutes. For
545
+ # more information, see **Rate limiting**.
546
+ # @param workspace_id [String] Unique identifier of the workspace.
547
+ # @param export [Boolean] Whether to include all element content in the returned data. If
548
+ # **export**=`false`, the returned data includes only information about the element
549
+ # itself. If **export**=`true`, all content, including subelements, is included.
550
+ # @param page_limit [Fixnum] The number of records to return in each page of results.
551
+ # @param include_count [Boolean] Whether to include information about the number of records returned.
552
+ # @param sort [String] The attribute by which returned intents will be sorted. To reverse the sort order,
553
+ # prefix the value with a minus sign (`-`).
554
+ # @param cursor [String] A token identifying the page of results to retrieve.
555
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
556
+ # the response.
557
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
558
+ def list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
559
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
560
+
561
+ headers = {
562
+ }
563
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_intents")
564
+ headers.merge!(sdk_headers)
565
+
566
+ params = {
567
+ "version" => @version,
568
+ "export" => export,
569
+ "page_limit" => page_limit,
570
+ "include_count" => include_count,
571
+ "sort" => sort,
572
+ "cursor" => cursor,
573
+ "include_audit" => include_audit
574
+ }
575
+
576
+ method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
577
+
578
+ response = request(
579
+ method: "GET",
580
+ url: method_url,
581
+ headers: headers,
582
+ params: params,
583
+ accept_json: true
584
+ )
585
+ response
586
+ end
587
+
588
+ ##
589
+ # @!method update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
590
+ # Update intent.
591
+ # Update an existing intent with new or modified data. You must provide component
592
+ # objects defining the content of the updated intent.
593
+ #
548
594
  # This operation is limited to 2000 requests per 30 minutes. For more information,
549
595
  # see **Rate limiting**.
550
596
  # @param workspace_id [String] Unique identifier of the workspace.
@@ -554,8 +600,9 @@ module IBMWatson
554
600
  # characters.
555
601
  # - It cannot begin with the reserved prefix `sys-`.
556
602
  # - It must be no longer than 128 characters.
557
- # @param new_description [String] The description of the intent.
558
- # @param new_examples [Array[CreateExample]] An array of user input examples for the intent.
603
+ # @param new_description [String] The description of the intent. This string cannot contain carriage return,
604
+ # newline, or tab characters, and it must be no longer than 128 characters.
605
+ # @param new_examples [Array[Example]] An array of user input examples for the intent.
559
606
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
560
607
  def update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
561
608
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
@@ -564,7 +611,8 @@ module IBMWatson
564
611
 
565
612
  headers = {
566
613
  }
567
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_intent")
614
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_intent")
615
+ headers.merge!(sdk_headers)
568
616
 
569
617
  params = {
570
618
  "version" => @version
@@ -588,31 +636,88 @@ module IBMWatson
588
636
  )
589
637
  response
590
638
  end
639
+ #########################
640
+ # Examples
641
+ #########################
642
+
643
+ ##
644
+ # @!method create_example(workspace_id:, intent:, text:, mentions: nil)
645
+ # Create user input example.
646
+ # Add a new user input example to an intent.
647
+ #
648
+ # This operation is limited to 1000 requests per 30 minutes. For more information,
649
+ # see **Rate limiting**.
650
+ # @param workspace_id [String] Unique identifier of the workspace.
651
+ # @param intent [String] The intent name.
652
+ # @param text [String] The text of a user input example. This string must conform to the following
653
+ # restrictions:
654
+ # - It cannot contain carriage return, newline, or tab characters.
655
+ # - It cannot consist of only whitespace characters.
656
+ # - It must be no longer than 1024 characters.
657
+ # @param mentions [Array[Mention]] An array of contextual entity mentions.
658
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
659
+ def create_example(workspace_id:, intent:, text:, mentions: nil)
660
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
661
+
662
+ raise ArgumentError.new("intent must be provided") if intent.nil?
663
+
664
+ raise ArgumentError.new("text must be provided") if text.nil?
665
+
666
+ headers = {
667
+ }
668
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_example")
669
+ headers.merge!(sdk_headers)
670
+
671
+ params = {
672
+ "version" => @version
673
+ }
674
+
675
+ data = {
676
+ "text" => text,
677
+ "mentions" => mentions
678
+ }
679
+
680
+ method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
681
+
682
+ response = request(
683
+ method: "POST",
684
+ url: method_url,
685
+ headers: headers,
686
+ params: params,
687
+ json: data,
688
+ accept_json: true
689
+ )
690
+ response
691
+ end
591
692
 
592
693
  ##
593
- # @!method delete_intent(workspace_id:, intent:)
594
- # Delete intent.
595
- # Delete an intent from a workspace.
694
+ # @!method delete_example(workspace_id:, intent:, text:)
695
+ # Delete user input example.
696
+ # Delete a user input example from an intent.
596
697
  #
597
- # This operation is limited to 2000 requests per 30 minutes. For more information,
698
+ # This operation is limited to 1000 requests per 30 minutes. For more information,
598
699
  # see **Rate limiting**.
599
700
  # @param workspace_id [String] Unique identifier of the workspace.
600
701
  # @param intent [String] The intent name.
702
+ # @param text [String] The text of the user input example.
601
703
  # @return [nil]
602
- def delete_intent(workspace_id:, intent:)
704
+ def delete_example(workspace_id:, intent:, text:)
603
705
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
604
706
 
605
707
  raise ArgumentError.new("intent must be provided") if intent.nil?
606
708
 
709
+ raise ArgumentError.new("text must be provided") if text.nil?
710
+
607
711
  headers = {
608
712
  }
609
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_intent")
713
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_example")
714
+ headers.merge!(sdk_headers)
610
715
 
611
716
  params = {
612
717
  "version" => @version
613
718
  }
614
719
 
615
- method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
720
+ method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
616
721
 
617
722
  request(
618
723
  method: "DELETE",
@@ -623,9 +728,48 @@ module IBMWatson
623
728
  )
624
729
  nil
625
730
  end
626
- #########################
627
- # Examples
628
- #########################
731
+
732
+ ##
733
+ # @!method get_example(workspace_id:, intent:, text:, include_audit: nil)
734
+ # Get user input example.
735
+ # Get information about a user input example.
736
+ #
737
+ # This operation is limited to 6000 requests per 5 minutes. For more information,
738
+ # see **Rate limiting**.
739
+ # @param workspace_id [String] Unique identifier of the workspace.
740
+ # @param intent [String] The intent name.
741
+ # @param text [String] The text of the user input example.
742
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
743
+ # the response.
744
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
745
+ def get_example(workspace_id:, intent:, text:, include_audit: nil)
746
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
747
+
748
+ raise ArgumentError.new("intent must be provided") if intent.nil?
749
+
750
+ raise ArgumentError.new("text must be provided") if text.nil?
751
+
752
+ headers = {
753
+ }
754
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_example")
755
+ headers.merge!(sdk_headers)
756
+
757
+ params = {
758
+ "version" => @version,
759
+ "include_audit" => include_audit
760
+ }
761
+
762
+ method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
763
+
764
+ response = request(
765
+ method: "GET",
766
+ url: method_url,
767
+ headers: headers,
768
+ params: params,
769
+ accept_json: true
770
+ )
771
+ response
772
+ end
629
773
 
630
774
  ##
631
775
  # @!method list_examples(workspace_id:, intent:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
@@ -652,7 +796,8 @@ module IBMWatson
652
796
 
653
797
  headers = {
654
798
  }
655
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_examples")
799
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_examples")
800
+ headers.merge!(sdk_headers)
656
801
 
657
802
  params = {
658
803
  "version" => @version,
@@ -676,22 +821,23 @@ module IBMWatson
676
821
  end
677
822
 
678
823
  ##
679
- # @!method create_example(workspace_id:, intent:, text:, mentions: nil)
680
- # Create user input example.
681
- # Add a new user input example to an intent.
824
+ # @!method update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
825
+ # Update user input example.
826
+ # Update the text of a user input example.
682
827
  #
683
828
  # This operation is limited to 1000 requests per 30 minutes. For more information,
684
829
  # see **Rate limiting**.
685
830
  # @param workspace_id [String] Unique identifier of the workspace.
686
831
  # @param intent [String] The intent name.
687
- # @param text [String] The text of a user input example. This string must conform to the following
832
+ # @param text [String] The text of the user input example.
833
+ # @param new_text [String] The text of the user input example. This string must conform to the following
688
834
  # restrictions:
689
835
  # - It cannot contain carriage return, newline, or tab characters.
690
836
  # - It cannot consist of only whitespace characters.
691
837
  # - It must be no longer than 1024 characters.
692
- # @param mentions [Array[Mentions]] An array of contextual entity mentions.
838
+ # @param new_mentions [Array[Mention]] An array of contextual entity mentions.
693
839
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
694
- def create_example(workspace_id:, intent:, text:, mentions: nil)
840
+ def update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
695
841
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
696
842
 
697
843
  raise ArgumentError.new("intent must be provided") if intent.nil?
@@ -700,18 +846,19 @@ module IBMWatson
700
846
 
701
847
  headers = {
702
848
  }
703
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_example")
849
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_example")
850
+ headers.merge!(sdk_headers)
704
851
 
705
852
  params = {
706
853
  "version" => @version
707
854
  }
708
855
 
709
856
  data = {
710
- "text" => text,
711
- "mentions" => mentions
857
+ "text" => new_text,
858
+ "mentions" => new_mentions
712
859
  }
713
860
 
714
- method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
861
+ method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
715
862
 
716
863
  response = request(
717
864
  method: "POST",
@@ -723,138 +870,132 @@ module IBMWatson
723
870
  )
724
871
  response
725
872
  end
873
+ #########################
874
+ # Counterexamples
875
+ #########################
726
876
 
727
877
  ##
728
- # @!method get_example(workspace_id:, intent:, text:, include_audit: nil)
729
- # Get user input example.
730
- # Get information about a user input example.
878
+ # @!method create_counterexample(workspace_id:, text:)
879
+ # Create counterexample.
880
+ # Add a new counterexample to a workspace. Counterexamples are examples that have
881
+ # been marked as irrelevant input.
731
882
  #
732
- # This operation is limited to 6000 requests per 5 minutes. For more information,
883
+ # This operation is limited to 1000 requests per 30 minutes. For more information,
733
884
  # see **Rate limiting**.
734
885
  # @param workspace_id [String] Unique identifier of the workspace.
735
- # @param intent [String] The intent name.
736
- # @param text [String] The text of the user input example.
737
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
738
- # the response.
886
+ # @param text [String] The text of a user input marked as irrelevant input. This string must conform to
887
+ # the following restrictions:
888
+ # - It cannot contain carriage return, newline, or tab characters
889
+ # - It cannot consist of only whitespace characters
890
+ # - It must be no longer than 1024 characters.
739
891
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
740
- def get_example(workspace_id:, intent:, text:, include_audit: nil)
892
+ def create_counterexample(workspace_id:, text:)
741
893
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
742
894
 
743
- raise ArgumentError.new("intent must be provided") if intent.nil?
744
-
745
895
  raise ArgumentError.new("text must be provided") if text.nil?
746
896
 
747
897
  headers = {
748
898
  }
749
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_example")
899
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_counterexample")
900
+ headers.merge!(sdk_headers)
750
901
 
751
902
  params = {
752
- "version" => @version,
753
- "include_audit" => include_audit
903
+ "version" => @version
754
904
  }
755
905
 
756
- method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
906
+ data = {
907
+ "text" => text
908
+ }
909
+
910
+ method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
757
911
 
758
912
  response = request(
759
- method: "GET",
913
+ method: "POST",
760
914
  url: method_url,
761
915
  headers: headers,
762
916
  params: params,
917
+ json: data,
763
918
  accept_json: true
764
919
  )
765
920
  response
766
921
  end
767
922
 
768
923
  ##
769
- # @!method update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
770
- # Update user input example.
771
- # Update the text of a user input example.
924
+ # @!method delete_counterexample(workspace_id:, text:)
925
+ # Delete counterexample.
926
+ # Delete a counterexample from a workspace. Counterexamples are examples that have
927
+ # been marked as irrelevant input.
772
928
  #
773
929
  # This operation is limited to 1000 requests per 30 minutes. For more information,
774
930
  # see **Rate limiting**.
775
931
  # @param workspace_id [String] Unique identifier of the workspace.
776
- # @param intent [String] The intent name.
777
- # @param text [String] The text of the user input example.
778
- # @param new_text [String] The text of the user input example. This string must conform to the following
779
- # restrictions:
780
- # - It cannot contain carriage return, newline, or tab characters.
781
- # - It cannot consist of only whitespace characters.
782
- # - It must be no longer than 1024 characters.
783
- # @param new_mentions [Array[Mentions]] An array of contextual entity mentions.
784
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
785
- def update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
932
+ # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
933
+ # @return [nil]
934
+ def delete_counterexample(workspace_id:, text:)
786
935
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
787
936
 
788
- raise ArgumentError.new("intent must be provided") if intent.nil?
789
-
790
937
  raise ArgumentError.new("text must be provided") if text.nil?
791
938
 
792
939
  headers = {
793
940
  }
794
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_example")
941
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_counterexample")
942
+ headers.merge!(sdk_headers)
795
943
 
796
944
  params = {
797
945
  "version" => @version
798
946
  }
799
947
 
800
- data = {
801
- "text" => new_text,
802
- "mentions" => new_mentions
803
- }
804
-
805
- method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
948
+ method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
806
949
 
807
- response = request(
808
- method: "POST",
950
+ request(
951
+ method: "DELETE",
809
952
  url: method_url,
810
953
  headers: headers,
811
954
  params: params,
812
- json: data,
813
955
  accept_json: true
814
956
  )
815
- response
957
+ nil
816
958
  end
817
959
 
818
960
  ##
819
- # @!method delete_example(workspace_id:, intent:, text:)
820
- # Delete user input example.
821
- # Delete a user input example from an intent.
961
+ # @!method get_counterexample(workspace_id:, text:, include_audit: nil)
962
+ # Get counterexample.
963
+ # Get information about a counterexample. Counterexamples are examples that have
964
+ # been marked as irrelevant input.
822
965
  #
823
- # This operation is limited to 1000 requests per 30 minutes. For more information,
966
+ # This operation is limited to 6000 requests per 5 minutes. For more information,
824
967
  # see **Rate limiting**.
825
968
  # @param workspace_id [String] Unique identifier of the workspace.
826
- # @param intent [String] The intent name.
827
- # @param text [String] The text of the user input example.
828
- # @return [nil]
829
- def delete_example(workspace_id:, intent:, text:)
969
+ # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
970
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
971
+ # the response.
972
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
973
+ def get_counterexample(workspace_id:, text:, include_audit: nil)
830
974
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
831
975
 
832
- raise ArgumentError.new("intent must be provided") if intent.nil?
833
-
834
976
  raise ArgumentError.new("text must be provided") if text.nil?
835
977
 
836
978
  headers = {
837
979
  }
838
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_example")
980
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_counterexample")
981
+ headers.merge!(sdk_headers)
839
982
 
840
983
  params = {
841
- "version" => @version
984
+ "version" => @version,
985
+ "include_audit" => include_audit
842
986
  }
843
987
 
844
- method_url = "/v1/workspaces/%s/intents/%s/examples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent), ERB::Util.url_encode(text)]
988
+ method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
845
989
 
846
- request(
847
- method: "DELETE",
990
+ response = request(
991
+ method: "GET",
848
992
  url: method_url,
849
993
  headers: headers,
850
994
  params: params,
851
995
  accept_json: true
852
996
  )
853
- nil
997
+ response
854
998
  end
855
- #########################
856
- # Counterexamples
857
- #########################
858
999
 
859
1000
  ##
860
1001
  # @!method list_counterexamples(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
@@ -878,7 +1019,8 @@ module IBMWatson
878
1019
 
879
1020
  headers = {
880
1021
  }
881
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_counterexamples")
1022
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_counterexamples")
1023
+ headers.merge!(sdk_headers)
882
1024
 
883
1025
  params = {
884
1026
  "version" => @version,
@@ -902,38 +1044,40 @@ module IBMWatson
902
1044
  end
903
1045
 
904
1046
  ##
905
- # @!method create_counterexample(workspace_id:, text:)
906
- # Create counterexample.
907
- # Add a new counterexample to a workspace. Counterexamples are examples that have
908
- # been marked as irrelevant input.
1047
+ # @!method update_counterexample(workspace_id:, text:, new_text: nil)
1048
+ # Update counterexample.
1049
+ # Update the text of a counterexample. Counterexamples are examples that have been
1050
+ # marked as irrelevant input.
909
1051
  #
910
1052
  # This operation is limited to 1000 requests per 30 minutes. For more information,
911
1053
  # see **Rate limiting**.
912
1054
  # @param workspace_id [String] Unique identifier of the workspace.
913
- # @param text [String] The text of a user input marked as irrelevant input. This string must conform to
1055
+ # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
1056
+ # @param new_text [String] The text of a user input marked as irrelevant input. This string must conform to
914
1057
  # the following restrictions:
915
1058
  # - It cannot contain carriage return, newline, or tab characters
916
1059
  # - It cannot consist of only whitespace characters
917
1060
  # - It must be no longer than 1024 characters.
918
1061
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
919
- def create_counterexample(workspace_id:, text:)
1062
+ def update_counterexample(workspace_id:, text:, new_text: nil)
920
1063
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
921
1064
 
922
1065
  raise ArgumentError.new("text must be provided") if text.nil?
923
1066
 
924
1067
  headers = {
925
1068
  }
926
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_counterexample")
1069
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_counterexample")
1070
+ headers.merge!(sdk_headers)
927
1071
 
928
1072
  params = {
929
1073
  "version" => @version
930
1074
  }
931
1075
 
932
1076
  data = {
933
- "text" => text
1077
+ "text" => new_text
934
1078
  }
935
1079
 
936
- method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
1080
+ method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
937
1081
 
938
1082
  response = request(
939
1083
  method: "POST",
@@ -945,126 +1089,145 @@ module IBMWatson
945
1089
  )
946
1090
  response
947
1091
  end
1092
+ #########################
1093
+ # Entities
1094
+ #########################
948
1095
 
949
1096
  ##
950
- # @!method get_counterexample(workspace_id:, text:, include_audit: nil)
951
- # Get counterexample.
952
- # Get information about a counterexample. Counterexamples are examples that have
953
- # been marked as irrelevant input.
1097
+ # @!method create_entity(workspace_id:, entity:, description: nil, metadata: nil, fuzzy_match: nil, values: nil)
1098
+ # Create entity.
1099
+ # Create a new entity, or enable a system entity.
954
1100
  #
955
- # This operation is limited to 6000 requests per 5 minutes. For more information,
1101
+ # This operation is limited to 1000 requests per 30 minutes. For more information,
956
1102
  # see **Rate limiting**.
957
1103
  # @param workspace_id [String] Unique identifier of the workspace.
958
- # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
959
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
960
- # the response.
1104
+ # @param entity [String] The name of the entity. This string must conform to the following restrictions:
1105
+ # - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
1106
+ # - It must be no longer than 64 characters.
1107
+ #
1108
+ # If you specify an entity name beginning with the reserved prefix `sys-`, it must
1109
+ # be the name of a system entity that you want to enable. (Any entity content
1110
+ # specified with the request is ignored.).
1111
+ # @param description [String] The description of the entity. This string cannot contain carriage return,
1112
+ # newline, or tab characters, and it must be no longer than 128 characters.
1113
+ # @param metadata [Hash] Any metadata related to the entity.
1114
+ # @param fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
1115
+ # @param values [Array[CreateValue]] An array of objects describing the entity values.
961
1116
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
962
- def get_counterexample(workspace_id:, text:, include_audit: nil)
1117
+ def create_entity(workspace_id:, entity:, description: nil, metadata: nil, fuzzy_match: nil, values: nil)
963
1118
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
964
1119
 
965
- raise ArgumentError.new("text must be provided") if text.nil?
1120
+ raise ArgumentError.new("entity must be provided") if entity.nil?
966
1121
 
967
1122
  headers = {
968
1123
  }
969
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_counterexample")
1124
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_entity")
1125
+ headers.merge!(sdk_headers)
970
1126
 
971
1127
  params = {
972
- "version" => @version,
973
- "include_audit" => include_audit
1128
+ "version" => @version
974
1129
  }
975
1130
 
976
- method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
1131
+ data = {
1132
+ "entity" => entity,
1133
+ "description" => description,
1134
+ "metadata" => metadata,
1135
+ "fuzzy_match" => fuzzy_match,
1136
+ "values" => values
1137
+ }
1138
+
1139
+ method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
977
1140
 
978
1141
  response = request(
979
- method: "GET",
1142
+ method: "POST",
980
1143
  url: method_url,
981
1144
  headers: headers,
982
1145
  params: params,
1146
+ json: data,
983
1147
  accept_json: true
984
1148
  )
985
1149
  response
986
1150
  end
987
1151
 
988
1152
  ##
989
- # @!method update_counterexample(workspace_id:, text:, new_text: nil)
990
- # Update counterexample.
991
- # Update the text of a counterexample. Counterexamples are examples that have been
992
- # marked as irrelevant input.
1153
+ # @!method delete_entity(workspace_id:, entity:)
1154
+ # Delete entity.
1155
+ # Delete an entity from a workspace, or disable a system entity.
993
1156
  #
994
1157
  # This operation is limited to 1000 requests per 30 minutes. For more information,
995
1158
  # see **Rate limiting**.
996
1159
  # @param workspace_id [String] Unique identifier of the workspace.
997
- # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
998
- # @param new_text [String] The text of a user input counterexample.
999
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1000
- def update_counterexample(workspace_id:, text:, new_text: nil)
1160
+ # @param entity [String] The name of the entity.
1161
+ # @return [nil]
1162
+ def delete_entity(workspace_id:, entity:)
1001
1163
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1002
1164
 
1003
- raise ArgumentError.new("text must be provided") if text.nil?
1165
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1004
1166
 
1005
1167
  headers = {
1006
1168
  }
1007
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_counterexample")
1169
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_entity")
1170
+ headers.merge!(sdk_headers)
1008
1171
 
1009
1172
  params = {
1010
1173
  "version" => @version
1011
1174
  }
1012
1175
 
1013
- data = {
1014
- "text" => new_text
1015
- }
1016
-
1017
- method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
1176
+ method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1018
1177
 
1019
- response = request(
1020
- method: "POST",
1178
+ request(
1179
+ method: "DELETE",
1021
1180
  url: method_url,
1022
1181
  headers: headers,
1023
1182
  params: params,
1024
- json: data,
1025
1183
  accept_json: true
1026
1184
  )
1027
- response
1185
+ nil
1028
1186
  end
1029
1187
 
1030
1188
  ##
1031
- # @!method delete_counterexample(workspace_id:, text:)
1032
- # Delete counterexample.
1033
- # Delete a counterexample from a workspace. Counterexamples are examples that have
1034
- # been marked as irrelevant input.
1189
+ # @!method get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
1190
+ # Get entity.
1191
+ # Get information about an entity, optionally including all entity content.
1035
1192
  #
1036
- # This operation is limited to 1000 requests per 30 minutes. For more information,
1037
- # see **Rate limiting**.
1193
+ # With **export**=`false`, this operation is limited to 6000 requests per 5 minutes.
1194
+ # With **export**=`true`, the limit is 200 requests per 30 minutes. For more
1195
+ # information, see **Rate limiting**.
1038
1196
  # @param workspace_id [String] Unique identifier of the workspace.
1039
- # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
1040
- # @return [nil]
1041
- def delete_counterexample(workspace_id:, text:)
1197
+ # @param entity [String] The name of the entity.
1198
+ # @param export [Boolean] Whether to include all element content in the returned data. If
1199
+ # **export**=`false`, the returned data includes only information about the element
1200
+ # itself. If **export**=`true`, all content, including subelements, is included.
1201
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1202
+ # the response.
1203
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1204
+ def get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
1042
1205
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1043
1206
 
1044
- raise ArgumentError.new("text must be provided") if text.nil?
1207
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1045
1208
 
1046
1209
  headers = {
1047
1210
  }
1048
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_counterexample")
1211
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_entity")
1212
+ headers.merge!(sdk_headers)
1049
1213
 
1050
1214
  params = {
1051
- "version" => @version
1215
+ "version" => @version,
1216
+ "export" => export,
1217
+ "include_audit" => include_audit
1052
1218
  }
1053
1219
 
1054
- method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
1220
+ method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1055
1221
 
1056
- request(
1057
- method: "DELETE",
1222
+ response = request(
1223
+ method: "GET",
1058
1224
  url: method_url,
1059
1225
  headers: headers,
1060
1226
  params: params,
1061
1227
  accept_json: true
1062
1228
  )
1063
- nil
1229
+ response
1064
1230
  end
1065
- #########################
1066
- # Entities
1067
- #########################
1068
1231
 
1069
1232
  ##
1070
1233
  # @!method list_entities(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
@@ -1091,7 +1254,8 @@ module IBMWatson
1091
1254
 
1092
1255
  headers = {
1093
1256
  }
1094
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_entities")
1257
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_entities")
1258
+ headers.merge!(sdk_headers)
1095
1259
 
1096
1260
  params = {
1097
1261
  "version" => @version,
@@ -1116,48 +1280,48 @@ module IBMWatson
1116
1280
  end
1117
1281
 
1118
1282
  ##
1119
- # @!method create_entity(workspace_id:, entity:, description: nil, metadata: nil, values: nil, fuzzy_match: nil)
1120
- # Create entity.
1121
- # Create a new entity, or enable a system entity.
1283
+ # @!method update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
1284
+ # Update entity.
1285
+ # Update an existing entity with new or modified data. You must provide component
1286
+ # objects defining the content of the updated entity.
1122
1287
  #
1123
1288
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1124
1289
  # see **Rate limiting**.
1125
1290
  # @param workspace_id [String] Unique identifier of the workspace.
1126
- # @param entity [String] The name of the entity. This string must conform to the following restrictions:
1291
+ # @param entity [String] The name of the entity.
1292
+ # @param new_entity [String] The name of the entity. This string must conform to the following restrictions:
1127
1293
  # - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
1294
+ # - It cannot begin with the reserved prefix `sys-`.
1128
1295
  # - It must be no longer than 64 characters.
1129
- #
1130
- # If you specify an entity name beginning with the reserved prefix `sys-`, it must
1131
- # be the name of a system entity that you want to enable. (Any entity content
1132
- # specified with the request is ignored.).
1133
- # @param description [String] The description of the entity. This string cannot contain carriage return,
1296
+ # @param new_description [String] The description of the entity. This string cannot contain carriage return,
1134
1297
  # newline, or tab characters, and it must be no longer than 128 characters.
1135
- # @param metadata [Object] Any metadata related to the value.
1136
- # @param values [Array[CreateValue]] An array of objects describing the entity values.
1137
- # @param fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
1298
+ # @param new_metadata [Hash] Any metadata related to the entity.
1299
+ # @param new_fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
1300
+ # @param new_values [Array[CreateValue]] An array of objects describing the entity values.
1138
1301
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1139
- def create_entity(workspace_id:, entity:, description: nil, metadata: nil, values: nil, fuzzy_match: nil)
1302
+ def update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
1140
1303
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1141
1304
 
1142
1305
  raise ArgumentError.new("entity must be provided") if entity.nil?
1143
1306
 
1144
1307
  headers = {
1145
1308
  }
1146
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_entity")
1309
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_entity")
1310
+ headers.merge!(sdk_headers)
1147
1311
 
1148
1312
  params = {
1149
1313
  "version" => @version
1150
1314
  }
1151
1315
 
1152
1316
  data = {
1153
- "entity" => entity,
1154
- "description" => description,
1155
- "metadata" => metadata,
1156
- "values" => values,
1157
- "fuzzy_match" => fuzzy_match
1317
+ "entity" => new_entity,
1318
+ "description" => new_description,
1319
+ "metadata" => new_metadata,
1320
+ "fuzzy_match" => new_fuzzy_match,
1321
+ "values" => new_values
1158
1322
  }
1159
1323
 
1160
- method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
1324
+ method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1161
1325
 
1162
1326
  response = request(
1163
1327
  method: "POST",
@@ -1169,15 +1333,18 @@ module IBMWatson
1169
1333
  )
1170
1334
  response
1171
1335
  end
1336
+ #########################
1337
+ # Mentions
1338
+ #########################
1172
1339
 
1173
1340
  ##
1174
- # @!method get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
1175
- # Get entity.
1176
- # Get information about an entity, optionally including all entity content.
1341
+ # @!method list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
1342
+ # List entity mentions.
1343
+ # List mentions for a contextual entity. An entity mention is an occurrence of a
1344
+ # contextual entity in the context of an intent user input example.
1177
1345
  #
1178
- # With **export**=`false`, this operation is limited to 6000 requests per 5 minutes.
1179
- # With **export**=`true`, the limit is 200 requests per 30 minutes. For more
1180
- # information, see **Rate limiting**.
1346
+ # This operation is limited to 200 requests per 30 minutes. For more information,
1347
+ # see **Rate limiting**.
1181
1348
  # @param workspace_id [String] Unique identifier of the workspace.
1182
1349
  # @param entity [String] The name of the entity.
1183
1350
  # @param export [Boolean] Whether to include all element content in the returned data. If
@@ -1186,14 +1353,15 @@ module IBMWatson
1186
1353
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1187
1354
  # the response.
1188
1355
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1189
- def get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
1356
+ def list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
1190
1357
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1191
1358
 
1192
1359
  raise ArgumentError.new("entity must be provided") if entity.nil?
1193
1360
 
1194
1361
  headers = {
1195
1362
  }
1196
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_entity")
1363
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_mentions")
1364
+ headers.merge!(sdk_headers)
1197
1365
 
1198
1366
  params = {
1199
1367
  "version" => @version,
@@ -1201,7 +1369,7 @@ module IBMWatson
1201
1369
  "include_audit" => include_audit
1202
1370
  }
1203
1371
 
1204
- method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1372
+ method_url = "/v1/workspaces/%s/entities/%s/mentions" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1205
1373
 
1206
1374
  response = request(
1207
1375
  method: "GET",
@@ -1212,49 +1380,63 @@ module IBMWatson
1212
1380
  )
1213
1381
  response
1214
1382
  end
1383
+ #########################
1384
+ # Values
1385
+ #########################
1215
1386
 
1216
1387
  ##
1217
- # @!method update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
1218
- # Update entity.
1219
- # Update an existing entity with new or modified data. You must provide component
1220
- # objects defining the content of the updated entity.
1388
+ # @!method create_value(workspace_id:, entity:, value:, metadata: nil, value_type: nil, synonyms: nil, patterns: nil)
1389
+ # Create entity value.
1390
+ # Create a new value for an entity.
1221
1391
  #
1222
1392
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1223
1393
  # see **Rate limiting**.
1224
1394
  # @param workspace_id [String] Unique identifier of the workspace.
1225
1395
  # @param entity [String] The name of the entity.
1226
- # @param new_entity [String] The name of the entity. This string must conform to the following restrictions:
1227
- # - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
1228
- # - It cannot begin with the reserved prefix `sys-`.
1396
+ # @param value [String] The text of the entity value. This string must conform to the following
1397
+ # restrictions:
1398
+ # - It cannot contain carriage return, newline, or tab characters.
1399
+ # - It cannot consist of only whitespace characters.
1229
1400
  # - It must be no longer than 64 characters.
1230
- # @param new_description [String] The description of the entity. This string cannot contain carriage return,
1231
- # newline, or tab characters, and it must be no longer than 128 characters.
1232
- # @param new_metadata [Object] Any metadata related to the entity.
1233
- # @param new_fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
1234
- # @param new_values [Array[CreateValue]] An array of entity values.
1401
+ # @param metadata [Hash] Any metadata related to the entity value.
1402
+ # @param value_type [String] Specifies the type of entity value.
1403
+ # @param synonyms [Array[String]] An array of synonyms for the entity value. A value can specify either synonyms or
1404
+ # patterns (depending on the value type), but not both. A synonym must conform to
1405
+ # the following resrictions:
1406
+ # - It cannot contain carriage return, newline, or tab characters.
1407
+ # - It cannot consist of only whitespace characters.
1408
+ # - It must be no longer than 64 characters.
1409
+ # @param patterns [Array[String]] An array of patterns for the entity value. A value can specify either synonyms or
1410
+ # patterns (depending on the value type), but not both. A pattern is a regular
1411
+ # expression no longer than 512 characters. For more information about how to
1412
+ # specify a pattern, see the
1413
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
1235
1414
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1236
- def update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
1415
+ def create_value(workspace_id:, entity:, value:, metadata: nil, value_type: nil, synonyms: nil, patterns: nil)
1237
1416
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1238
1417
 
1239
1418
  raise ArgumentError.new("entity must be provided") if entity.nil?
1240
1419
 
1420
+ raise ArgumentError.new("value must be provided") if value.nil?
1421
+
1241
1422
  headers = {
1242
1423
  }
1243
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_entity")
1424
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_value")
1425
+ headers.merge!(sdk_headers)
1244
1426
 
1245
1427
  params = {
1246
1428
  "version" => @version
1247
1429
  }
1248
1430
 
1249
1431
  data = {
1250
- "entity" => new_entity,
1251
- "description" => new_description,
1252
- "metadata" => new_metadata,
1253
- "fuzzy_match" => new_fuzzy_match,
1254
- "values" => new_values
1432
+ "value" => value,
1433
+ "metadata" => metadata,
1434
+ "type" => value_type,
1435
+ "synonyms" => synonyms,
1436
+ "patterns" => patterns
1255
1437
  }
1256
1438
 
1257
- method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1439
+ method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1258
1440
 
1259
1441
  response = request(
1260
1442
  method: "POST",
@@ -1268,29 +1450,33 @@ module IBMWatson
1268
1450
  end
1269
1451
 
1270
1452
  ##
1271
- # @!method delete_entity(workspace_id:, entity:)
1272
- # Delete entity.
1273
- # Delete an entity from a workspace, or disable a system entity.
1453
+ # @!method delete_value(workspace_id:, entity:, value:)
1454
+ # Delete entity value.
1455
+ # Delete a value from an entity.
1274
1456
  #
1275
1457
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1276
1458
  # see **Rate limiting**.
1277
1459
  # @param workspace_id [String] Unique identifier of the workspace.
1278
1460
  # @param entity [String] The name of the entity.
1461
+ # @param value [String] The text of the entity value.
1279
1462
  # @return [nil]
1280
- def delete_entity(workspace_id:, entity:)
1463
+ def delete_value(workspace_id:, entity:, value:)
1281
1464
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1282
1465
 
1283
1466
  raise ArgumentError.new("entity must be provided") if entity.nil?
1284
1467
 
1468
+ raise ArgumentError.new("value must be provided") if value.nil?
1469
+
1285
1470
  headers = {
1286
1471
  }
1287
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_entity")
1472
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_value")
1473
+ headers.merge!(sdk_headers)
1288
1474
 
1289
1475
  params = {
1290
1476
  "version" => @version
1291
1477
  }
1292
1478
 
1293
- method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1479
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1294
1480
 
1295
1481
  request(
1296
1482
  method: "DELETE",
@@ -1301,34 +1487,34 @@ module IBMWatson
1301
1487
  )
1302
1488
  nil
1303
1489
  end
1304
- #########################
1305
- # Mentions
1306
- #########################
1307
1490
 
1308
1491
  ##
1309
- # @!method list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
1310
- # List entity mentions.
1311
- # List mentions for a contextual entity. An entity mention is an occurrence of a
1312
- # contextual entity in the context of an intent user input example.
1492
+ # @!method get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
1493
+ # Get entity value.
1494
+ # Get information about an entity value.
1313
1495
  #
1314
- # This operation is limited to 200 requests per 30 minutes. For more information,
1496
+ # This operation is limited to 6000 requests per 5 minutes. For more information,
1315
1497
  # see **Rate limiting**.
1316
1498
  # @param workspace_id [String] Unique identifier of the workspace.
1317
1499
  # @param entity [String] The name of the entity.
1500
+ # @param value [String] The text of the entity value.
1318
1501
  # @param export [Boolean] Whether to include all element content in the returned data. If
1319
1502
  # **export**=`false`, the returned data includes only information about the element
1320
1503
  # itself. If **export**=`true`, all content, including subelements, is included.
1321
1504
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1322
1505
  # the response.
1323
1506
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1324
- def list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
1507
+ def get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
1325
1508
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1326
1509
 
1327
1510
  raise ArgumentError.new("entity must be provided") if entity.nil?
1328
1511
 
1512
+ raise ArgumentError.new("value must be provided") if value.nil?
1513
+
1329
1514
  headers = {
1330
1515
  }
1331
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_mentions")
1516
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_value")
1517
+ headers.merge!(sdk_headers)
1332
1518
 
1333
1519
  params = {
1334
1520
  "version" => @version,
@@ -1336,7 +1522,7 @@ module IBMWatson
1336
1522
  "include_audit" => include_audit
1337
1523
  }
1338
1524
 
1339
- method_url = "/v1/workspaces/%s/entities/%s/mentions" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1525
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1340
1526
 
1341
1527
  response = request(
1342
1528
  method: "GET",
@@ -1347,9 +1533,6 @@ module IBMWatson
1347
1533
  )
1348
1534
  response
1349
1535
  end
1350
- #########################
1351
- # Values
1352
- #########################
1353
1536
 
1354
1537
  ##
1355
1538
  # @!method list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
@@ -1378,7 +1561,8 @@ module IBMWatson
1378
1561
 
1379
1562
  headers = {
1380
1563
  }
1381
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_values")
1564
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_values")
1565
+ headers.merge!(sdk_headers)
1382
1566
 
1383
1567
  params = {
1384
1568
  "version" => @version,
@@ -1403,34 +1587,36 @@ module IBMWatson
1403
1587
  end
1404
1588
 
1405
1589
  ##
1406
- # @!method create_value(workspace_id:, entity:, value:, metadata: nil, synonyms: nil, patterns: nil, value_type: nil)
1407
- # Add entity value.
1408
- # Create a new value for an entity.
1590
+ # @!method update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_value_type: nil, new_synonyms: nil, new_patterns: nil)
1591
+ # Update entity value.
1592
+ # Update an existing entity value with new or modified data. You must provide
1593
+ # component objects defining the content of the updated entity value.
1409
1594
  #
1410
1595
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1411
1596
  # see **Rate limiting**.
1412
1597
  # @param workspace_id [String] Unique identifier of the workspace.
1413
1598
  # @param entity [String] The name of the entity.
1414
- # @param value [String] The text of the entity value. This string must conform to the following
1599
+ # @param value [String] The text of the entity value.
1600
+ # @param new_value [String] The text of the entity value. This string must conform to the following
1415
1601
  # restrictions:
1416
1602
  # - It cannot contain carriage return, newline, or tab characters.
1417
1603
  # - It cannot consist of only whitespace characters.
1418
1604
  # - It must be no longer than 64 characters.
1419
- # @param metadata [Object] Any metadata related to the entity value.
1420
- # @param synonyms [Array[String]] An array containing any synonyms for the entity value. You can provide either
1421
- # synonyms or patterns (as indicated by **type**), but not both. A synonym must
1422
- # conform to the following restrictions:
1605
+ # @param new_metadata [Hash] Any metadata related to the entity value.
1606
+ # @param new_value_type [String] Specifies the type of entity value.
1607
+ # @param new_synonyms [Array[String]] An array of synonyms for the entity value. A value can specify either synonyms or
1608
+ # patterns (depending on the value type), but not both. A synonym must conform to
1609
+ # the following resrictions:
1423
1610
  # - It cannot contain carriage return, newline, or tab characters.
1424
1611
  # - It cannot consist of only whitespace characters.
1425
1612
  # - It must be no longer than 64 characters.
1426
- # @param patterns [Array[String]] An array of patterns for the entity value. You can provide either synonyms or
1427
- # patterns (as indicated by **type**), but not both. A pattern is a regular
1613
+ # @param new_patterns [Array[String]] An array of patterns for the entity value. A value can specify either synonyms or
1614
+ # patterns (depending on the value type), but not both. A pattern is a regular
1428
1615
  # expression no longer than 512 characters. For more information about how to
1429
1616
  # specify a pattern, see the
1430
- # [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#creating-entities).
1431
- # @param value_type [String] Specifies the type of value.
1617
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
1432
1618
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1433
- def create_value(workspace_id:, entity:, value:, metadata: nil, synonyms: nil, patterns: nil, value_type: nil)
1619
+ def update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_value_type: nil, new_synonyms: nil, new_patterns: nil)
1434
1620
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1435
1621
 
1436
1622
  raise ArgumentError.new("entity must be provided") if entity.nil?
@@ -1439,21 +1625,22 @@ module IBMWatson
1439
1625
 
1440
1626
  headers = {
1441
1627
  }
1442
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_value")
1628
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_value")
1629
+ headers.merge!(sdk_headers)
1443
1630
 
1444
1631
  params = {
1445
1632
  "version" => @version
1446
1633
  }
1447
1634
 
1448
1635
  data = {
1449
- "value" => value,
1450
- "metadata" => metadata,
1451
- "synonyms" => synonyms,
1452
- "patterns" => patterns,
1453
- "type" => value_type
1636
+ "value" => new_value,
1637
+ "metadata" => new_metadata,
1638
+ "type" => new_value_type,
1639
+ "synonyms" => new_synonyms,
1640
+ "patterns" => new_patterns
1454
1641
  }
1455
1642
 
1456
- method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1643
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1457
1644
 
1458
1645
  response = request(
1459
1646
  method: "POST",
@@ -1465,106 +1652,48 @@ module IBMWatson
1465
1652
  )
1466
1653
  response
1467
1654
  end
1655
+ #########################
1656
+ # Synonyms
1657
+ #########################
1468
1658
 
1469
1659
  ##
1470
- # @!method get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
1471
- # Get entity value.
1472
- # Get information about an entity value.
1473
- #
1474
- # This operation is limited to 6000 requests per 5 minutes. For more information,
1475
- # see **Rate limiting**.
1476
- # @param workspace_id [String] Unique identifier of the workspace.
1477
- # @param entity [String] The name of the entity.
1478
- # @param value [String] The text of the entity value.
1479
- # @param export [Boolean] Whether to include all element content in the returned data. If
1480
- # **export**=`false`, the returned data includes only information about the element
1481
- # itself. If **export**=`true`, all content, including subelements, is included.
1482
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1483
- # the response.
1484
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1485
- def get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
1486
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1487
-
1488
- raise ArgumentError.new("entity must be provided") if entity.nil?
1489
-
1490
- raise ArgumentError.new("value must be provided") if value.nil?
1491
-
1492
- headers = {
1493
- }
1494
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_value")
1495
-
1496
- params = {
1497
- "version" => @version,
1498
- "export" => export,
1499
- "include_audit" => include_audit
1500
- }
1501
-
1502
- method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1503
-
1504
- response = request(
1505
- method: "GET",
1506
- url: method_url,
1507
- headers: headers,
1508
- params: params,
1509
- accept_json: true
1510
- )
1511
- response
1512
- end
1513
-
1514
- ##
1515
- # @!method update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_type: nil, new_synonyms: nil, new_patterns: nil)
1516
- # Update entity value.
1517
- # Update an existing entity value with new or modified data. You must provide
1518
- # component objects defining the content of the updated entity value.
1660
+ # @!method create_synonym(workspace_id:, entity:, value:, synonym:)
1661
+ # Create entity value synonym.
1662
+ # Add a new synonym to an entity value.
1519
1663
  #
1520
1664
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1521
1665
  # see **Rate limiting**.
1522
1666
  # @param workspace_id [String] Unique identifier of the workspace.
1523
1667
  # @param entity [String] The name of the entity.
1524
1668
  # @param value [String] The text of the entity value.
1525
- # @param new_value [String] The text of the entity value. This string must conform to the following
1526
- # restrictions:
1527
- # - It cannot contain carriage return, newline, or tab characters.
1528
- # - It cannot consist of only whitespace characters.
1529
- # - It must be no longer than 64 characters.
1530
- # @param new_metadata [Object] Any metadata related to the entity value.
1531
- # @param new_type [String] Specifies the type of value.
1532
- # @param new_synonyms [Array[String]] An array of synonyms for the entity value. You can provide either synonyms or
1533
- # patterns (as indicated by **type**), but not both. A synonym must conform to the
1534
- # following resrictions:
1669
+ # @param synonym [String] The text of the synonym. This string must conform to the following restrictions:
1535
1670
  # - It cannot contain carriage return, newline, or tab characters.
1536
1671
  # - It cannot consist of only whitespace characters.
1537
1672
  # - It must be no longer than 64 characters.
1538
- # @param new_patterns [Array[String]] An array of patterns for the entity value. You can provide either synonyms or
1539
- # patterns (as indicated by **type**), but not both. A pattern is a regular
1540
- # expression no longer than 512 characters. For more information about how to
1541
- # specify a pattern, see the
1542
- # [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#creating-entities).
1543
1673
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1544
- def update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_type: nil, new_synonyms: nil, new_patterns: nil)
1674
+ def create_synonym(workspace_id:, entity:, value:, synonym:)
1545
1675
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1546
1676
 
1547
1677
  raise ArgumentError.new("entity must be provided") if entity.nil?
1548
1678
 
1549
1679
  raise ArgumentError.new("value must be provided") if value.nil?
1550
1680
 
1681
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1682
+
1551
1683
  headers = {
1552
1684
  }
1553
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_value")
1685
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_synonym")
1686
+ headers.merge!(sdk_headers)
1554
1687
 
1555
1688
  params = {
1556
1689
  "version" => @version
1557
1690
  }
1558
1691
 
1559
1692
  data = {
1560
- "value" => new_value,
1561
- "metadata" => new_metadata,
1562
- "type" => new_type,
1563
- "synonyms" => new_synonyms,
1564
- "patterns" => new_patterns
1693
+ "synonym" => synonym
1565
1694
  }
1566
1695
 
1567
- method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1696
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1568
1697
 
1569
1698
  response = request(
1570
1699
  method: "POST",
@@ -1578,32 +1707,36 @@ module IBMWatson
1578
1707
  end
1579
1708
 
1580
1709
  ##
1581
- # @!method delete_value(workspace_id:, entity:, value:)
1582
- # Delete entity value.
1583
- # Delete a value from an entity.
1710
+ # @!method delete_synonym(workspace_id:, entity:, value:, synonym:)
1711
+ # Delete entity value synonym.
1712
+ # Delete a synonym from an entity value.
1584
1713
  #
1585
1714
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1586
1715
  # see **Rate limiting**.
1587
1716
  # @param workspace_id [String] Unique identifier of the workspace.
1588
1717
  # @param entity [String] The name of the entity.
1589
1718
  # @param value [String] The text of the entity value.
1719
+ # @param synonym [String] The text of the synonym.
1590
1720
  # @return [nil]
1591
- def delete_value(workspace_id:, entity:, value:)
1721
+ def delete_synonym(workspace_id:, entity:, value:, synonym:)
1592
1722
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1593
1723
 
1594
1724
  raise ArgumentError.new("entity must be provided") if entity.nil?
1595
1725
 
1596
1726
  raise ArgumentError.new("value must be provided") if value.nil?
1597
1727
 
1728
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1729
+
1598
1730
  headers = {
1599
1731
  }
1600
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_value")
1732
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_synonym")
1733
+ headers.merge!(sdk_headers)
1601
1734
 
1602
1735
  params = {
1603
1736
  "version" => @version
1604
1737
  }
1605
1738
 
1606
- method_url = "/v1/workspaces/%s/entities/%s/values/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1739
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
1607
1740
 
1608
1741
  request(
1609
1742
  method: "DELETE",
@@ -1614,49 +1747,41 @@ module IBMWatson
1614
1747
  )
1615
1748
  nil
1616
1749
  end
1617
- #########################
1618
- # Synonyms
1619
- #########################
1620
1750
 
1621
1751
  ##
1622
- # @!method list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1623
- # List entity value synonyms.
1624
- # List the synonyms for an entity value.
1752
+ # @!method get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
1753
+ # Get entity value synonym.
1754
+ # Get information about a synonym of an entity value.
1625
1755
  #
1626
- # This operation is limited to 2500 requests per 30 minutes. For more information,
1756
+ # This operation is limited to 6000 requests per 5 minutes. For more information,
1627
1757
  # see **Rate limiting**.
1628
1758
  # @param workspace_id [String] Unique identifier of the workspace.
1629
1759
  # @param entity [String] The name of the entity.
1630
1760
  # @param value [String] The text of the entity value.
1631
- # @param page_limit [Fixnum] The number of records to return in each page of results.
1632
- # @param include_count [Boolean] Whether to include information about the number of records returned.
1633
- # @param sort [String] The attribute by which returned entity value synonyms will be sorted. To reverse
1634
- # the sort order, prefix the value with a minus sign (`-`).
1635
- # @param cursor [String] A token identifying the page of results to retrieve.
1761
+ # @param synonym [String] The text of the synonym.
1636
1762
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1637
1763
  # the response.
1638
1764
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1639
- def list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1765
+ def get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
1640
1766
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1641
1767
 
1642
1768
  raise ArgumentError.new("entity must be provided") if entity.nil?
1643
1769
 
1644
1770
  raise ArgumentError.new("value must be provided") if value.nil?
1645
1771
 
1772
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1773
+
1646
1774
  headers = {
1647
1775
  }
1648
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_synonyms")
1776
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_synonym")
1777
+ headers.merge!(sdk_headers)
1649
1778
 
1650
1779
  params = {
1651
1780
  "version" => @version,
1652
- "page_limit" => page_limit,
1653
- "include_count" => include_count,
1654
- "sort" => sort,
1655
- "cursor" => cursor,
1656
1781
  "include_audit" => include_audit
1657
1782
  }
1658
1783
 
1659
- method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1784
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
1660
1785
 
1661
1786
  response = request(
1662
1787
  method: "GET",
@@ -1669,87 +1794,45 @@ module IBMWatson
1669
1794
  end
1670
1795
 
1671
1796
  ##
1672
- # @!method create_synonym(workspace_id:, entity:, value:, synonym:)
1673
- # Add entity value synonym.
1674
- # Add a new synonym to an entity value.
1675
- #
1676
- # This operation is limited to 1000 requests per 30 minutes. For more information,
1677
- # see **Rate limiting**.
1678
- # @param workspace_id [String] Unique identifier of the workspace.
1679
- # @param entity [String] The name of the entity.
1680
- # @param value [String] The text of the entity value.
1681
- # @param synonym [String] The text of the synonym. This string must conform to the following restrictions:
1682
- # - It cannot contain carriage return, newline, or tab characters.
1683
- # - It cannot consist of only whitespace characters.
1684
- # - It must be no longer than 64 characters.
1685
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1686
- def create_synonym(workspace_id:, entity:, value:, synonym:)
1687
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1688
-
1689
- raise ArgumentError.new("entity must be provided") if entity.nil?
1690
-
1691
- raise ArgumentError.new("value must be provided") if value.nil?
1692
-
1693
- raise ArgumentError.new("synonym must be provided") if synonym.nil?
1694
-
1695
- headers = {
1696
- }
1697
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_synonym")
1698
-
1699
- params = {
1700
- "version" => @version
1701
- }
1702
-
1703
- data = {
1704
- "synonym" => synonym
1705
- }
1706
-
1707
- method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1708
-
1709
- response = request(
1710
- method: "POST",
1711
- url: method_url,
1712
- headers: headers,
1713
- params: params,
1714
- json: data,
1715
- accept_json: true
1716
- )
1717
- response
1718
- end
1719
-
1720
- ##
1721
- # @!method get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
1722
- # Get entity value synonym.
1723
- # Get information about a synonym of an entity value.
1797
+ # @!method list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1798
+ # List entity value synonyms.
1799
+ # List the synonyms for an entity value.
1724
1800
  #
1725
- # This operation is limited to 6000 requests per 5 minutes. For more information,
1801
+ # This operation is limited to 2500 requests per 30 minutes. For more information,
1726
1802
  # see **Rate limiting**.
1727
1803
  # @param workspace_id [String] Unique identifier of the workspace.
1728
1804
  # @param entity [String] The name of the entity.
1729
1805
  # @param value [String] The text of the entity value.
1730
- # @param synonym [String] The text of the synonym.
1806
+ # @param page_limit [Fixnum] The number of records to return in each page of results.
1807
+ # @param include_count [Boolean] Whether to include information about the number of records returned.
1808
+ # @param sort [String] The attribute by which returned entity value synonyms will be sorted. To reverse
1809
+ # the sort order, prefix the value with a minus sign (`-`).
1810
+ # @param cursor [String] A token identifying the page of results to retrieve.
1731
1811
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1732
1812
  # the response.
1733
1813
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1734
- def get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
1814
+ def list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1735
1815
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1736
1816
 
1737
1817
  raise ArgumentError.new("entity must be provided") if entity.nil?
1738
1818
 
1739
1819
  raise ArgumentError.new("value must be provided") if value.nil?
1740
1820
 
1741
- raise ArgumentError.new("synonym must be provided") if synonym.nil?
1742
-
1743
1821
  headers = {
1744
1822
  }
1745
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_synonym")
1823
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_synonyms")
1824
+ headers.merge!(sdk_headers)
1746
1825
 
1747
1826
  params = {
1748
1827
  "version" => @version,
1828
+ "page_limit" => page_limit,
1829
+ "include_count" => include_count,
1830
+ "sort" => sort,
1831
+ "cursor" => cursor,
1749
1832
  "include_audit" => include_audit
1750
1833
  }
1751
1834
 
1752
- method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
1835
+ method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value)]
1753
1836
 
1754
1837
  response = request(
1755
1838
  method: "GET",
@@ -1788,7 +1871,8 @@ module IBMWatson
1788
1871
 
1789
1872
  headers = {
1790
1873
  }
1791
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_synonym")
1874
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_synonym")
1875
+ headers.merge!(sdk_headers)
1792
1876
 
1793
1877
  params = {
1794
1878
  "version" => @version
@@ -1810,97 +1894,12 @@ module IBMWatson
1810
1894
  )
1811
1895
  response
1812
1896
  end
1813
-
1814
- ##
1815
- # @!method delete_synonym(workspace_id:, entity:, value:, synonym:)
1816
- # Delete entity value synonym.
1817
- # Delete a synonym from an entity value.
1818
- #
1819
- # This operation is limited to 1000 requests per 30 minutes. For more information,
1820
- # see **Rate limiting**.
1821
- # @param workspace_id [String] Unique identifier of the workspace.
1822
- # @param entity [String] The name of the entity.
1823
- # @param value [String] The text of the entity value.
1824
- # @param synonym [String] The text of the synonym.
1825
- # @return [nil]
1826
- def delete_synonym(workspace_id:, entity:, value:, synonym:)
1827
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1828
-
1829
- raise ArgumentError.new("entity must be provided") if entity.nil?
1830
-
1831
- raise ArgumentError.new("value must be provided") if value.nil?
1832
-
1833
- raise ArgumentError.new("synonym must be provided") if synonym.nil?
1834
-
1835
- headers = {
1836
- }
1837
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_synonym")
1838
-
1839
- params = {
1840
- "version" => @version
1841
- }
1842
-
1843
- method_url = "/v1/workspaces/%s/entities/%s/values/%s/synonyms/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity), ERB::Util.url_encode(value), ERB::Util.url_encode(synonym)]
1844
-
1845
- request(
1846
- method: "DELETE",
1847
- url: method_url,
1848
- headers: headers,
1849
- params: params,
1850
- accept_json: true
1851
- )
1852
- nil
1853
- end
1854
1897
  #########################
1855
1898
  # Dialog nodes
1856
1899
  #########################
1857
1900
 
1858
1901
  ##
1859
- # @!method list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1860
- # List dialog nodes.
1861
- # List the dialog nodes for a workspace.
1862
- #
1863
- # This operation is limited to 2500 requests per 30 minutes. For more information,
1864
- # see **Rate limiting**.
1865
- # @param workspace_id [String] Unique identifier of the workspace.
1866
- # @param page_limit [Fixnum] The number of records to return in each page of results.
1867
- # @param include_count [Boolean] Whether to include information about the number of records returned.
1868
- # @param sort [String] The attribute by which returned dialog nodes will be sorted. To reverse the sort
1869
- # order, prefix the value with a minus sign (`-`).
1870
- # @param cursor [String] A token identifying the page of results to retrieve.
1871
- # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1872
- # the response.
1873
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1874
- def list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1875
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1876
-
1877
- headers = {
1878
- }
1879
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_dialog_nodes")
1880
-
1881
- params = {
1882
- "version" => @version,
1883
- "page_limit" => page_limit,
1884
- "include_count" => include_count,
1885
- "sort" => sort,
1886
- "cursor" => cursor,
1887
- "include_audit" => include_audit
1888
- }
1889
-
1890
- method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
1891
-
1892
- response = request(
1893
- method: "GET",
1894
- url: method_url,
1895
- headers: headers,
1896
- params: params,
1897
- accept_json: true
1898
- )
1899
- response
1900
- end
1901
-
1902
- ##
1903
- # @!method create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, actions: nil, title: nil, node_type: nil, event_name: nil, variable: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1902
+ # @!method create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, node_type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1904
1903
  # Create dialog node.
1905
1904
  # Create a new dialog node.
1906
1905
  #
@@ -1916,15 +1915,16 @@ module IBMWatson
1916
1915
  # @param conditions [String] The condition that will trigger the dialog node. This string cannot contain
1917
1916
  # carriage return, newline, or tab characters, and it must be no longer than 2048
1918
1917
  # characters.
1919
- # @param parent [String] The ID of the parent dialog node.
1920
- # @param previous_sibling [String] The ID of the previous dialog node.
1918
+ # @param parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
1919
+ # no parent.
1920
+ # @param previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
1921
+ # node has no previous sibling.
1921
1922
  # @param output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
1922
1923
  # node output, see the
1923
- # [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#complex).
1924
- # @param context [Object] The context for the dialog node.
1925
- # @param metadata [Object] The metadata for the dialog node.
1924
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#dialog-overview-responses).
1925
+ # @param context [Hash] The context for the dialog node.
1926
+ # @param metadata [Hash] The metadata for the dialog node.
1926
1927
  # @param next_step [DialogNodeNextStep] The next step to execute following this dialog node.
1927
- # @param actions [Array[DialogNodeAction]] An array of objects describing any actions to be invoked by the dialog node.
1928
1928
  # @param title [String] The alias used to identify the dialog node. This string must conform to the
1929
1929
  # following restrictions:
1930
1930
  # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
@@ -1933,20 +1933,22 @@ module IBMWatson
1933
1933
  # @param node_type [String] How the dialog node is processed.
1934
1934
  # @param event_name [String] How an `event_handler` node is processed.
1935
1935
  # @param variable [String] The location in the dialog context where output is stored.
1936
+ # @param actions [Array[DialogNodeAction]] An array of objects describing any actions to be invoked by the dialog node.
1936
1937
  # @param digress_in [String] Whether this top-level dialog node can be digressed into.
1937
1938
  # @param digress_out [String] Whether this dialog node can be returned to after a digression.
1938
1939
  # @param digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
1939
1940
  # @param user_label [String] A label that can be displayed externally to describe the purpose of the node to
1940
1941
  # users. This string must be no longer than 512 characters.
1941
1942
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1942
- def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, actions: nil, title: nil, node_type: nil, event_name: nil, variable: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1943
+ def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, node_type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1943
1944
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1944
1945
 
1945
1946
  raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
1946
1947
 
1947
1948
  headers = {
1948
1949
  }
1949
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "create_dialog_node")
1950
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_dialog_node")
1951
+ headers.merge!(sdk_headers)
1950
1952
 
1951
1953
  params = {
1952
1954
  "version" => @version
@@ -1962,11 +1964,11 @@ module IBMWatson
1962
1964
  "context" => context,
1963
1965
  "metadata" => metadata,
1964
1966
  "next_step" => next_step,
1965
- "actions" => actions,
1966
1967
  "title" => title,
1967
1968
  "type" => node_type,
1968
1969
  "event_name" => event_name,
1969
1970
  "variable" => variable,
1971
+ "actions" => actions,
1970
1972
  "digress_in" => digress_in,
1971
1973
  "digress_out" => digress_out,
1972
1974
  "digress_out_slots" => digress_out_slots,
@@ -1986,6 +1988,42 @@ module IBMWatson
1986
1988
  response
1987
1989
  end
1988
1990
 
1991
+ ##
1992
+ # @!method delete_dialog_node(workspace_id:, dialog_node:)
1993
+ # Delete dialog node.
1994
+ # Delete a dialog node from a workspace.
1995
+ #
1996
+ # This operation is limited to 500 requests per 30 minutes. For more information,
1997
+ # see **Rate limiting**.
1998
+ # @param workspace_id [String] Unique identifier of the workspace.
1999
+ # @param dialog_node [String] The dialog node ID (for example, `get_order`).
2000
+ # @return [nil]
2001
+ def delete_dialog_node(workspace_id:, dialog_node:)
2002
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2003
+
2004
+ raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
2005
+
2006
+ headers = {
2007
+ }
2008
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_dialog_node")
2009
+ headers.merge!(sdk_headers)
2010
+
2011
+ params = {
2012
+ "version" => @version
2013
+ }
2014
+
2015
+ method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
2016
+
2017
+ request(
2018
+ method: "DELETE",
2019
+ url: method_url,
2020
+ headers: headers,
2021
+ params: params,
2022
+ accept_json: true
2023
+ )
2024
+ nil
2025
+ end
2026
+
1989
2027
  ##
1990
2028
  # @!method get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
1991
2029
  # Get dialog node.
@@ -2005,7 +2043,8 @@ module IBMWatson
2005
2043
 
2006
2044
  headers = {
2007
2045
  }
2008
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "get_dialog_node")
2046
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "get_dialog_node")
2047
+ headers.merge!(sdk_headers)
2009
2048
 
2010
2049
  params = {
2011
2050
  "version" => @version,
@@ -2025,7 +2064,52 @@ module IBMWatson
2025
2064
  end
2026
2065
 
2027
2066
  ##
2028
- # @!method update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2067
+ # @!method list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
2068
+ # List dialog nodes.
2069
+ # List the dialog nodes for a workspace.
2070
+ #
2071
+ # This operation is limited to 2500 requests per 30 minutes. For more information,
2072
+ # see **Rate limiting**.
2073
+ # @param workspace_id [String] Unique identifier of the workspace.
2074
+ # @param page_limit [Fixnum] The number of records to return in each page of results.
2075
+ # @param include_count [Boolean] Whether to include information about the number of records returned.
2076
+ # @param sort [String] The attribute by which returned dialog nodes will be sorted. To reverse the sort
2077
+ # order, prefix the value with a minus sign (`-`).
2078
+ # @param cursor [String] A token identifying the page of results to retrieve.
2079
+ # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
2080
+ # the response.
2081
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2082
+ def list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
2083
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2084
+
2085
+ headers = {
2086
+ }
2087
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_dialog_nodes")
2088
+ headers.merge!(sdk_headers)
2089
+
2090
+ params = {
2091
+ "version" => @version,
2092
+ "page_limit" => page_limit,
2093
+ "include_count" => include_count,
2094
+ "sort" => sort,
2095
+ "cursor" => cursor,
2096
+ "include_audit" => include_audit
2097
+ }
2098
+
2099
+ method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
2100
+
2101
+ response = request(
2102
+ method: "GET",
2103
+ url: method_url,
2104
+ headers: headers,
2105
+ params: params,
2106
+ accept_json: true
2107
+ )
2108
+ response
2109
+ end
2110
+
2111
+ ##
2112
+ # @!method update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_node_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2029
2113
  # Update dialog node.
2030
2114
  # Update an existing dialog node with new or modified data.
2031
2115
  #
@@ -2042,20 +2126,22 @@ module IBMWatson
2042
2126
  # @param new_conditions [String] The condition that will trigger the dialog node. This string cannot contain
2043
2127
  # carriage return, newline, or tab characters, and it must be no longer than 2048
2044
2128
  # characters.
2045
- # @param new_parent [String] The ID of the parent dialog node.
2046
- # @param new_previous_sibling [String] The ID of the previous sibling dialog node.
2129
+ # @param new_parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
2130
+ # no parent.
2131
+ # @param new_previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
2132
+ # node has no previous sibling.
2047
2133
  # @param new_output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
2048
2134
  # node output, see the
2049
- # [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#complex).
2050
- # @param new_context [Object] The context for the dialog node.
2051
- # @param new_metadata [Object] The metadata for the dialog node.
2135
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/dialog-overview.html#dialog-overview-responses).
2136
+ # @param new_context [Hash] The context for the dialog node.
2137
+ # @param new_metadata [Hash] The metadata for the dialog node.
2052
2138
  # @param new_next_step [DialogNodeNextStep] The next step to execute following this dialog node.
2053
2139
  # @param new_title [String] The alias used to identify the dialog node. This string must conform to the
2054
2140
  # following restrictions:
2055
2141
  # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
2056
2142
  # characters.
2057
2143
  # - It must be no longer than 64 characters.
2058
- # @param new_type [String] How the dialog node is processed.
2144
+ # @param new_node_type [String] How the dialog node is processed.
2059
2145
  # @param new_event_name [String] How an `event_handler` node is processed.
2060
2146
  # @param new_variable [String] The location in the dialog context where output is stored.
2061
2147
  # @param new_actions [Array[DialogNodeAction]] An array of objects describing any actions to be invoked by the dialog node.
@@ -2065,14 +2151,15 @@ module IBMWatson
2065
2151
  # @param new_user_label [String] A label that can be displayed externally to describe the purpose of the node to
2066
2152
  # users. This string must be no longer than 512 characters.
2067
2153
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2068
- def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2154
+ def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_node_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2069
2155
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2070
2156
 
2071
2157
  raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
2072
2158
 
2073
2159
  headers = {
2074
2160
  }
2075
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "update_dialog_node")
2161
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "update_dialog_node")
2162
+ headers.merge!(sdk_headers)
2076
2163
 
2077
2164
  params = {
2078
2165
  "version" => @version
@@ -2089,7 +2176,7 @@ module IBMWatson
2089
2176
  "metadata" => new_metadata,
2090
2177
  "next_step" => new_next_step,
2091
2178
  "title" => new_title,
2092
- "type" => new_type,
2179
+ "type" => new_node_type,
2093
2180
  "event_name" => new_event_name,
2094
2181
  "variable" => new_variable,
2095
2182
  "actions" => new_actions,
@@ -2111,78 +2198,45 @@ module IBMWatson
2111
2198
  )
2112
2199
  response
2113
2200
  end
2114
-
2115
- ##
2116
- # @!method delete_dialog_node(workspace_id:, dialog_node:)
2117
- # Delete dialog node.
2118
- # Delete a dialog node from a workspace.
2119
- #
2120
- # This operation is limited to 500 requests per 30 minutes. For more information,
2121
- # see **Rate limiting**.
2122
- # @param workspace_id [String] Unique identifier of the workspace.
2123
- # @param dialog_node [String] The dialog node ID (for example, `get_order`).
2124
- # @return [nil]
2125
- def delete_dialog_node(workspace_id:, dialog_node:)
2126
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2127
-
2128
- raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
2129
-
2130
- headers = {
2131
- }
2132
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_dialog_node")
2133
-
2134
- params = {
2135
- "version" => @version
2136
- }
2137
-
2138
- method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
2139
-
2140
- request(
2141
- method: "DELETE",
2142
- url: method_url,
2143
- headers: headers,
2144
- params: params,
2145
- accept_json: true
2146
- )
2147
- nil
2148
- end
2149
2201
  #########################
2150
2202
  # Logs
2151
2203
  #########################
2152
2204
 
2153
2205
  ##
2154
- # @!method list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
2155
- # List log events in a workspace.
2156
- # List the events from the log of a specific workspace.
2206
+ # @!method list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
2207
+ # List log events in all workspaces.
2208
+ # List the events from the logs of all workspaces in the service instance.
2157
2209
  #
2158
2210
  # If **cursor** is not specified, this operation is limited to 40 requests per 30
2159
2211
  # minutes. If **cursor** is specified, the limit is 120 requests per minute. For
2160
2212
  # more information, see **Rate limiting**.
2161
- # @param workspace_id [String] Unique identifier of the workspace.
2213
+ # @param filter [String] A cacheable parameter that limits the results to those matching the specified
2214
+ # filter. You must specify a filter query that includes a value for `language`, as
2215
+ # well as a value for `workspace_id` or `request.context.metadata.deployment`. For
2216
+ # more information, see the
2217
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-reference-syntax).
2162
2218
  # @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
2163
2219
  # reverse the sort order, prefix the parameter value with a minus sign (`-`).
2164
- # @param filter [String] A cacheable parameter that limits the results to those matching the specified
2165
- # filter. For more information, see the
2166
- # [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-query-syntax).
2167
2220
  # @param page_limit [Fixnum] The number of records to return in each page of results.
2168
2221
  # @param cursor [String] A token identifying the page of results to retrieve.
2169
2222
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2170
- def list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
2171
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2223
+ def list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
2224
+ raise ArgumentError.new("filter must be provided") if filter.nil?
2172
2225
 
2173
2226
  headers = {
2174
2227
  }
2175
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_logs")
2228
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_all_logs")
2229
+ headers.merge!(sdk_headers)
2176
2230
 
2177
2231
  params = {
2178
2232
  "version" => @version,
2179
- "sort" => sort,
2180
2233
  "filter" => filter,
2234
+ "sort" => sort,
2181
2235
  "page_limit" => page_limit,
2182
2236
  "cursor" => cursor
2183
2237
  }
2184
2238
 
2185
- method_url = "/v1/workspaces/%s/logs" % [ERB::Util.url_encode(workspace_id)]
2239
+ method_url = "/v1/logs"
2186
2240
 
2187
2241
  response = request(
2188
2242
  method: "GET",
@@ -2195,39 +2249,39 @@ module IBMWatson
2195
2249
  end
2196
2250
 
2197
2251
  ##
2198
- # @!method list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
2199
- # List log events in all workspaces.
2200
- # List the events from the logs of all workspaces in the service instance.
2252
+ # @!method list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
2253
+ # List log events in a workspace.
2254
+ # List the events from the log of a specific workspace.
2201
2255
  #
2202
2256
  # If **cursor** is not specified, this operation is limited to 40 requests per 30
2203
2257
  # minutes. If **cursor** is specified, the limit is 120 requests per minute. For
2204
2258
  # more information, see **Rate limiting**.
2205
- # @param filter [String] A cacheable parameter that limits the results to those matching the specified
2206
- # filter. You must specify a filter query that includes a value for `language`, as
2207
- # well as a value for `workspace_id` or `request.context.metadata.deployment`. For
2208
- # more information, see the
2209
- # [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-query-syntax).
2259
+ # @param workspace_id [String] Unique identifier of the workspace.
2210
2260
  # @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
2211
2261
  # reverse the sort order, prefix the parameter value with a minus sign (`-`).
2262
+ # @param filter [String] A cacheable parameter that limits the results to those matching the specified
2263
+ # filter. For more information, see the
2264
+ # [documentation](https://cloud.ibm.com/docs/services/assistant/filter-reference.html#filter-reference-syntax).
2212
2265
  # @param page_limit [Fixnum] The number of records to return in each page of results.
2213
2266
  # @param cursor [String] A token identifying the page of results to retrieve.
2214
2267
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2215
- def list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
2216
- raise ArgumentError.new("filter must be provided") if filter.nil?
2268
+ def list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
2269
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2217
2270
 
2218
2271
  headers = {
2219
2272
  }
2220
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "list_all_logs")
2273
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "list_logs")
2274
+ headers.merge!(sdk_headers)
2221
2275
 
2222
2276
  params = {
2223
2277
  "version" => @version,
2224
- "filter" => filter,
2225
2278
  "sort" => sort,
2279
+ "filter" => filter,
2226
2280
  "page_limit" => page_limit,
2227
2281
  "cursor" => cursor
2228
2282
  }
2229
2283
 
2230
- method_url = "/v1/logs"
2284
+ method_url = "/v1/workspaces/%s/logs" % [ERB::Util.url_encode(workspace_id)]
2231
2285
 
2232
2286
  response = request(
2233
2287
  method: "GET",
@@ -2259,7 +2313,8 @@ module IBMWatson
2259
2313
 
2260
2314
  headers = {
2261
2315
  }
2262
- headers = Common.new.get_sdk_headers(headers: headers, service_name: "conversation", service_version: "V1", operation_id: "delete_user_data")
2316
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "delete_user_data")
2317
+ headers.merge!(sdk_headers)
2263
2318
 
2264
2319
  params = {
2265
2320
  "version" => @version,