ibm_watson 1.4.0 → 2.0.1

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -6
  3. data/lib/ibm_watson/assistant_v1.rb +213 -195
  4. data/lib/ibm_watson/assistant_v2.rb +221 -20
  5. data/lib/ibm_watson/compare_comply_v1.rb +35 -21
  6. data/lib/ibm_watson/discovery_v1.rb +132 -13
  7. data/lib/ibm_watson/discovery_v2.rb +734 -21
  8. data/lib/ibm_watson/language_translator_v3.rb +205 -67
  9. data/lib/ibm_watson/natural_language_classifier_v1.rb +4 -2
  10. data/lib/ibm_watson/natural_language_understanding_v1.rb +21 -21
  11. data/lib/ibm_watson/personality_insights_v3.rb +27 -18
  12. data/lib/ibm_watson/speech_to_text_v1.rb +65 -53
  13. data/lib/ibm_watson/text_to_speech_v1.rb +124 -140
  14. data/lib/ibm_watson/tone_analyzer_v3.rb +12 -13
  15. data/lib/ibm_watson/version.rb +1 -1
  16. data/lib/ibm_watson/visual_recognition_v3.rb +33 -16
  17. data/lib/ibm_watson/visual_recognition_v4.rb +103 -17
  18. data/test/integration/test_assistant_v1.rb +9 -0
  19. data/test/integration/test_assistant_v2.rb +34 -0
  20. data/test/integration/test_discovery_v2.rb +132 -6
  21. data/test/integration/test_language_translator_v3.rb +5 -0
  22. data/test/integration/test_text_to_speech_v1.rb +3 -3
  23. data/test/integration/test_visual_recognition_v4.rb +9 -0
  24. data/test/unit/test_assistant_v1.rb +150 -99
  25. data/test/unit/test_assistant_v2.rb +153 -8
  26. data/test/unit/test_compare_comply_v1.rb +20 -20
  27. data/test/unit/test_discovery_v1.rb +125 -125
  28. data/test/unit/test_discovery_v2.rb +262 -29
  29. data/test/unit/test_language_translator_v3.rb +85 -24
  30. data/test/unit/test_natural_language_classifier_v1.rb +17 -17
  31. data/test/unit/test_natural_language_understanding_v1.rb +10 -10
  32. data/test/unit/test_personality_insights_v3.rb +14 -14
  33. data/test/unit/test_speech_to_text_v1.rb +97 -97
  34. data/test/unit/test_text_to_speech_v1.rb +48 -48
  35. data/test/unit/test_tone_analyzer_v3.rb +12 -12
  36. data/test/unit/test_visual_recognition_v3.rb +16 -16
  37. data/test/unit/test_visual_recognition_v4.rb +56 -38
  38. metadata +8 -7
@@ -13,7 +13,9 @@
13
13
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
-
16
+ #
17
+ # IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
18
+ #
17
19
  # IBM Watson™ Discovery is a cognitive search and content analytics engine that
18
20
  # you can add to applications to identify patterns, trends and actionable insights to
19
21
  # drive better decision-making. Securely unify structured and unstructured data with
@@ -33,22 +35,15 @@ module IBMWatson
33
35
  class DiscoveryV1 < IBMCloudSdkCore::BaseService
34
36
  include Concurrent::Async
35
37
  DEFAULT_SERVICE_NAME = "discovery"
36
- DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/discovery/api"
38
+ DEFAULT_SERVICE_URL = "https://api.us-south.discovery.watson.cloud.ibm.com"
39
+ attr_accessor :version
37
40
  ##
38
41
  # @!method initialize(args)
39
42
  # Construct a new client for the Discovery service.
40
43
  #
41
44
  # @param args [Hash] The args to initialize with
42
- # @option args version [String] The API version date to use with the service, in
43
- # "YYYY-MM-DD" format. Whenever the API is changed in a backwards
44
- # incompatible way, a new minor version of the API is released.
45
- # The service uses the API version for the date you specify, or
46
- # the most recent version before that date. Note that you should
47
- # not programmatically specify the current date at runtime, in
48
- # case the API has been updated since your application's release.
49
- # Instead, specify a version date that is compatible with your
50
- # application, and don't change it until your application is
51
- # ready for a later version.
45
+ # @option args version [String] Release date of the version of the API you want to use. Specify dates in
46
+ # YYYY-MM-DD format. The current version is `2019-04-30`.
52
47
  # @option args service_url [String] The base service URL to use when contacting the service.
53
48
  # The base service_url may differ between IBM Cloud regions.
54
49
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
@@ -57,10 +52,10 @@ module IBMWatson
57
52
  def initialize(args = {})
58
53
  @__async_initialized__ = false
59
54
  defaults = {}
60
- defaults[:version] = nil
61
55
  defaults[:service_url] = DEFAULT_SERVICE_URL
62
56
  defaults[:service_name] = DEFAULT_SERVICE_NAME
63
57
  defaults[:authenticator] = nil
58
+ defaults[:version] = nil
64
59
  user_service_url = args[:service_url] unless args[:service_url].nil?
65
60
  args = defaults.merge(args)
66
61
  @version = args[:version]
@@ -89,6 +84,8 @@ module IBMWatson
89
84
  # `LT`, in all other plans the default is `S`.
90
85
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
91
86
  def create_environment(name:, description: nil, size: nil)
87
+ raise ArgumentError.new("version must be provided") if version.nil?
88
+
92
89
  raise ArgumentError.new("name must be provided") if name.nil?
93
90
 
94
91
  headers = {
@@ -126,6 +123,8 @@ module IBMWatson
126
123
  # @param name [String] Show only the environment with the given name.
127
124
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
128
125
  def list_environments(name: nil)
126
+ raise ArgumentError.new("version must be provided") if version.nil?
127
+
129
128
  headers = {
130
129
  }
131
130
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "list_environments")
@@ -154,6 +153,8 @@ module IBMWatson
154
153
  # @param environment_id [String] The ID of the environment.
155
154
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
156
155
  def get_environment(environment_id:)
156
+ raise ArgumentError.new("version must be provided") if version.nil?
157
+
157
158
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
158
159
 
159
160
  headers = {
@@ -190,6 +191,8 @@ module IBMWatson
190
191
  # decreased.
191
192
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
192
193
  def update_environment(environment_id:, name: nil, description: nil, size: nil)
194
+ raise ArgumentError.new("version must be provided") if version.nil?
195
+
193
196
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
194
197
 
195
198
  headers = {
@@ -226,6 +229,8 @@ module IBMWatson
226
229
  # @param environment_id [String] The ID of the environment.
227
230
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
228
231
  def delete_environment(environment_id:)
232
+ raise ArgumentError.new("version must be provided") if version.nil?
233
+
229
234
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
230
235
 
231
236
  headers = {
@@ -258,6 +263,8 @@ module IBMWatson
258
263
  # @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
259
264
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
260
265
  def list_fields(environment_id:, collection_ids:)
266
+ raise ArgumentError.new("version must be provided") if version.nil?
267
+
261
268
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
262
269
 
263
270
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -314,6 +321,8 @@ module IBMWatson
314
321
  # @param source [Source] Object containing source parameters for the configuration.
315
322
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
316
323
  def create_configuration(environment_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
324
+ raise ArgumentError.new("version must be provided") if version.nil?
325
+
317
326
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
318
327
 
319
328
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -357,6 +366,8 @@ module IBMWatson
357
366
  # @param name [String] Find configurations with the given name.
358
367
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
359
368
  def list_configurations(environment_id:, name: nil)
369
+ raise ArgumentError.new("version must be provided") if version.nil?
370
+
360
371
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
361
372
 
362
373
  headers = {
@@ -388,6 +399,8 @@ module IBMWatson
388
399
  # @param configuration_id [String] The ID of the configuration.
389
400
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
390
401
  def get_configuration(environment_id:, configuration_id:)
402
+ raise ArgumentError.new("version must be provided") if version.nil?
403
+
391
404
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
392
405
 
393
406
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -437,6 +450,8 @@ module IBMWatson
437
450
  # @param source [Source] Object containing source parameters for the configuration.
438
451
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
439
452
  def update_configuration(environment_id:, configuration_id:, name:, description: nil, conversions: nil, enrichments: nil, normalizations: nil, source: nil)
453
+ raise ArgumentError.new("version must be provided") if version.nil?
454
+
440
455
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
441
456
 
442
457
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -487,6 +502,8 @@ module IBMWatson
487
502
  # @param configuration_id [String] The ID of the configuration.
488
503
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
489
504
  def delete_configuration(environment_id:, configuration_id:)
505
+ raise ArgumentError.new("version must be provided") if version.nil?
506
+
490
507
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
491
508
 
492
509
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -526,6 +543,8 @@ module IBMWatson
526
543
  # 639-1 language code.
527
544
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
528
545
  def create_collection(environment_id:, name:, description: nil, configuration_id: nil, language: nil)
546
+ raise ArgumentError.new("version must be provided") if version.nil?
547
+
529
548
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
530
549
 
531
550
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -567,6 +586,8 @@ module IBMWatson
567
586
  # @param name [String] Find collections with the given name.
568
587
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
569
588
  def list_collections(environment_id:, name: nil)
589
+ raise ArgumentError.new("version must be provided") if version.nil?
590
+
570
591
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
571
592
 
572
593
  headers = {
@@ -598,6 +619,8 @@ module IBMWatson
598
619
  # @param collection_id [String] The ID of the collection.
599
620
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
600
621
  def get_collection(environment_id:, collection_id:)
622
+ raise ArgumentError.new("version must be provided") if version.nil?
623
+
601
624
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
602
625
 
603
626
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -633,6 +656,8 @@ module IBMWatson
633
656
  # @param configuration_id [String] The ID of the configuration in which the collection is to be updated.
634
657
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
635
658
  def update_collection(environment_id:, collection_id:, name:, description: nil, configuration_id: nil)
659
+ raise ArgumentError.new("version must be provided") if version.nil?
660
+
636
661
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
637
662
 
638
663
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -674,6 +699,8 @@ module IBMWatson
674
699
  # @param collection_id [String] The ID of the collection.
675
700
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
676
701
  def delete_collection(environment_id:, collection_id:)
702
+ raise ArgumentError.new("version must be provided") if version.nil?
703
+
677
704
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
678
705
 
679
706
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -707,6 +734,8 @@ module IBMWatson
707
734
  # @param collection_id [String] The ID of the collection.
708
735
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
709
736
  def list_collection_fields(environment_id:, collection_id:)
737
+ raise ArgumentError.new("version must be provided") if version.nil?
738
+
710
739
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
711
740
 
712
741
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -744,6 +773,8 @@ module IBMWatson
744
773
  # @param collection_id [String] The ID of the collection.
745
774
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
746
775
  def list_expansions(environment_id:, collection_id:)
776
+ raise ArgumentError.new("version must be provided") if version.nil?
777
+
747
778
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
748
779
 
749
780
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -795,6 +826,8 @@ module IBMWatson
795
826
  # **expanded_terms** array.
796
827
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
797
828
  def create_expansions(environment_id:, collection_id:, expansions:)
829
+ raise ArgumentError.new("version must be provided") if version.nil?
830
+
798
831
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
799
832
 
800
833
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -836,6 +869,8 @@ module IBMWatson
836
869
  # @param collection_id [String] The ID of the collection.
837
870
  # @return [nil]
838
871
  def delete_expansions(environment_id:, collection_id:)
872
+ raise ArgumentError.new("version must be provided") if version.nil?
873
+
839
874
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
840
875
 
841
876
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -870,6 +905,8 @@ module IBMWatson
870
905
  # @param collection_id [String] The ID of the collection.
871
906
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
872
907
  def get_tokenization_dictionary_status(environment_id:, collection_id:)
908
+ raise ArgumentError.new("version must be provided") if version.nil?
909
+
873
910
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
874
911
 
875
912
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -906,6 +943,8 @@ module IBMWatson
906
943
  # `part_of_speech` the text is from.
907
944
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
908
945
  def create_tokenization_dictionary(environment_id:, collection_id:, tokenization_rules: nil)
946
+ raise ArgumentError.new("version must be provided") if version.nil?
947
+
909
948
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
910
949
 
911
950
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -944,6 +983,8 @@ module IBMWatson
944
983
  # @param collection_id [String] The ID of the collection.
945
984
  # @return [nil]
946
985
  def delete_tokenization_dictionary(environment_id:, collection_id:)
986
+ raise ArgumentError.new("version must be provided") if version.nil?
987
+
947
988
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
948
989
 
949
990
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -977,6 +1018,8 @@ module IBMWatson
977
1018
  # @param collection_id [String] The ID of the collection.
978
1019
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
979
1020
  def get_stopword_list_status(environment_id:, collection_id:)
1021
+ raise ArgumentError.new("version must be provided") if version.nil?
1022
+
980
1023
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
981
1024
 
982
1025
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1012,6 +1055,8 @@ module IBMWatson
1012
1055
  # @param stopword_filename [String] The filename for stopword_file.
1013
1056
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1014
1057
  def create_stopword_list(environment_id:, collection_id:, stopword_file:, stopword_filename: nil)
1058
+ raise ArgumentError.new("version must be provided") if version.nil?
1059
+
1015
1060
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1016
1061
 
1017
1062
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1057,6 +1102,8 @@ module IBMWatson
1057
1102
  # @param collection_id [String] The ID of the collection.
1058
1103
  # @return [nil]
1059
1104
  def delete_stopword_list(environment_id:, collection_id:)
1105
+ raise ArgumentError.new("version must be provided") if version.nil?
1106
+
1060
1107
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1061
1108
 
1062
1109
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1131,6 +1178,8 @@ module IBMWatson
1131
1178
  # } ```.
1132
1179
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1133
1180
  def add_document(environment_id:, collection_id:, file: nil, filename: nil, file_content_type: nil, metadata: nil)
1181
+ raise ArgumentError.new("version must be provided") if version.nil?
1182
+
1134
1183
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1135
1184
 
1136
1185
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1181,6 +1230,8 @@ module IBMWatson
1181
1230
  # @param document_id [String] The ID of the document.
1182
1231
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1183
1232
  def get_document_status(environment_id:, collection_id:, document_id:)
1233
+ raise ArgumentError.new("version must be provided") if version.nil?
1234
+
1184
1235
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1185
1236
 
1186
1237
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1232,6 +1283,8 @@ module IBMWatson
1232
1283
  # } ```.
1233
1284
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1234
1285
  def update_document(environment_id:, collection_id:, document_id:, file: nil, filename: nil, file_content_type: nil, metadata: nil)
1286
+ raise ArgumentError.new("version must be provided") if version.nil?
1287
+
1235
1288
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1236
1289
 
1237
1290
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1283,6 +1336,8 @@ module IBMWatson
1283
1336
  # @param document_id [String] The ID of the document.
1284
1337
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1285
1338
  def delete_document(environment_id:, collection_id:, document_id:)
1339
+ raise ArgumentError.new("version must be provided") if version.nil?
1340
+
1286
1341
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1287
1342
 
1288
1343
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1382,6 +1437,8 @@ module IBMWatson
1382
1437
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1383
1438
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1384
1439
  def query(environment_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil, bias: nil, spelling_suggestions: nil, x_watson_logging_opt_out: nil)
1440
+ raise ArgumentError.new("version must be provided") if version.nil?
1441
+
1385
1442
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1386
1443
 
1387
1444
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1486,6 +1543,8 @@ module IBMWatson
1486
1543
  # comparison.
1487
1544
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1488
1545
  def query_notices(environment_id:, collection_id:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil)
1546
+ raise ArgumentError.new("version must be provided") if version.nil?
1547
+
1489
1548
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1490
1549
 
1491
1550
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1596,6 +1655,8 @@ module IBMWatson
1596
1655
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1597
1656
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1598
1657
  def federated_query(environment_id:, collection_ids:, filter: nil, query: nil, natural_language_query: nil, passages: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, passages_fields: nil, passages_count: nil, passages_characters: nil, deduplicate: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil, bias: nil, x_watson_logging_opt_out: nil)
1658
+ raise ArgumentError.new("version must be provided") if version.nil?
1659
+
1599
1660
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1600
1661
 
1601
1662
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1694,6 +1755,8 @@ module IBMWatson
1694
1755
  # comparison.
1695
1756
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1696
1757
  def federated_query_notices(environment_id:, collection_ids:, filter: nil, query: nil, natural_language_query: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, deduplicate_field: nil, similar: nil, similar_document_ids: nil, similar_fields: nil)
1758
+ raise ArgumentError.new("version must be provided") if version.nil?
1759
+
1697
1760
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1698
1761
 
1699
1762
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1753,6 +1816,8 @@ module IBMWatson
1753
1816
  # @param count [Fixnum] The number of autocompletion suggestions to return.
1754
1817
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1755
1818
  def get_autocompletion(environment_id:, collection_id:, prefix:, field: nil, count: nil)
1819
+ raise ArgumentError.new("version must be provided") if version.nil?
1820
+
1756
1821
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1757
1822
 
1758
1823
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1794,6 +1859,8 @@ module IBMWatson
1794
1859
  # @param collection_id [String] The ID of the collection.
1795
1860
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1796
1861
  def list_training_data(environment_id:, collection_id:)
1862
+ raise ArgumentError.new("version must be provided") if version.nil?
1863
+
1797
1864
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1798
1865
 
1799
1866
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1832,6 +1899,8 @@ module IBMWatson
1832
1899
  # @param examples [Array[TrainingExample]] Array of training examples.
1833
1900
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1834
1901
  def add_training_data(environment_id:, collection_id:, natural_language_query: nil, filter: nil, examples: nil)
1902
+ raise ArgumentError.new("version must be provided") if version.nil?
1903
+
1835
1904
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1836
1905
 
1837
1906
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1872,6 +1941,8 @@ module IBMWatson
1872
1941
  # @param collection_id [String] The ID of the collection.
1873
1942
  # @return [nil]
1874
1943
  def delete_all_training_data(environment_id:, collection_id:)
1944
+ raise ArgumentError.new("version must be provided") if version.nil?
1945
+
1875
1946
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1876
1947
 
1877
1948
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1907,6 +1978,8 @@ module IBMWatson
1907
1978
  # @param query_id [String] The ID of the query used for training.
1908
1979
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1909
1980
  def get_training_data(environment_id:, collection_id:, query_id:)
1981
+ raise ArgumentError.new("version must be provided") if version.nil?
1982
+
1910
1983
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1911
1984
 
1912
1985
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1944,6 +2017,8 @@ module IBMWatson
1944
2017
  # @param query_id [String] The ID of the query used for training.
1945
2018
  # @return [nil]
1946
2019
  def delete_training_data(environment_id:, collection_id:, query_id:)
2020
+ raise ArgumentError.new("version must be provided") if version.nil?
2021
+
1947
2022
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1948
2023
 
1949
2024
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1980,6 +2055,8 @@ module IBMWatson
1980
2055
  # @param query_id [String] The ID of the query used for training.
1981
2056
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1982
2057
  def list_training_examples(environment_id:, collection_id:, query_id:)
2058
+ raise ArgumentError.new("version must be provided") if version.nil?
2059
+
1983
2060
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1984
2061
 
1985
2062
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2019,6 +2096,8 @@ module IBMWatson
2019
2096
  # @param relevance [Fixnum] The relevance of the training example.
2020
2097
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2021
2098
  def create_training_example(environment_id:, collection_id:, query_id:, document_id: nil, cross_reference: nil, relevance: nil)
2099
+ raise ArgumentError.new("version must be provided") if version.nil?
2100
+
2022
2101
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2023
2102
 
2024
2103
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2063,6 +2142,8 @@ module IBMWatson
2063
2142
  # @param example_id [String] The ID of the document as it is indexed.
2064
2143
  # @return [nil]
2065
2144
  def delete_training_example(environment_id:, collection_id:, query_id:, example_id:)
2145
+ raise ArgumentError.new("version must be provided") if version.nil?
2146
+
2066
2147
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2067
2148
 
2068
2149
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2104,6 +2185,8 @@ module IBMWatson
2104
2185
  # @param relevance [Fixnum] The relevance value for this example.
2105
2186
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2106
2187
  def update_training_example(environment_id:, collection_id:, query_id:, example_id:, cross_reference: nil, relevance: nil)
2188
+ raise ArgumentError.new("version must be provided") if version.nil?
2189
+
2107
2190
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2108
2191
 
2109
2192
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2149,6 +2232,8 @@ module IBMWatson
2149
2232
  # @param example_id [String] The ID of the document as it is indexed.
2150
2233
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2151
2234
  def get_training_example(environment_id:, collection_id:, query_id:, example_id:)
2235
+ raise ArgumentError.new("version must be provided") if version.nil?
2236
+
2152
2237
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2153
2238
 
2154
2239
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2194,6 +2279,8 @@ module IBMWatson
2194
2279
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2195
2280
  # @return [nil]
2196
2281
  def delete_user_data(customer_id:)
2282
+ raise ArgumentError.new("version must be provided") if version.nil?
2283
+
2197
2284
  raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
2198
2285
 
2199
2286
  headers = {
@@ -2231,6 +2318,8 @@ module IBMWatson
2231
2318
  # @param data [EventData] Query event data object.
2232
2319
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2233
2320
  def create_event(type:, data:)
2321
+ raise ArgumentError.new("version must be provided") if version.nil?
2322
+
2234
2323
  raise ArgumentError.new("type must be provided") if type.nil?
2235
2324
 
2236
2325
  raise ArgumentError.new("data must be provided") if data.nil?
@@ -2284,6 +2373,8 @@ module IBMWatson
2284
2373
  # ascending. Ascending is the default sort direction if no prefix is specified.
2285
2374
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2286
2375
  def query_log(filter: nil, query: nil, count: nil, offset: nil, sort: nil)
2376
+ raise ArgumentError.new("version must be provided") if version.nil?
2377
+
2287
2378
  headers = {
2288
2379
  }
2289
2380
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "query_log")
@@ -2323,6 +2414,8 @@ module IBMWatson
2323
2414
  # @param result_type [String] The type of result to consider when calculating the metric.
2324
2415
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2325
2416
  def get_metrics_query(start_time: nil, end_time: nil, result_type: nil)
2417
+ raise ArgumentError.new("version must be provided") if version.nil?
2418
+
2326
2419
  headers = {
2327
2420
  }
2328
2421
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query")
@@ -2360,6 +2453,8 @@ module IBMWatson
2360
2453
  # @param result_type [String] The type of result to consider when calculating the metric.
2361
2454
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2362
2455
  def get_metrics_query_event(start_time: nil, end_time: nil, result_type: nil)
2456
+ raise ArgumentError.new("version must be provided") if version.nil?
2457
+
2363
2458
  headers = {
2364
2459
  }
2365
2460
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_event")
@@ -2396,6 +2491,8 @@ module IBMWatson
2396
2491
  # @param result_type [String] The type of result to consider when calculating the metric.
2397
2492
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2398
2493
  def get_metrics_query_no_results(start_time: nil, end_time: nil, result_type: nil)
2494
+ raise ArgumentError.new("version must be provided") if version.nil?
2495
+
2399
2496
  headers = {
2400
2497
  }
2401
2498
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_no_results")
@@ -2433,6 +2530,8 @@ module IBMWatson
2433
2530
  # @param result_type [String] The type of result to consider when calculating the metric.
2434
2531
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2435
2532
  def get_metrics_event_rate(start_time: nil, end_time: nil, result_type: nil)
2533
+ raise ArgumentError.new("version must be provided") if version.nil?
2534
+
2436
2535
  headers = {
2437
2536
  }
2438
2537
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_event_rate")
@@ -2468,6 +2567,8 @@ module IBMWatson
2468
2567
  # together in any one query is **10000**.
2469
2568
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2470
2569
  def get_metrics_query_token_event(count: nil)
2570
+ raise ArgumentError.new("version must be provided") if version.nil?
2571
+
2471
2572
  headers = {
2472
2573
  }
2473
2574
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_token_event")
@@ -2503,6 +2604,8 @@ module IBMWatson
2503
2604
  # @param environment_id [String] The ID of the environment.
2504
2605
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2505
2606
  def list_credentials(environment_id:)
2607
+ raise ArgumentError.new("version must be provided") if version.nil?
2608
+
2506
2609
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2507
2610
 
2508
2611
  headers = {
@@ -2553,6 +2656,8 @@ module IBMWatson
2553
2656
  # expired) and must be corrected before they can be used with a collection.
2554
2657
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2555
2658
  def create_credentials(environment_id:, source_type: nil, credential_details: nil, status: nil)
2659
+ raise ArgumentError.new("version must be provided") if version.nil?
2660
+
2556
2661
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2557
2662
 
2558
2663
  headers = {
@@ -2594,6 +2699,8 @@ module IBMWatson
2594
2699
  # @param credential_id [String] The unique identifier for a set of source credentials.
2595
2700
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2596
2701
  def get_credentials(environment_id:, credential_id:)
2702
+ raise ArgumentError.new("version must be provided") if version.nil?
2703
+
2597
2704
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2598
2705
 
2599
2706
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2646,6 +2753,8 @@ module IBMWatson
2646
2753
  # expired) and must be corrected before they can be used with a collection.
2647
2754
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2648
2755
  def update_credentials(environment_id:, credential_id:, source_type: nil, credential_details: nil, status: nil)
2756
+ raise ArgumentError.new("version must be provided") if version.nil?
2757
+
2649
2758
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2650
2759
 
2651
2760
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2686,6 +2795,8 @@ module IBMWatson
2686
2795
  # @param credential_id [String] The unique identifier for a set of source credentials.
2687
2796
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2688
2797
  def delete_credentials(environment_id:, credential_id:)
2798
+ raise ArgumentError.new("version must be provided") if version.nil?
2799
+
2689
2800
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2690
2801
 
2691
2802
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2721,6 +2832,8 @@ module IBMWatson
2721
2832
  # @param environment_id [String] The ID of the environment.
2722
2833
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2723
2834
  def list_gateways(environment_id:)
2835
+ raise ArgumentError.new("version must be provided") if version.nil?
2836
+
2724
2837
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2725
2838
 
2726
2839
  headers = {
@@ -2752,6 +2865,8 @@ module IBMWatson
2752
2865
  # @param name [String] User-defined name.
2753
2866
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2754
2867
  def create_gateway(environment_id:, name: nil)
2868
+ raise ArgumentError.new("version must be provided") if version.nil?
2869
+
2755
2870
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2756
2871
 
2757
2872
  headers = {
@@ -2788,6 +2903,8 @@ module IBMWatson
2788
2903
  # @param gateway_id [String] The requested gateway ID.
2789
2904
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2790
2905
  def get_gateway(environment_id:, gateway_id:)
2906
+ raise ArgumentError.new("version must be provided") if version.nil?
2907
+
2791
2908
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2792
2909
 
2793
2910
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?
@@ -2821,6 +2938,8 @@ module IBMWatson
2821
2938
  # @param gateway_id [String] The requested gateway ID.
2822
2939
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2823
2940
  def delete_gateway(environment_id:, gateway_id:)
2941
+ raise ArgumentError.new("version must be provided") if version.nil?
2942
+
2824
2943
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2825
2944
 
2826
2945
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?