ibm_watson 1.3.1 → 2.0.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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -5
  3. data/lib/ibm_watson/assistant_v1.rb +225 -199
  4. data/lib/ibm_watson/assistant_v2.rb +228 -21
  5. data/lib/ibm_watson/compare_comply_v1.rb +43 -24
  6. data/lib/ibm_watson/discovery_v1.rb +144 -19
  7. data/lib/ibm_watson/discovery_v2.rb +742 -23
  8. data/lib/ibm_watson/language_translator_v3.rb +216 -64
  9. data/lib/ibm_watson/natural_language_classifier_v1.rb +11 -3
  10. data/lib/ibm_watson/natural_language_understanding_v1.rb +32 -26
  11. data/lib/ibm_watson/personality_insights_v3.rb +34 -19
  12. data/lib/ibm_watson/speech_to_text_v1.rb +239 -106
  13. data/lib/ibm_watson/text_to_speech_v1.rb +139 -146
  14. data/lib/ibm_watson/tone_analyzer_v3.rb +19 -14
  15. data/lib/ibm_watson/version.rb +1 -1
  16. data/lib/ibm_watson/visual_recognition_v3.rb +40 -17
  17. data/lib/ibm_watson/visual_recognition_v4.rb +110 -18
  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_compare_comply_v1.rb +1 -12
  21. data/test/integration/test_discovery_v2.rb +132 -6
  22. data/test/integration/test_language_translator_v3.rb +5 -0
  23. data/test/integration/test_text_to_speech_v1.rb +3 -3
  24. data/test/integration/test_visual_recognition_v4.rb +9 -0
  25. data/test/unit/test_assistant_v1.rb +149 -98
  26. data/test/unit/test_assistant_v2.rb +153 -8
  27. data/test/unit/test_compare_comply_v1.rb +20 -20
  28. data/test/unit/test_discovery_v1.rb +125 -125
  29. data/test/unit/test_discovery_v2.rb +262 -29
  30. data/test/unit/test_language_translator_v3.rb +85 -24
  31. data/test/unit/test_natural_language_classifier_v1.rb +17 -17
  32. data/test/unit/test_natural_language_understanding_v1.rb +10 -10
  33. data/test/unit/test_personality_insights_v3.rb +14 -14
  34. data/test/unit/test_speech_to_text_v1.rb +97 -97
  35. data/test/unit/test_text_to_speech_v1.rb +48 -48
  36. data/test/unit/test_tone_analyzer_v3.rb +12 -12
  37. data/test/unit/test_visual_recognition_v3.rb +16 -16
  38. data/test/unit/test_visual_recognition_v4.rb +56 -38
  39. metadata +3 -3
@@ -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
@@ -32,37 +34,36 @@ module IBMWatson
32
34
  # The Discovery V1 service.
33
35
  class DiscoveryV1 < IBMCloudSdkCore::BaseService
34
36
  include Concurrent::Async
37
+ DEFAULT_SERVICE_NAME = "discovery"
38
+ DEFAULT_SERVICE_URL = "https://api.us-south.discovery.watson.cloud.ibm.com"
39
+ attr_accessor :version
35
40
  ##
36
41
  # @!method initialize(args)
37
42
  # Construct a new client for the Discovery service.
38
43
  #
39
44
  # @param args [Hash] The args to initialize with
40
- # @option args version [String] The API version date to use with the service, in
41
- # "YYYY-MM-DD" format. Whenever the API is changed in a backwards
42
- # incompatible way, a new minor version of the API is released.
43
- # The service uses the API version for the date you specify, or
44
- # the most recent version before that date. Note that you should
45
- # not programmatically specify the current date at runtime, in
46
- # case the API has been updated since your application's release.
47
- # Instead, specify a version date that is compatible with your
48
- # application, and don't change it until your application is
49
- # 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`.
50
47
  # @option args service_url [String] The base service URL to use when contacting the service.
51
48
  # The base service_url may differ between IBM Cloud regions.
52
49
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
50
+ # @option args service_name [String] The name of the service to configure. Will be used as the key to load
51
+ # any external configuration, if applicable.
53
52
  def initialize(args = {})
54
53
  @__async_initialized__ = false
55
54
  defaults = {}
56
- defaults[:version] = nil
57
- defaults[:service_url] = "https://gateway.watsonplatform.net/discovery/api"
55
+ defaults[:service_url] = DEFAULT_SERVICE_URL
56
+ defaults[:service_name] = DEFAULT_SERVICE_NAME
58
57
  defaults[:authenticator] = nil
58
+ defaults[:version] = nil
59
+ user_service_url = args[:service_url] unless args[:service_url].nil?
59
60
  args = defaults.merge(args)
60
61
  @version = args[:version]
61
62
  raise ArgumentError.new("version must be provided") if @version.nil?
62
63
 
63
- args[:service_name] = "discovery"
64
64
  args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
65
65
  super
66
+ @service_url = user_service_url unless user_service_url.nil?
66
67
  end
67
68
 
68
69
  #########################
@@ -83,6 +84,8 @@ module IBMWatson
83
84
  # `LT`, in all other plans the default is `S`.
84
85
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
85
86
  def create_environment(name:, description: nil, size: nil)
87
+ raise ArgumentError.new("version must be provided") if version.nil?
88
+
86
89
  raise ArgumentError.new("name must be provided") if name.nil?
87
90
 
88
91
  headers = {
@@ -120,6 +123,8 @@ module IBMWatson
120
123
  # @param name [String] Show only the environment with the given name.
121
124
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
122
125
  def list_environments(name: nil)
126
+ raise ArgumentError.new("version must be provided") if version.nil?
127
+
123
128
  headers = {
124
129
  }
125
130
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "list_environments")
@@ -148,6 +153,8 @@ module IBMWatson
148
153
  # @param environment_id [String] The ID of the environment.
149
154
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
150
155
  def get_environment(environment_id:)
156
+ raise ArgumentError.new("version must be provided") if version.nil?
157
+
151
158
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
152
159
 
153
160
  headers = {
@@ -184,6 +191,8 @@ module IBMWatson
184
191
  # decreased.
185
192
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
186
193
  def update_environment(environment_id:, name: nil, description: nil, size: nil)
194
+ raise ArgumentError.new("version must be provided") if version.nil?
195
+
187
196
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
188
197
 
189
198
  headers = {
@@ -220,6 +229,8 @@ module IBMWatson
220
229
  # @param environment_id [String] The ID of the environment.
221
230
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
222
231
  def delete_environment(environment_id:)
232
+ raise ArgumentError.new("version must be provided") if version.nil?
233
+
223
234
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
224
235
 
225
236
  headers = {
@@ -252,6 +263,8 @@ module IBMWatson
252
263
  # @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
253
264
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
254
265
  def list_fields(environment_id:, collection_ids:)
266
+ raise ArgumentError.new("version must be provided") if version.nil?
267
+
255
268
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
256
269
 
257
270
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -308,6 +321,8 @@ module IBMWatson
308
321
  # @param source [Source] Object containing source parameters for the configuration.
309
322
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
310
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
+
311
326
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
312
327
 
313
328
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -351,6 +366,8 @@ module IBMWatson
351
366
  # @param name [String] Find configurations with the given name.
352
367
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
353
368
  def list_configurations(environment_id:, name: nil)
369
+ raise ArgumentError.new("version must be provided") if version.nil?
370
+
354
371
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
355
372
 
356
373
  headers = {
@@ -382,6 +399,8 @@ module IBMWatson
382
399
  # @param configuration_id [String] The ID of the configuration.
383
400
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
384
401
  def get_configuration(environment_id:, configuration_id:)
402
+ raise ArgumentError.new("version must be provided") if version.nil?
403
+
385
404
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
386
405
 
387
406
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -431,6 +450,8 @@ module IBMWatson
431
450
  # @param source [Source] Object containing source parameters for the configuration.
432
451
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
433
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
+
434
455
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
435
456
 
436
457
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -481,6 +502,8 @@ module IBMWatson
481
502
  # @param configuration_id [String] The ID of the configuration.
482
503
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
483
504
  def delete_configuration(environment_id:, configuration_id:)
505
+ raise ArgumentError.new("version must be provided") if version.nil?
506
+
484
507
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
485
508
 
486
509
  raise ArgumentError.new("configuration_id must be provided") if configuration_id.nil?
@@ -520,6 +543,8 @@ module IBMWatson
520
543
  # 639-1 language code.
521
544
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
522
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
+
523
548
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
524
549
 
525
550
  raise ArgumentError.new("name must be provided") if name.nil?
@@ -561,6 +586,8 @@ module IBMWatson
561
586
  # @param name [String] Find collections with the given name.
562
587
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
563
588
  def list_collections(environment_id:, name: nil)
589
+ raise ArgumentError.new("version must be provided") if version.nil?
590
+
564
591
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
565
592
 
566
593
  headers = {
@@ -592,6 +619,8 @@ module IBMWatson
592
619
  # @param collection_id [String] The ID of the collection.
593
620
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
594
621
  def get_collection(environment_id:, collection_id:)
622
+ raise ArgumentError.new("version must be provided") if version.nil?
623
+
595
624
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
596
625
 
597
626
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -627,6 +656,8 @@ module IBMWatson
627
656
  # @param configuration_id [String] The ID of the configuration in which the collection is to be updated.
628
657
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
629
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
+
630
661
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
631
662
 
632
663
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -668,6 +699,8 @@ module IBMWatson
668
699
  # @param collection_id [String] The ID of the collection.
669
700
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
670
701
  def delete_collection(environment_id:, collection_id:)
702
+ raise ArgumentError.new("version must be provided") if version.nil?
703
+
671
704
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
672
705
 
673
706
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -701,6 +734,8 @@ module IBMWatson
701
734
  # @param collection_id [String] The ID of the collection.
702
735
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
703
736
  def list_collection_fields(environment_id:, collection_id:)
737
+ raise ArgumentError.new("version must be provided") if version.nil?
738
+
704
739
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
705
740
 
706
741
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -738,6 +773,8 @@ module IBMWatson
738
773
  # @param collection_id [String] The ID of the collection.
739
774
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
740
775
  def list_expansions(environment_id:, collection_id:)
776
+ raise ArgumentError.new("version must be provided") if version.nil?
777
+
741
778
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
742
779
 
743
780
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -789,6 +826,8 @@ module IBMWatson
789
826
  # **expanded_terms** array.
790
827
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
791
828
  def create_expansions(environment_id:, collection_id:, expansions:)
829
+ raise ArgumentError.new("version must be provided") if version.nil?
830
+
792
831
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
793
832
 
794
833
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -830,6 +869,8 @@ module IBMWatson
830
869
  # @param collection_id [String] The ID of the collection.
831
870
  # @return [nil]
832
871
  def delete_expansions(environment_id:, collection_id:)
872
+ raise ArgumentError.new("version must be provided") if version.nil?
873
+
833
874
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
834
875
 
835
876
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -864,6 +905,8 @@ module IBMWatson
864
905
  # @param collection_id [String] The ID of the collection.
865
906
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
866
907
  def get_tokenization_dictionary_status(environment_id:, collection_id:)
908
+ raise ArgumentError.new("version must be provided") if version.nil?
909
+
867
910
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
868
911
 
869
912
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -900,6 +943,8 @@ module IBMWatson
900
943
  # `part_of_speech` the text is from.
901
944
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
902
945
  def create_tokenization_dictionary(environment_id:, collection_id:, tokenization_rules: nil)
946
+ raise ArgumentError.new("version must be provided") if version.nil?
947
+
903
948
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
904
949
 
905
950
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -938,6 +983,8 @@ module IBMWatson
938
983
  # @param collection_id [String] The ID of the collection.
939
984
  # @return [nil]
940
985
  def delete_tokenization_dictionary(environment_id:, collection_id:)
986
+ raise ArgumentError.new("version must be provided") if version.nil?
987
+
941
988
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
942
989
 
943
990
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -971,6 +1018,8 @@ module IBMWatson
971
1018
  # @param collection_id [String] The ID of the collection.
972
1019
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
973
1020
  def get_stopword_list_status(environment_id:, collection_id:)
1021
+ raise ArgumentError.new("version must be provided") if version.nil?
1022
+
974
1023
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
975
1024
 
976
1025
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1006,6 +1055,8 @@ module IBMWatson
1006
1055
  # @param stopword_filename [String] The filename for stopword_file.
1007
1056
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1008
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
+
1009
1060
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1010
1061
 
1011
1062
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1051,6 +1102,8 @@ module IBMWatson
1051
1102
  # @param collection_id [String] The ID of the collection.
1052
1103
  # @return [nil]
1053
1104
  def delete_stopword_list(environment_id:, collection_id:)
1105
+ raise ArgumentError.new("version must be provided") if version.nil?
1106
+
1054
1107
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1055
1108
 
1056
1109
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1125,6 +1178,8 @@ module IBMWatson
1125
1178
  # } ```.
1126
1179
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1127
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
+
1128
1183
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1129
1184
 
1130
1185
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1175,6 +1230,8 @@ module IBMWatson
1175
1230
  # @param document_id [String] The ID of the document.
1176
1231
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1177
1232
  def get_document_status(environment_id:, collection_id:, document_id:)
1233
+ raise ArgumentError.new("version must be provided") if version.nil?
1234
+
1178
1235
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1179
1236
 
1180
1237
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1226,6 +1283,8 @@ module IBMWatson
1226
1283
  # } ```.
1227
1284
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1228
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
+
1229
1288
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1230
1289
 
1231
1290
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1277,6 +1336,8 @@ module IBMWatson
1277
1336
  # @param document_id [String] The ID of the document.
1278
1337
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1279
1338
  def delete_document(environment_id:, collection_id:, document_id:)
1339
+ raise ArgumentError.new("version must be provided") if version.nil?
1340
+
1280
1341
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1281
1342
 
1282
1343
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1312,7 +1373,7 @@ module IBMWatson
1312
1373
  # Query a collection.
1313
1374
  # By using this method, you can construct long queries. For details, see the
1314
1375
  # [Discovery
1315
- # documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts).
1376
+ # documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts).
1316
1377
  # @param environment_id [String] The ID of the environment.
1317
1378
  # @param collection_id [String] The ID of the collection.
1318
1379
  # @param filter [String] A cacheable query that excludes documents that don't mention the query content.
@@ -1376,6 +1437,8 @@ module IBMWatson
1376
1437
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1377
1438
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1378
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
+
1379
1442
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1380
1443
 
1381
1444
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1432,7 +1495,7 @@ module IBMWatson
1432
1495
  # Queries for notices (errors or warnings) that might have been generated by the
1433
1496
  # system. Notices are generated when ingesting documents and performing relevance
1434
1497
  # training. See the [Discovery
1435
- # documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts)
1498
+ # documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts)
1436
1499
  # for more details on the query language.
1437
1500
  # @param environment_id [String] The ID of the environment.
1438
1501
  # @param collection_id [String] The ID of the collection.
@@ -1480,6 +1543,8 @@ module IBMWatson
1480
1543
  # comparison.
1481
1544
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1482
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
+
1483
1548
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1484
1549
 
1485
1550
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1532,7 +1597,7 @@ module IBMWatson
1532
1597
  # Query multiple collections.
1533
1598
  # By using this method, you can construct long queries that search multiple
1534
1599
  # collection. For details, see the [Discovery
1535
- # documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts).
1600
+ # documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts).
1536
1601
  # @param environment_id [String] The ID of the environment.
1537
1602
  # @param collection_ids [String] A comma-separated list of collection IDs to be queried against.
1538
1603
  # @param filter [String] A cacheable query that excludes documents that don't mention the query content.
@@ -1590,6 +1655,8 @@ module IBMWatson
1590
1655
  # @param x_watson_logging_opt_out [Boolean] If `true`, queries are not stored in the Discovery **Logs** endpoint.
1591
1656
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1592
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
+
1593
1660
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1594
1661
 
1595
1662
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1646,7 +1713,7 @@ module IBMWatson
1646
1713
  # Queries for notices (errors or warnings) that might have been generated by the
1647
1714
  # system. Notices are generated when ingesting documents and performing relevance
1648
1715
  # training. See the [Discovery
1649
- # documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts)
1716
+ # documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts)
1650
1717
  # for more details on the query language.
1651
1718
  # @param environment_id [String] The ID of the environment.
1652
1719
  # @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
@@ -1688,6 +1755,8 @@ module IBMWatson
1688
1755
  # comparison.
1689
1756
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1690
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
+
1691
1760
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1692
1761
 
1693
1762
  raise ArgumentError.new("collection_ids must be provided") if collection_ids.nil?
@@ -1747,6 +1816,8 @@ module IBMWatson
1747
1816
  # @param count [Fixnum] The number of autocompletion suggestions to return.
1748
1817
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1749
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
+
1750
1821
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1751
1822
 
1752
1823
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1788,6 +1859,8 @@ module IBMWatson
1788
1859
  # @param collection_id [String] The ID of the collection.
1789
1860
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1790
1861
  def list_training_data(environment_id:, collection_id:)
1862
+ raise ArgumentError.new("version must be provided") if version.nil?
1863
+
1791
1864
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1792
1865
 
1793
1866
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1826,6 +1899,8 @@ module IBMWatson
1826
1899
  # @param examples [Array[TrainingExample]] Array of training examples.
1827
1900
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1828
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
+
1829
1904
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1830
1905
 
1831
1906
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1866,6 +1941,8 @@ module IBMWatson
1866
1941
  # @param collection_id [String] The ID of the collection.
1867
1942
  # @return [nil]
1868
1943
  def delete_all_training_data(environment_id:, collection_id:)
1944
+ raise ArgumentError.new("version must be provided") if version.nil?
1945
+
1869
1946
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1870
1947
 
1871
1948
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1901,6 +1978,8 @@ module IBMWatson
1901
1978
  # @param query_id [String] The ID of the query used for training.
1902
1979
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1903
1980
  def get_training_data(environment_id:, collection_id:, query_id:)
1981
+ raise ArgumentError.new("version must be provided") if version.nil?
1982
+
1904
1983
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1905
1984
 
1906
1985
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1938,6 +2017,8 @@ module IBMWatson
1938
2017
  # @param query_id [String] The ID of the query used for training.
1939
2018
  # @return [nil]
1940
2019
  def delete_training_data(environment_id:, collection_id:, query_id:)
2020
+ raise ArgumentError.new("version must be provided") if version.nil?
2021
+
1941
2022
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1942
2023
 
1943
2024
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -1974,6 +2055,8 @@ module IBMWatson
1974
2055
  # @param query_id [String] The ID of the query used for training.
1975
2056
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1976
2057
  def list_training_examples(environment_id:, collection_id:, query_id:)
2058
+ raise ArgumentError.new("version must be provided") if version.nil?
2059
+
1977
2060
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
1978
2061
 
1979
2062
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2013,6 +2096,8 @@ module IBMWatson
2013
2096
  # @param relevance [Fixnum] The relevance of the training example.
2014
2097
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2015
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
+
2016
2101
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2017
2102
 
2018
2103
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2057,6 +2142,8 @@ module IBMWatson
2057
2142
  # @param example_id [String] The ID of the document as it is indexed.
2058
2143
  # @return [nil]
2059
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
+
2060
2147
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2061
2148
 
2062
2149
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2098,6 +2185,8 @@ module IBMWatson
2098
2185
  # @param relevance [Fixnum] The relevance value for this example.
2099
2186
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2100
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
+
2101
2190
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2102
2191
 
2103
2192
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2143,6 +2232,8 @@ module IBMWatson
2143
2232
  # @param example_id [String] The ID of the document as it is indexed.
2144
2233
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2145
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
+
2146
2237
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2147
2238
 
2148
2239
  raise ArgumentError.new("collection_id must be provided") if collection_id.nil?
@@ -2184,10 +2275,12 @@ module IBMWatson
2184
2275
  # You associate a customer ID with data by passing the **X-Watson-Metadata** header
2185
2276
  # with a request that passes data. For more information about personal data and
2186
2277
  # customer IDs, see [Information
2187
- # security](https://cloud.ibm.com/docs/services/discovery?topic=discovery-information-security#information-security).
2278
+ # security](https://cloud.ibm.com/docs/discovery?topic=discovery-information-security#information-security).
2188
2279
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2189
2280
  # @return [nil]
2190
2281
  def delete_user_data(customer_id:)
2282
+ raise ArgumentError.new("version must be provided") if version.nil?
2283
+
2191
2284
  raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
2192
2285
 
2193
2286
  headers = {
@@ -2225,6 +2318,8 @@ module IBMWatson
2225
2318
  # @param data [EventData] Query event data object.
2226
2319
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2227
2320
  def create_event(type:, data:)
2321
+ raise ArgumentError.new("version must be provided") if version.nil?
2322
+
2228
2323
  raise ArgumentError.new("type must be provided") if type.nil?
2229
2324
 
2230
2325
  raise ArgumentError.new("data must be provided") if data.nil?
@@ -2278,6 +2373,8 @@ module IBMWatson
2278
2373
  # ascending. Ascending is the default sort direction if no prefix is specified.
2279
2374
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2280
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
+
2281
2378
  headers = {
2282
2379
  }
2283
2380
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "query_log")
@@ -2317,6 +2414,8 @@ module IBMWatson
2317
2414
  # @param result_type [String] The type of result to consider when calculating the metric.
2318
2415
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2319
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
+
2320
2419
  headers = {
2321
2420
  }
2322
2421
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query")
@@ -2354,6 +2453,8 @@ module IBMWatson
2354
2453
  # @param result_type [String] The type of result to consider when calculating the metric.
2355
2454
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2356
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
+
2357
2458
  headers = {
2358
2459
  }
2359
2460
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_event")
@@ -2390,6 +2491,8 @@ module IBMWatson
2390
2491
  # @param result_type [String] The type of result to consider when calculating the metric.
2391
2492
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2392
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
+
2393
2496
  headers = {
2394
2497
  }
2395
2498
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_no_results")
@@ -2427,6 +2530,8 @@ module IBMWatson
2427
2530
  # @param result_type [String] The type of result to consider when calculating the metric.
2428
2531
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2429
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
+
2430
2535
  headers = {
2431
2536
  }
2432
2537
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_event_rate")
@@ -2462,6 +2567,8 @@ module IBMWatson
2462
2567
  # together in any one query is **10000**.
2463
2568
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2464
2569
  def get_metrics_query_token_event(count: nil)
2570
+ raise ArgumentError.new("version must be provided") if version.nil?
2571
+
2465
2572
  headers = {
2466
2573
  }
2467
2574
  sdk_headers = Common.new.get_sdk_headers("discovery", "V1", "get_metrics_query_token_event")
@@ -2497,6 +2604,8 @@ module IBMWatson
2497
2604
  # @param environment_id [String] The ID of the environment.
2498
2605
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2499
2606
  def list_credentials(environment_id:)
2607
+ raise ArgumentError.new("version must be provided") if version.nil?
2608
+
2500
2609
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2501
2610
 
2502
2611
  headers = {
@@ -2547,6 +2656,8 @@ module IBMWatson
2547
2656
  # expired) and must be corrected before they can be used with a collection.
2548
2657
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2549
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
+
2550
2661
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2551
2662
 
2552
2663
  headers = {
@@ -2588,6 +2699,8 @@ module IBMWatson
2588
2699
  # @param credential_id [String] The unique identifier for a set of source credentials.
2589
2700
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2590
2701
  def get_credentials(environment_id:, credential_id:)
2702
+ raise ArgumentError.new("version must be provided") if version.nil?
2703
+
2591
2704
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2592
2705
 
2593
2706
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2640,6 +2753,8 @@ module IBMWatson
2640
2753
  # expired) and must be corrected before they can be used with a collection.
2641
2754
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2642
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
+
2643
2758
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2644
2759
 
2645
2760
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2680,6 +2795,8 @@ module IBMWatson
2680
2795
  # @param credential_id [String] The unique identifier for a set of source credentials.
2681
2796
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2682
2797
  def delete_credentials(environment_id:, credential_id:)
2798
+ raise ArgumentError.new("version must be provided") if version.nil?
2799
+
2683
2800
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2684
2801
 
2685
2802
  raise ArgumentError.new("credential_id must be provided") if credential_id.nil?
@@ -2715,6 +2832,8 @@ module IBMWatson
2715
2832
  # @param environment_id [String] The ID of the environment.
2716
2833
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2717
2834
  def list_gateways(environment_id:)
2835
+ raise ArgumentError.new("version must be provided") if version.nil?
2836
+
2718
2837
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2719
2838
 
2720
2839
  headers = {
@@ -2746,6 +2865,8 @@ module IBMWatson
2746
2865
  # @param name [String] User-defined name.
2747
2866
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2748
2867
  def create_gateway(environment_id:, name: nil)
2868
+ raise ArgumentError.new("version must be provided") if version.nil?
2869
+
2749
2870
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2750
2871
 
2751
2872
  headers = {
@@ -2782,6 +2903,8 @@ module IBMWatson
2782
2903
  # @param gateway_id [String] The requested gateway ID.
2783
2904
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2784
2905
  def get_gateway(environment_id:, gateway_id:)
2906
+ raise ArgumentError.new("version must be provided") if version.nil?
2907
+
2785
2908
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2786
2909
 
2787
2910
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?
@@ -2815,6 +2938,8 @@ module IBMWatson
2815
2938
  # @param gateway_id [String] The requested gateway ID.
2816
2939
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2817
2940
  def delete_gateway(environment_id:, gateway_id:)
2941
+ raise ArgumentError.new("version must be provided") if version.nil?
2942
+
2818
2943
  raise ArgumentError.new("environment_id must be provided") if environment_id.nil?
2819
2944
 
2820
2945
  raise ArgumentError.new("gateway_id must be provided") if gateway_id.nil?