ibm_watson 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2339230f5cc6e45ede3db381b47265019e10fee0cb9147b0a5fc6e6f4bb216ff
4
- data.tar.gz: 313d1675f687555eca475a7ad1e072b44c40fcee95f4c3efa0286ca9c027e4f9
3
+ metadata.gz: 43dff6c6d57f43207b327503a557e87744ba951da5b1027c1a7d2a7648397cf8
4
+ data.tar.gz: 8f61cc4482ff4c611603c1ecfa9c2b33bc725d2540674d4ea35df3b448c49f22
5
5
  SHA512:
6
- metadata.gz: 7826f822275d6e8f0806ad3f78a00801482d33bd2dff674f9e29512abdd4104fc6cc567fd3fd909b40a089819e96bdae987036685655267e07e53d9db69c6a14
7
- data.tar.gz: 3017550a16f71a9a772b1f07a70643ddfbc72077ef37c7abea729bdf48b6088b552ffcc6b80be81fb8e569706a82b0812b66f70ab0b1074316947610c6bed301
6
+ metadata.gz: 03ca644a872301a195f429c410b19401ce68fc6503145da8362f1e8a4d07f09404c748de5bd15decd750c0ac3a5b85fd9c9c1a9e184bb0efff02e01c5d5df9c6
7
+ data.tar.gz: 262432903b74bba5abe80671e9646a8064824077c4114d5d3cd9148f9fb014e77e98f508aa9247890cb328cc855c9a501fe7727d887f7330987b130ba43076e3
data/lib/ibm_watson.rb CHANGED
@@ -13,5 +13,6 @@ module IBMWatson
13
13
  require_relative("./ibm_watson/visual_recognition_v3.rb")
14
14
  require_relative("./ibm_watson/natural_language_classifier_v1.rb")
15
15
  require_relative("./ibm_watson/language_translator_v3.rb")
16
+ require_relative("./ibm_watson/compare_comply_v1.rb")
16
17
  require_relative("./ibm_watson/websocket/recognize_callback.rb")
17
18
  end
@@ -91,35 +91,37 @@ module IBMWatson
91
91
  ##
92
92
  # @!method message(workspace_id:, input: nil, alternate_intents: nil, context: nil, entities: nil, intents: nil, output: nil, nodes_visited_details: nil)
93
93
  # Get response to user input.
94
- # Get a response to a user's input.
94
+ # Send user input to a workspace and receive a response.
95
95
  #
96
96
  # There is no rate limit for this operation.
97
97
  # @param workspace_id [String] Unique identifier of the workspace.
98
- # @param input [InputData] An input object that includes the input text.
98
+ # @param input [InputData] The user input.
99
99
  # @param alternate_intents [Boolean] Whether to return more than one intent. Set to `true` to return all matching
100
100
  # intents.
101
- # @param context [Context] State information for the conversation. Continue a conversation by including the
102
- # context object from the previous response.
101
+ # @param context [Context] State information for the conversation. To maintain state, include the context
102
+ # from the previous response.
103
103
  # @param entities [Array[RuntimeEntity]] Entities to use when evaluating the message. Include entities from the previous
104
104
  # response to continue using those entities rather than detecting entities in the
105
105
  # new input.
106
106
  # @param intents [Array[RuntimeIntent]] Intents to use when evaluating the user input. Include intents from the previous
107
107
  # response to continue using those intents rather than trying to recognize intents
108
108
  # in the new input.
109
- # @param output [OutputData] System output. Include the output from the previous response to maintain
110
- # intermediate information over multiple requests.
109
+ # @param output [OutputData] An output object that includes the response to the user, the dialog nodes that
110
+ # were triggered, and messages from the log.
111
111
  # @param nodes_visited_details [Boolean] Whether to include additional diagnostic information about the dialog nodes that
112
112
  # were visited during processing of the message.
113
113
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
114
114
  def message(workspace_id:, input: nil, alternate_intents: nil, context: nil, entities: nil, intents: nil, output: nil, nodes_visited_details: nil)
115
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
115
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
116
116
 
117
117
  headers = {
118
118
  }
119
+
119
120
  params = {
120
121
  "version" => @version,
121
122
  "nodes_visited_details" => nodes_visited_details
122
123
  }
124
+
123
125
  data = {
124
126
  "input" => input,
125
127
  "alternate_intents" => alternate_intents,
@@ -128,7 +130,9 @@ module IBMWatson
128
130
  "intents" => intents,
129
131
  "output" => output
130
132
  }
133
+
131
134
  method_url = "/v1/workspaces/%s/message" % [ERB::Util.url_encode(workspace_id)]
135
+
132
136
  response = request(
133
137
  method: "POST",
134
138
  url: method_url,
@@ -152,8 +156,8 @@ module IBMWatson
152
156
  # see **Rate limiting**.
153
157
  # @param page_limit [Fixnum] The number of records to return in each page of results.
154
158
  # @param include_count [Boolean] Whether to include information about the number of records returned.
155
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
156
- # prefix the value with a minus sign (`-`).
159
+ # @param sort [String] The attribute by which returned workspaces will be sorted. To reverse the sort
160
+ # order, prefix the value with a minus sign (`-`).
157
161
  # @param cursor [String] A token identifying the page of results to retrieve.
158
162
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
159
163
  # the response.
@@ -161,6 +165,7 @@ module IBMWatson
161
165
  def list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
162
166
  headers = {
163
167
  }
168
+
164
169
  params = {
165
170
  "version" => @version,
166
171
  "page_limit" => page_limit,
@@ -169,7 +174,9 @@ module IBMWatson
169
174
  "cursor" => cursor,
170
175
  "include_audit" => include_audit
171
176
  }
177
+
172
178
  method_url = "/v1/workspaces"
179
+
173
180
  response = request(
174
181
  method: "GET",
175
182
  url: method_url,
@@ -195,7 +202,7 @@ module IBMWatson
195
202
  # @param language [String] The language of the workspace.
196
203
  # @param intents [Array[CreateIntent]] An array of objects defining the intents for the workspace.
197
204
  # @param entities [Array[CreateEntity]] An array of objects defining the entities for the workspace.
198
- # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the workspace dialog.
205
+ # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the dialog.
199
206
  # @param counterexamples [Array[CreateCounterexample]] An array of objects defining input examples that have been marked as irrelevant
200
207
  # input.
201
208
  # @param metadata [Object] Any metadata related to the workspace.
@@ -206,9 +213,11 @@ module IBMWatson
206
213
  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)
207
214
  headers = {
208
215
  }
216
+
209
217
  params = {
210
218
  "version" => @version
211
219
  }
220
+
212
221
  data = {
213
222
  "name" => name,
214
223
  "description" => description,
@@ -221,7 +230,9 @@ module IBMWatson
221
230
  "learning_opt_out" => learning_opt_out,
222
231
  "system_settings" => system_settings
223
232
  }
233
+
224
234
  method_url = "/v1/workspaces"
235
+
225
236
  response = request(
226
237
  method: "POST",
227
238
  url: method_url,
@@ -234,7 +245,7 @@ module IBMWatson
234
245
  end
235
246
 
236
247
  ##
237
- # @!method get_workspace(workspace_id:, export: nil, include_audit: nil)
248
+ # @!method get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
238
249
  # Get information about a workspace.
239
250
  # Get information about a workspace, optionally including all workspace content.
240
251
  #
@@ -247,18 +258,25 @@ module IBMWatson
247
258
  # itself. If **export**=`true`, all content, including subelements, is included.
248
259
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
249
260
  # the response.
261
+ # @param sort [String] Indicates how the returned workspace data will be sorted. This parameter is valid
262
+ # only if **export**=`true`. Specify `sort=stable` to sort all workspace objects by
263
+ # unique identifier, in ascending alphabetical order.
250
264
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
251
- def get_workspace(workspace_id:, export: nil, include_audit: nil)
252
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
265
+ def get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
266
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
253
267
 
254
268
  headers = {
255
269
  }
270
+
256
271
  params = {
257
272
  "version" => @version,
258
273
  "export" => export,
259
- "include_audit" => include_audit
274
+ "include_audit" => include_audit,
275
+ "sort" => sort
260
276
  }
277
+
261
278
  method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
279
+
262
280
  response = request(
263
281
  method: "GET",
264
282
  url: method_url,
@@ -285,7 +303,7 @@ module IBMWatson
285
303
  # @param language [String] The language of the workspace.
286
304
  # @param intents [Array[CreateIntent]] An array of objects defining the intents for the workspace.
287
305
  # @param entities [Array[CreateEntity]] An array of objects defining the entities for the workspace.
288
- # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the workspace dialog.
306
+ # @param dialog_nodes [Array[CreateDialogNode]] An array of objects defining the nodes in the dialog.
289
307
  # @param counterexamples [Array[CreateCounterexample]] An array of objects defining input examples that have been marked as irrelevant
290
308
  # input.
291
309
  # @param metadata [Object] Any metadata related to the workspace.
@@ -303,14 +321,16 @@ module IBMWatson
303
321
  # request fails.
304
322
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
305
323
  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)
306
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
324
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
307
325
 
308
326
  headers = {
309
327
  }
328
+
310
329
  params = {
311
330
  "version" => @version,
312
331
  "append" => append
313
332
  }
333
+
314
334
  data = {
315
335
  "name" => name,
316
336
  "description" => description,
@@ -323,7 +343,9 @@ module IBMWatson
323
343
  "learning_opt_out" => learning_opt_out,
324
344
  "system_settings" => system_settings
325
345
  }
346
+
326
347
  method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
348
+
327
349
  response = request(
328
350
  method: "POST",
329
351
  url: method_url,
@@ -345,14 +367,17 @@ module IBMWatson
345
367
  # @param workspace_id [String] Unique identifier of the workspace.
346
368
  # @return [nil]
347
369
  def delete_workspace(workspace_id:)
348
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
370
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
349
371
 
350
372
  headers = {
351
373
  }
374
+
352
375
  params = {
353
376
  "version" => @version
354
377
  }
378
+
355
379
  method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
380
+
356
381
  request(
357
382
  method: "DELETE",
358
383
  url: method_url,
@@ -380,17 +405,18 @@ module IBMWatson
380
405
  # itself. If **export**=`true`, all content, including subelements, is included.
381
406
  # @param page_limit [Fixnum] The number of records to return in each page of results.
382
407
  # @param include_count [Boolean] Whether to include information about the number of records returned.
383
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
408
+ # @param sort [String] The attribute by which returned intents will be sorted. To reverse the sort order,
384
409
  # prefix the value with a minus sign (`-`).
385
410
  # @param cursor [String] A token identifying the page of results to retrieve.
386
411
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
387
412
  # the response.
388
413
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
389
414
  def list_intents(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
390
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
415
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
391
416
 
392
417
  headers = {
393
418
  }
419
+
394
420
  params = {
395
421
  "version" => @version,
396
422
  "export" => export,
@@ -400,7 +426,9 @@ module IBMWatson
400
426
  "cursor" => cursor,
401
427
  "include_audit" => include_audit
402
428
  }
429
+
403
430
  method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
431
+
404
432
  response = request(
405
433
  method: "GET",
406
434
  url: method_url,
@@ -429,21 +457,25 @@ module IBMWatson
429
457
  # @param examples [Array[CreateExample]] An array of user input examples for the intent.
430
458
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
431
459
  def create_intent(workspace_id:, intent:, description: nil, examples: nil)
432
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
460
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
433
461
 
434
- raise ArgumentError("intent must be provided") if intent.nil?
462
+ raise ArgumentError.new("intent must be provided") if intent.nil?
435
463
 
436
464
  headers = {
437
465
  }
466
+
438
467
  params = {
439
468
  "version" => @version
440
469
  }
470
+
441
471
  data = {
442
472
  "intent" => intent,
443
473
  "description" => description,
444
474
  "examples" => examples
445
475
  }
476
+
446
477
  method_url = "/v1/workspaces/%s/intents" % [ERB::Util.url_encode(workspace_id)]
478
+
447
479
  response = request(
448
480
  method: "POST",
449
481
  url: method_url,
@@ -472,18 +504,21 @@ module IBMWatson
472
504
  # the response.
473
505
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
474
506
  def get_intent(workspace_id:, intent:, export: nil, include_audit: nil)
475
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
507
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
476
508
 
477
- raise ArgumentError("intent must be provided") if intent.nil?
509
+ raise ArgumentError.new("intent must be provided") if intent.nil?
478
510
 
479
511
  headers = {
480
512
  }
513
+
481
514
  params = {
482
515
  "version" => @version,
483
516
  "export" => export,
484
517
  "include_audit" => include_audit
485
518
  }
519
+
486
520
  method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
521
+
487
522
  response = request(
488
523
  method: "GET",
489
524
  url: method_url,
@@ -513,21 +548,25 @@ module IBMWatson
513
548
  # @param new_examples [Array[CreateExample]] An array of user input examples for the intent.
514
549
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
515
550
  def update_intent(workspace_id:, intent:, new_intent: nil, new_description: nil, new_examples: nil)
516
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
551
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
517
552
 
518
- raise ArgumentError("intent must be provided") if intent.nil?
553
+ raise ArgumentError.new("intent must be provided") if intent.nil?
519
554
 
520
555
  headers = {
521
556
  }
557
+
522
558
  params = {
523
559
  "version" => @version
524
560
  }
561
+
525
562
  data = {
526
563
  "intent" => new_intent,
527
564
  "description" => new_description,
528
565
  "examples" => new_examples
529
566
  }
567
+
530
568
  method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
569
+
531
570
  response = request(
532
571
  method: "POST",
533
572
  url: method_url,
@@ -550,16 +589,19 @@ module IBMWatson
550
589
  # @param intent [String] The intent name.
551
590
  # @return [nil]
552
591
  def delete_intent(workspace_id:, intent:)
553
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
592
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
554
593
 
555
- raise ArgumentError("intent must be provided") if intent.nil?
594
+ raise ArgumentError.new("intent must be provided") if intent.nil?
556
595
 
557
596
  headers = {
558
597
  }
598
+
559
599
  params = {
560
600
  "version" => @version
561
601
  }
602
+
562
603
  method_url = "/v1/workspaces/%s/intents/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
604
+
563
605
  request(
564
606
  method: "DELETE",
565
607
  url: method_url,
@@ -585,19 +627,20 @@ module IBMWatson
585
627
  # @param intent [String] The intent name.
586
628
  # @param page_limit [Fixnum] The number of records to return in each page of results.
587
629
  # @param include_count [Boolean] Whether to include information about the number of records returned.
588
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
589
- # prefix the value with a minus sign (`-`).
630
+ # @param sort [String] The attribute by which returned examples will be sorted. To reverse the sort
631
+ # order, prefix the value with a minus sign (`-`).
590
632
  # @param cursor [String] A token identifying the page of results to retrieve.
591
633
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
592
634
  # the response.
593
635
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
594
636
  def list_examples(workspace_id:, intent:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
595
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
637
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
596
638
 
597
- raise ArgumentError("intent must be provided") if intent.nil?
639
+ raise ArgumentError.new("intent must be provided") if intent.nil?
598
640
 
599
641
  headers = {
600
642
  }
643
+
601
644
  params = {
602
645
  "version" => @version,
603
646
  "page_limit" => page_limit,
@@ -606,7 +649,9 @@ module IBMWatson
606
649
  "cursor" => cursor,
607
650
  "include_audit" => include_audit
608
651
  }
652
+
609
653
  method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
654
+
610
655
  response = request(
611
656
  method: "GET",
612
657
  url: method_url,
@@ -634,22 +679,26 @@ module IBMWatson
634
679
  # @param mentions [Array[Mentions]] An array of contextual entity mentions.
635
680
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
636
681
  def create_example(workspace_id:, intent:, text:, mentions: nil)
637
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
682
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
638
683
 
639
- raise ArgumentError("intent must be provided") if intent.nil?
684
+ raise ArgumentError.new("intent must be provided") if intent.nil?
640
685
 
641
- raise ArgumentError("text must be provided") if text.nil?
686
+ raise ArgumentError.new("text must be provided") if text.nil?
642
687
 
643
688
  headers = {
644
689
  }
690
+
645
691
  params = {
646
692
  "version" => @version
647
693
  }
694
+
648
695
  data = {
649
696
  "text" => text,
650
697
  "mentions" => mentions
651
698
  }
699
+
652
700
  method_url = "/v1/workspaces/%s/intents/%s/examples" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(intent)]
701
+
653
702
  response = request(
654
703
  method: "POST",
655
704
  url: method_url,
@@ -675,19 +724,22 @@ module IBMWatson
675
724
  # the response.
676
725
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
677
726
  def get_example(workspace_id:, intent:, text:, include_audit: nil)
678
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
727
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
679
728
 
680
- raise ArgumentError("intent must be provided") if intent.nil?
729
+ raise ArgumentError.new("intent must be provided") if intent.nil?
681
730
 
682
- raise ArgumentError("text must be provided") if text.nil?
731
+ raise ArgumentError.new("text must be provided") if text.nil?
683
732
 
684
733
  headers = {
685
734
  }
735
+
686
736
  params = {
687
737
  "version" => @version,
688
738
  "include_audit" => include_audit
689
739
  }
740
+
690
741
  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)]
742
+
691
743
  response = request(
692
744
  method: "GET",
693
745
  url: method_url,
@@ -716,22 +768,26 @@ module IBMWatson
716
768
  # @param new_mentions [Array[Mentions]] An array of contextual entity mentions.
717
769
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
718
770
  def update_example(workspace_id:, intent:, text:, new_text: nil, new_mentions: nil)
719
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
771
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
720
772
 
721
- raise ArgumentError("intent must be provided") if intent.nil?
773
+ raise ArgumentError.new("intent must be provided") if intent.nil?
722
774
 
723
- raise ArgumentError("text must be provided") if text.nil?
775
+ raise ArgumentError.new("text must be provided") if text.nil?
724
776
 
725
777
  headers = {
726
778
  }
779
+
727
780
  params = {
728
781
  "version" => @version
729
782
  }
783
+
730
784
  data = {
731
785
  "text" => new_text,
732
786
  "mentions" => new_mentions
733
787
  }
788
+
734
789
  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)]
790
+
735
791
  response = request(
736
792
  method: "POST",
737
793
  url: method_url,
@@ -755,18 +811,21 @@ module IBMWatson
755
811
  # @param text [String] The text of the user input example.
756
812
  # @return [nil]
757
813
  def delete_example(workspace_id:, intent:, text:)
758
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
814
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
759
815
 
760
- raise ArgumentError("intent must be provided") if intent.nil?
816
+ raise ArgumentError.new("intent must be provided") if intent.nil?
761
817
 
762
- raise ArgumentError("text must be provided") if text.nil?
818
+ raise ArgumentError.new("text must be provided") if text.nil?
763
819
 
764
820
  headers = {
765
821
  }
822
+
766
823
  params = {
767
824
  "version" => @version
768
825
  }
826
+
769
827
  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)]
828
+
770
829
  request(
771
830
  method: "DELETE",
772
831
  url: method_url,
@@ -791,17 +850,18 @@ module IBMWatson
791
850
  # @param workspace_id [String] Unique identifier of the workspace.
792
851
  # @param page_limit [Fixnum] The number of records to return in each page of results.
793
852
  # @param include_count [Boolean] Whether to include information about the number of records returned.
794
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
795
- # prefix the value with a minus sign (`-`).
853
+ # @param sort [String] The attribute by which returned counterexamples will be sorted. To reverse the
854
+ # sort order, prefix the value with a minus sign (`-`).
796
855
  # @param cursor [String] A token identifying the page of results to retrieve.
797
856
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
798
857
  # the response.
799
858
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
800
859
  def list_counterexamples(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
801
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
860
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
802
861
 
803
862
  headers = {
804
863
  }
864
+
805
865
  params = {
806
866
  "version" => @version,
807
867
  "page_limit" => page_limit,
@@ -810,7 +870,9 @@ module IBMWatson
810
870
  "cursor" => cursor,
811
871
  "include_audit" => include_audit
812
872
  }
873
+
813
874
  method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
875
+
814
876
  response = request(
815
877
  method: "GET",
816
878
  url: method_url,
@@ -837,19 +899,23 @@ module IBMWatson
837
899
  # - It must be no longer than 1024 characters.
838
900
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
839
901
  def create_counterexample(workspace_id:, text:)
840
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
902
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
841
903
 
842
- raise ArgumentError("text must be provided") if text.nil?
904
+ raise ArgumentError.new("text must be provided") if text.nil?
843
905
 
844
906
  headers = {
845
907
  }
908
+
846
909
  params = {
847
910
  "version" => @version
848
911
  }
912
+
849
913
  data = {
850
914
  "text" => text
851
915
  }
916
+
852
917
  method_url = "/v1/workspaces/%s/counterexamples" % [ERB::Util.url_encode(workspace_id)]
918
+
853
919
  response = request(
854
920
  method: "POST",
855
921
  url: method_url,
@@ -875,17 +941,20 @@ module IBMWatson
875
941
  # the response.
876
942
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
877
943
  def get_counterexample(workspace_id:, text:, include_audit: nil)
878
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
944
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
879
945
 
880
- raise ArgumentError("text must be provided") if text.nil?
946
+ raise ArgumentError.new("text must be provided") if text.nil?
881
947
 
882
948
  headers = {
883
949
  }
950
+
884
951
  params = {
885
952
  "version" => @version,
886
953
  "include_audit" => include_audit
887
954
  }
955
+
888
956
  method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
957
+
889
958
  response = request(
890
959
  method: "GET",
891
960
  url: method_url,
@@ -909,19 +978,23 @@ module IBMWatson
909
978
  # @param new_text [String] The text of a user input counterexample.
910
979
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
911
980
  def update_counterexample(workspace_id:, text:, new_text: nil)
912
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
981
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
913
982
 
914
- raise ArgumentError("text must be provided") if text.nil?
983
+ raise ArgumentError.new("text must be provided") if text.nil?
915
984
 
916
985
  headers = {
917
986
  }
987
+
918
988
  params = {
919
989
  "version" => @version
920
990
  }
991
+
921
992
  data = {
922
993
  "text" => new_text
923
994
  }
995
+
924
996
  method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
997
+
925
998
  response = request(
926
999
  method: "POST",
927
1000
  url: method_url,
@@ -945,16 +1018,19 @@ module IBMWatson
945
1018
  # @param text [String] The text of a user input counterexample (for example, `What are you wearing?`).
946
1019
  # @return [nil]
947
1020
  def delete_counterexample(workspace_id:, text:)
948
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1021
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
949
1022
 
950
- raise ArgumentError("text must be provided") if text.nil?
1023
+ raise ArgumentError.new("text must be provided") if text.nil?
951
1024
 
952
1025
  headers = {
953
1026
  }
1027
+
954
1028
  params = {
955
1029
  "version" => @version
956
1030
  }
1031
+
957
1032
  method_url = "/v1/workspaces/%s/counterexamples/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(text)]
1033
+
958
1034
  request(
959
1035
  method: "DELETE",
960
1036
  url: method_url,
@@ -982,17 +1058,18 @@ module IBMWatson
982
1058
  # itself. If **export**=`true`, all content, including subelements, is included.
983
1059
  # @param page_limit [Fixnum] The number of records to return in each page of results.
984
1060
  # @param include_count [Boolean] Whether to include information about the number of records returned.
985
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
986
- # prefix the value with a minus sign (`-`).
1061
+ # @param sort [String] The attribute by which returned entities will be sorted. To reverse the sort
1062
+ # order, prefix the value with a minus sign (`-`).
987
1063
  # @param cursor [String] A token identifying the page of results to retrieve.
988
1064
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
989
1065
  # the response.
990
1066
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
991
1067
  def list_entities(workspace_id:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
992
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1068
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
993
1069
 
994
1070
  headers = {
995
1071
  }
1072
+
996
1073
  params = {
997
1074
  "version" => @version,
998
1075
  "export" => export,
@@ -1002,7 +1079,9 @@ module IBMWatson
1002
1079
  "cursor" => cursor,
1003
1080
  "include_audit" => include_audit
1004
1081
  }
1082
+
1005
1083
  method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
1084
+
1006
1085
  response = request(
1007
1086
  method: "GET",
1008
1087
  url: method_url,
@@ -1016,15 +1095,18 @@ module IBMWatson
1016
1095
  ##
1017
1096
  # @!method create_entity(workspace_id:, entity:, description: nil, metadata: nil, values: nil, fuzzy_match: nil)
1018
1097
  # Create entity.
1019
- # Create a new entity.
1098
+ # Create a new entity, or enable a system entity.
1020
1099
  #
1021
1100
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1022
1101
  # see **Rate limiting**.
1023
1102
  # @param workspace_id [String] Unique identifier of the workspace.
1024
1103
  # @param entity [String] The name of the entity. This string must conform to the following restrictions:
1025
1104
  # - It can contain only Unicode alphanumeric, underscore, and hyphen characters.
1026
- # - It cannot begin with the reserved prefix `sys-`.
1027
1105
  # - It must be no longer than 64 characters.
1106
+ #
1107
+ # If you specify an entity name beginning with the reserved prefix `sys-`, it must
1108
+ # be the name of a system entity that you want to enable. (Any entity content
1109
+ # specified with the request is ignored.).
1028
1110
  # @param description [String] The description of the entity. This string cannot contain carriage return,
1029
1111
  # newline, or tab characters, and it must be no longer than 128 characters.
1030
1112
  # @param metadata [Object] Any metadata related to the value.
@@ -1032,15 +1114,17 @@ module IBMWatson
1032
1114
  # @param fuzzy_match [Boolean] Whether to use fuzzy matching for the entity.
1033
1115
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1034
1116
  def create_entity(workspace_id:, entity:, description: nil, metadata: nil, values: nil, fuzzy_match: nil)
1035
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1117
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1036
1118
 
1037
- raise ArgumentError("entity must be provided") if entity.nil?
1119
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1038
1120
 
1039
1121
  headers = {
1040
1122
  }
1123
+
1041
1124
  params = {
1042
1125
  "version" => @version
1043
1126
  }
1127
+
1044
1128
  data = {
1045
1129
  "entity" => entity,
1046
1130
  "description" => description,
@@ -1048,7 +1132,9 @@ module IBMWatson
1048
1132
  "values" => values,
1049
1133
  "fuzzy_match" => fuzzy_match
1050
1134
  }
1135
+
1051
1136
  method_url = "/v1/workspaces/%s/entities" % [ERB::Util.url_encode(workspace_id)]
1137
+
1052
1138
  response = request(
1053
1139
  method: "POST",
1054
1140
  url: method_url,
@@ -1077,18 +1163,21 @@ module IBMWatson
1077
1163
  # the response.
1078
1164
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1079
1165
  def get_entity(workspace_id:, entity:, export: nil, include_audit: nil)
1080
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1166
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1081
1167
 
1082
- raise ArgumentError("entity must be provided") if entity.nil?
1168
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1083
1169
 
1084
1170
  headers = {
1085
1171
  }
1172
+
1086
1173
  params = {
1087
1174
  "version" => @version,
1088
1175
  "export" => export,
1089
1176
  "include_audit" => include_audit
1090
1177
  }
1178
+
1091
1179
  method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1180
+
1092
1181
  response = request(
1093
1182
  method: "GET",
1094
1183
  url: method_url,
@@ -1120,15 +1209,17 @@ module IBMWatson
1120
1209
  # @param new_values [Array[CreateValue]] An array of entity values.
1121
1210
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1122
1211
  def update_entity(workspace_id:, entity:, new_entity: nil, new_description: nil, new_metadata: nil, new_fuzzy_match: nil, new_values: nil)
1123
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1212
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1124
1213
 
1125
- raise ArgumentError("entity must be provided") if entity.nil?
1214
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1126
1215
 
1127
1216
  headers = {
1128
1217
  }
1218
+
1129
1219
  params = {
1130
1220
  "version" => @version
1131
1221
  }
1222
+
1132
1223
  data = {
1133
1224
  "entity" => new_entity,
1134
1225
  "description" => new_description,
@@ -1136,7 +1227,9 @@ module IBMWatson
1136
1227
  "fuzzy_match" => new_fuzzy_match,
1137
1228
  "values" => new_values
1138
1229
  }
1230
+
1139
1231
  method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1232
+
1140
1233
  response = request(
1141
1234
  method: "POST",
1142
1235
  url: method_url,
@@ -1151,7 +1244,7 @@ module IBMWatson
1151
1244
  ##
1152
1245
  # @!method delete_entity(workspace_id:, entity:)
1153
1246
  # Delete entity.
1154
- # Delete an entity from a workspace.
1247
+ # Delete an entity from a workspace, or disable a system entity.
1155
1248
  #
1156
1249
  # This operation is limited to 1000 requests per 30 minutes. For more information,
1157
1250
  # see **Rate limiting**.
@@ -1159,16 +1252,19 @@ module IBMWatson
1159
1252
  # @param entity [String] The name of the entity.
1160
1253
  # @return [nil]
1161
1254
  def delete_entity(workspace_id:, entity:)
1162
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1255
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1163
1256
 
1164
- raise ArgumentError("entity must be provided") if entity.nil?
1257
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1165
1258
 
1166
1259
  headers = {
1167
1260
  }
1261
+
1168
1262
  params = {
1169
1263
  "version" => @version
1170
1264
  }
1265
+
1171
1266
  method_url = "/v1/workspaces/%s/entities/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1267
+
1172
1268
  request(
1173
1269
  method: "DELETE",
1174
1270
  url: method_url,
@@ -1199,18 +1295,21 @@ module IBMWatson
1199
1295
  # the response.
1200
1296
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1201
1297
  def list_mentions(workspace_id:, entity:, export: nil, include_audit: nil)
1202
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1298
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1203
1299
 
1204
- raise ArgumentError("entity must be provided") if entity.nil?
1300
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1205
1301
 
1206
1302
  headers = {
1207
1303
  }
1304
+
1208
1305
  params = {
1209
1306
  "version" => @version,
1210
1307
  "export" => export,
1211
1308
  "include_audit" => include_audit
1212
1309
  }
1310
+
1213
1311
  method_url = "/v1/workspaces/%s/entities/%s/mentions" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1312
+
1214
1313
  response = request(
1215
1314
  method: "GET",
1216
1315
  url: method_url,
@@ -1238,19 +1337,20 @@ module IBMWatson
1238
1337
  # itself. If **export**=`true`, all content, including subelements, is included.
1239
1338
  # @param page_limit [Fixnum] The number of records to return in each page of results.
1240
1339
  # @param include_count [Boolean] Whether to include information about the number of records returned.
1241
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
1242
- # prefix the value with a minus sign (`-`).
1340
+ # @param sort [String] The attribute by which returned entity values will be sorted. To reverse the sort
1341
+ # order, prefix the value with a minus sign (`-`).
1243
1342
  # @param cursor [String] A token identifying the page of results to retrieve.
1244
1343
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1245
1344
  # the response.
1246
1345
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1247
1346
  def list_values(workspace_id:, entity:, export: nil, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1248
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1347
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1249
1348
 
1250
- raise ArgumentError("entity must be provided") if entity.nil?
1349
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1251
1350
 
1252
1351
  headers = {
1253
1352
  }
1353
+
1254
1354
  params = {
1255
1355
  "version" => @version,
1256
1356
  "export" => export,
@@ -1260,7 +1360,9 @@ module IBMWatson
1260
1360
  "cursor" => cursor,
1261
1361
  "include_audit" => include_audit
1262
1362
  }
1363
+
1263
1364
  method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1365
+
1264
1366
  response = request(
1265
1367
  method: "GET",
1266
1368
  url: method_url,
@@ -1300,17 +1402,19 @@ module IBMWatson
1300
1402
  # @param value_type [String] Specifies the type of value.
1301
1403
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1302
1404
  def create_value(workspace_id:, entity:, value:, metadata: nil, synonyms: nil, patterns: nil, value_type: nil)
1303
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1405
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1304
1406
 
1305
- raise ArgumentError("entity must be provided") if entity.nil?
1407
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1306
1408
 
1307
- raise ArgumentError("value must be provided") if value.nil?
1409
+ raise ArgumentError.new("value must be provided") if value.nil?
1308
1410
 
1309
1411
  headers = {
1310
1412
  }
1413
+
1311
1414
  params = {
1312
1415
  "version" => @version
1313
1416
  }
1417
+
1314
1418
  data = {
1315
1419
  "value" => value,
1316
1420
  "metadata" => metadata,
@@ -1318,7 +1422,9 @@ module IBMWatson
1318
1422
  "patterns" => patterns,
1319
1423
  "type" => value_type
1320
1424
  }
1425
+
1321
1426
  method_url = "/v1/workspaces/%s/entities/%s/values" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(entity)]
1427
+
1322
1428
  response = request(
1323
1429
  method: "POST",
1324
1430
  url: method_url,
@@ -1347,20 +1453,23 @@ module IBMWatson
1347
1453
  # the response.
1348
1454
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1349
1455
  def get_value(workspace_id:, entity:, value:, export: nil, include_audit: nil)
1350
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1456
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1351
1457
 
1352
- raise ArgumentError("entity must be provided") if entity.nil?
1458
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1353
1459
 
1354
- raise ArgumentError("value must be provided") if value.nil?
1460
+ raise ArgumentError.new("value must be provided") if value.nil?
1355
1461
 
1356
1462
  headers = {
1357
1463
  }
1464
+
1358
1465
  params = {
1359
1466
  "version" => @version,
1360
1467
  "export" => export,
1361
1468
  "include_audit" => include_audit
1362
1469
  }
1470
+
1363
1471
  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)]
1472
+
1364
1473
  response = request(
1365
1474
  method: "GET",
1366
1475
  url: method_url,
@@ -1402,17 +1511,19 @@ module IBMWatson
1402
1511
  # [documentation](https://console.bluemix.net/docs/services/conversation/entities.html#creating-entities).
1403
1512
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1404
1513
  def update_value(workspace_id:, entity:, value:, new_value: nil, new_metadata: nil, new_type: nil, new_synonyms: nil, new_patterns: nil)
1405
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1514
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1406
1515
 
1407
- raise ArgumentError("entity must be provided") if entity.nil?
1516
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1408
1517
 
1409
- raise ArgumentError("value must be provided") if value.nil?
1518
+ raise ArgumentError.new("value must be provided") if value.nil?
1410
1519
 
1411
1520
  headers = {
1412
1521
  }
1522
+
1413
1523
  params = {
1414
1524
  "version" => @version
1415
1525
  }
1526
+
1416
1527
  data = {
1417
1528
  "value" => new_value,
1418
1529
  "metadata" => new_metadata,
@@ -1420,7 +1531,9 @@ module IBMWatson
1420
1531
  "synonyms" => new_synonyms,
1421
1532
  "patterns" => new_patterns
1422
1533
  }
1534
+
1423
1535
  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)]
1536
+
1424
1537
  response = request(
1425
1538
  method: "POST",
1426
1539
  url: method_url,
@@ -1444,18 +1557,21 @@ module IBMWatson
1444
1557
  # @param value [String] The text of the entity value.
1445
1558
  # @return [nil]
1446
1559
  def delete_value(workspace_id:, entity:, value:)
1447
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1560
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1448
1561
 
1449
- raise ArgumentError("entity must be provided") if entity.nil?
1562
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1450
1563
 
1451
- raise ArgumentError("value must be provided") if value.nil?
1564
+ raise ArgumentError.new("value must be provided") if value.nil?
1452
1565
 
1453
1566
  headers = {
1454
1567
  }
1568
+
1455
1569
  params = {
1456
1570
  "version" => @version
1457
1571
  }
1572
+
1458
1573
  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)]
1574
+
1459
1575
  request(
1460
1576
  method: "DELETE",
1461
1577
  url: method_url,
@@ -1481,21 +1597,22 @@ module IBMWatson
1481
1597
  # @param value [String] The text of the entity value.
1482
1598
  # @param page_limit [Fixnum] The number of records to return in each page of results.
1483
1599
  # @param include_count [Boolean] Whether to include information about the number of records returned.
1484
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
1485
- # prefix the value with a minus sign (`-`).
1600
+ # @param sort [String] The attribute by which returned entity value synonyms will be sorted. To reverse
1601
+ # the sort order, prefix the value with a minus sign (`-`).
1486
1602
  # @param cursor [String] A token identifying the page of results to retrieve.
1487
1603
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1488
1604
  # the response.
1489
1605
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1490
1606
  def list_synonyms(workspace_id:, entity:, value:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1491
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1607
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1492
1608
 
1493
- raise ArgumentError("entity must be provided") if entity.nil?
1609
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1494
1610
 
1495
- raise ArgumentError("value must be provided") if value.nil?
1611
+ raise ArgumentError.new("value must be provided") if value.nil?
1496
1612
 
1497
1613
  headers = {
1498
1614
  }
1615
+
1499
1616
  params = {
1500
1617
  "version" => @version,
1501
1618
  "page_limit" => page_limit,
@@ -1504,7 +1621,9 @@ module IBMWatson
1504
1621
  "cursor" => cursor,
1505
1622
  "include_audit" => include_audit
1506
1623
  }
1624
+
1507
1625
  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)]
1626
+
1508
1627
  response = request(
1509
1628
  method: "GET",
1510
1629
  url: method_url,
@@ -1531,23 +1650,27 @@ module IBMWatson
1531
1650
  # - It must be no longer than 64 characters.
1532
1651
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1533
1652
  def create_synonym(workspace_id:, entity:, value:, synonym:)
1534
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1653
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1535
1654
 
1536
- raise ArgumentError("entity must be provided") if entity.nil?
1655
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1537
1656
 
1538
- raise ArgumentError("value must be provided") if value.nil?
1657
+ raise ArgumentError.new("value must be provided") if value.nil?
1539
1658
 
1540
- raise ArgumentError("synonym must be provided") if synonym.nil?
1659
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1541
1660
 
1542
1661
  headers = {
1543
1662
  }
1663
+
1544
1664
  params = {
1545
1665
  "version" => @version
1546
1666
  }
1667
+
1547
1668
  data = {
1548
1669
  "synonym" => synonym
1549
1670
  }
1671
+
1550
1672
  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)]
1673
+
1551
1674
  response = request(
1552
1675
  method: "POST",
1553
1676
  url: method_url,
@@ -1574,21 +1697,24 @@ module IBMWatson
1574
1697
  # the response.
1575
1698
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1576
1699
  def get_synonym(workspace_id:, entity:, value:, synonym:, include_audit: nil)
1577
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1700
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1578
1701
 
1579
- raise ArgumentError("entity must be provided") if entity.nil?
1702
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1580
1703
 
1581
- raise ArgumentError("value must be provided") if value.nil?
1704
+ raise ArgumentError.new("value must be provided") if value.nil?
1582
1705
 
1583
- raise ArgumentError("synonym must be provided") if synonym.nil?
1706
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1584
1707
 
1585
1708
  headers = {
1586
1709
  }
1710
+
1587
1711
  params = {
1588
1712
  "version" => @version,
1589
1713
  "include_audit" => include_audit
1590
1714
  }
1715
+
1591
1716
  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)]
1717
+
1592
1718
  response = request(
1593
1719
  method: "GET",
1594
1720
  url: method_url,
@@ -1616,23 +1742,27 @@ module IBMWatson
1616
1742
  # - It must be no longer than 64 characters.
1617
1743
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1618
1744
  def update_synonym(workspace_id:, entity:, value:, synonym:, new_synonym: nil)
1619
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1745
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1620
1746
 
1621
- raise ArgumentError("entity must be provided") if entity.nil?
1747
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1622
1748
 
1623
- raise ArgumentError("value must be provided") if value.nil?
1749
+ raise ArgumentError.new("value must be provided") if value.nil?
1624
1750
 
1625
- raise ArgumentError("synonym must be provided") if synonym.nil?
1751
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1626
1752
 
1627
1753
  headers = {
1628
1754
  }
1755
+
1629
1756
  params = {
1630
1757
  "version" => @version
1631
1758
  }
1759
+
1632
1760
  data = {
1633
1761
  "synonym" => new_synonym
1634
1762
  }
1763
+
1635
1764
  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)]
1765
+
1636
1766
  response = request(
1637
1767
  method: "POST",
1638
1768
  url: method_url,
@@ -1657,20 +1787,23 @@ module IBMWatson
1657
1787
  # @param synonym [String] The text of the synonym.
1658
1788
  # @return [nil]
1659
1789
  def delete_synonym(workspace_id:, entity:, value:, synonym:)
1660
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1790
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1661
1791
 
1662
- raise ArgumentError("entity must be provided") if entity.nil?
1792
+ raise ArgumentError.new("entity must be provided") if entity.nil?
1663
1793
 
1664
- raise ArgumentError("value must be provided") if value.nil?
1794
+ raise ArgumentError.new("value must be provided") if value.nil?
1665
1795
 
1666
- raise ArgumentError("synonym must be provided") if synonym.nil?
1796
+ raise ArgumentError.new("synonym must be provided") if synonym.nil?
1667
1797
 
1668
1798
  headers = {
1669
1799
  }
1800
+
1670
1801
  params = {
1671
1802
  "version" => @version
1672
1803
  }
1804
+
1673
1805
  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)]
1806
+
1674
1807
  request(
1675
1808
  method: "DELETE",
1676
1809
  url: method_url,
@@ -1694,17 +1827,18 @@ module IBMWatson
1694
1827
  # @param workspace_id [String] Unique identifier of the workspace.
1695
1828
  # @param page_limit [Fixnum] The number of records to return in each page of results.
1696
1829
  # @param include_count [Boolean] Whether to include information about the number of records returned.
1697
- # @param sort [String] The attribute by which returned results will be sorted. To reverse the sort order,
1698
- # prefix the value with a minus sign (`-`).
1830
+ # @param sort [String] The attribute by which returned dialog nodes will be sorted. To reverse the sort
1831
+ # order, prefix the value with a minus sign (`-`).
1699
1832
  # @param cursor [String] A token identifying the page of results to retrieve.
1700
1833
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
1701
1834
  # the response.
1702
1835
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1703
1836
  def list_dialog_nodes(workspace_id:, page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
1704
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1837
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1705
1838
 
1706
1839
  headers = {
1707
1840
  }
1841
+
1708
1842
  params = {
1709
1843
  "version" => @version,
1710
1844
  "page_limit" => page_limit,
@@ -1713,7 +1847,9 @@ module IBMWatson
1713
1847
  "cursor" => cursor,
1714
1848
  "include_audit" => include_audit
1715
1849
  }
1850
+
1716
1851
  method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
1852
+
1717
1853
  response = request(
1718
1854
  method: "GET",
1719
1855
  url: method_url,
@@ -1748,7 +1884,7 @@ module IBMWatson
1748
1884
  # [documentation](https://console.bluemix.net/docs/services/conversation/dialog-overview.html#complex).
1749
1885
  # @param context [Object] The context for the dialog node.
1750
1886
  # @param metadata [Object] The metadata for the dialog node.
1751
- # @param next_step [DialogNodeNextStep] The next step to be executed in dialog processing.
1887
+ # @param next_step [DialogNodeNextStep] The next step to execute following this dialog node.
1752
1888
  # @param actions [Array[DialogNodeAction]] An array of objects describing any actions to be invoked by the dialog node.
1753
1889
  # @param title [String] The alias used to identify the dialog node. This string must conform to the
1754
1890
  # following restrictions:
@@ -1765,15 +1901,17 @@ module IBMWatson
1765
1901
  # users. This string must be no longer than 512 characters.
1766
1902
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1767
1903
  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)
1768
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1904
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1769
1905
 
1770
- raise ArgumentError("dialog_node must be provided") if dialog_node.nil?
1906
+ raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
1771
1907
 
1772
1908
  headers = {
1773
1909
  }
1910
+
1774
1911
  params = {
1775
1912
  "version" => @version
1776
1913
  }
1914
+
1777
1915
  data = {
1778
1916
  "dialog_node" => dialog_node,
1779
1917
  "description" => description,
@@ -1794,7 +1932,9 @@ module IBMWatson
1794
1932
  "digress_out_slots" => digress_out_slots,
1795
1933
  "user_label" => user_label
1796
1934
  }
1935
+
1797
1936
  method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
1937
+
1798
1938
  response = request(
1799
1939
  method: "POST",
1800
1940
  url: method_url,
@@ -1819,17 +1959,20 @@ module IBMWatson
1819
1959
  # the response.
1820
1960
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1821
1961
  def get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
1822
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
1962
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1823
1963
 
1824
- raise ArgumentError("dialog_node must be provided") if dialog_node.nil?
1964
+ raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
1825
1965
 
1826
1966
  headers = {
1827
1967
  }
1968
+
1828
1969
  params = {
1829
1970
  "version" => @version,
1830
1971
  "include_audit" => include_audit
1831
1972
  }
1973
+
1832
1974
  method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
1975
+
1833
1976
  response = request(
1834
1977
  method: "GET",
1835
1978
  url: method_url,
@@ -1865,7 +2008,7 @@ module IBMWatson
1865
2008
  # [documentation](https://console.bluemix.net/docs/services/conversation/dialog-overview.html#complex).
1866
2009
  # @param new_context [Object] The context for the dialog node.
1867
2010
  # @param new_metadata [Object] The metadata for the dialog node.
1868
- # @param new_next_step [DialogNodeNextStep] The next step to be executed in dialog processing.
2011
+ # @param new_next_step [DialogNodeNextStep] The next step to execute following this dialog node.
1869
2012
  # @param new_title [String] The alias used to identify the dialog node. This string must conform to the
1870
2013
  # following restrictions:
1871
2014
  # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
@@ -1882,15 +2025,17 @@ module IBMWatson
1882
2025
  # users. This string must be no longer than 512 characters.
1883
2026
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1884
2027
  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)
1885
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
2028
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1886
2029
 
1887
- raise ArgumentError("dialog_node must be provided") if dialog_node.nil?
2030
+ raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
1888
2031
 
1889
2032
  headers = {
1890
2033
  }
2034
+
1891
2035
  params = {
1892
2036
  "version" => @version
1893
2037
  }
2038
+
1894
2039
  data = {
1895
2040
  "dialog_node" => new_dialog_node,
1896
2041
  "description" => new_description,
@@ -1911,7 +2056,9 @@ module IBMWatson
1911
2056
  "digress_out_slots" => new_digress_out_slots,
1912
2057
  "user_label" => new_user_label
1913
2058
  }
2059
+
1914
2060
  method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
2061
+
1915
2062
  response = request(
1916
2063
  method: "POST",
1917
2064
  url: method_url,
@@ -1934,16 +2081,19 @@ module IBMWatson
1934
2081
  # @param dialog_node [String] The dialog node ID (for example, `get_order`).
1935
2082
  # @return [nil]
1936
2083
  def delete_dialog_node(workspace_id:, dialog_node:)
1937
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
2084
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1938
2085
 
1939
- raise ArgumentError("dialog_node must be provided") if dialog_node.nil?
2086
+ raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
1940
2087
 
1941
2088
  headers = {
1942
2089
  }
2090
+
1943
2091
  params = {
1944
2092
  "version" => @version
1945
2093
  }
2094
+
1946
2095
  method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
2096
+
1947
2097
  request(
1948
2098
  method: "DELETE",
1949
2099
  url: method_url,
@@ -1975,10 +2125,11 @@ module IBMWatson
1975
2125
  # @param cursor [String] A token identifying the page of results to retrieve.
1976
2126
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
1977
2127
  def list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
1978
- raise ArgumentError("workspace_id must be provided") if workspace_id.nil?
2128
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
1979
2129
 
1980
2130
  headers = {
1981
2131
  }
2132
+
1982
2133
  params = {
1983
2134
  "version" => @version,
1984
2135
  "sort" => sort,
@@ -1986,7 +2137,9 @@ module IBMWatson
1986
2137
  "page_limit" => page_limit,
1987
2138
  "cursor" => cursor
1988
2139
  }
2140
+
1989
2141
  method_url = "/v1/workspaces/%s/logs" % [ERB::Util.url_encode(workspace_id)]
2142
+
1990
2143
  response = request(
1991
2144
  method: "GET",
1992
2145
  url: method_url,
@@ -2016,10 +2169,11 @@ module IBMWatson
2016
2169
  # @param cursor [String] A token identifying the page of results to retrieve.
2017
2170
  # @return [DetailedResponse] A `DetailedResponse` object representing the response.
2018
2171
  def list_all_logs(filter:, sort: nil, page_limit: nil, cursor: nil)
2019
- raise ArgumentError("filter must be provided") if filter.nil?
2172
+ raise ArgumentError.new("filter must be provided") if filter.nil?
2020
2173
 
2021
2174
  headers = {
2022
2175
  }
2176
+
2023
2177
  params = {
2024
2178
  "version" => @version,
2025
2179
  "filter" => filter,
@@ -2027,7 +2181,9 @@ module IBMWatson
2027
2181
  "page_limit" => page_limit,
2028
2182
  "cursor" => cursor
2029
2183
  }
2184
+
2030
2185
  method_url = "/v1/logs"
2186
+
2031
2187
  response = request(
2032
2188
  method: "GET",
2033
2189
  url: method_url,
@@ -2054,15 +2210,18 @@ module IBMWatson
2054
2210
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2055
2211
  # @return [nil]
2056
2212
  def delete_user_data(customer_id:)
2057
- raise ArgumentError("customer_id must be provided") if customer_id.nil?
2213
+ raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
2058
2214
 
2059
2215
  headers = {
2060
2216
  }
2217
+
2061
2218
  params = {
2062
2219
  "version" => @version,
2063
2220
  "customer_id" => customer_id
2064
2221
  }
2222
+
2065
2223
  method_url = "/v1/user_data"
2224
+
2066
2225
  request(
2067
2226
  method: "DELETE",
2068
2227
  url: method_url,